Table of content



The Flight entity within the microservice architecture

Entity-Relationship-Model of <AirportService>

Entity Name: Flight

Data Schema: AirportLogistics

Master Service: AirportService


Dataflow of entity of Flight

Microservices

3.1 AirplaneService3.2 AirportService3.3 CargoService3.4 CountryService3.5 EmployeeService3.6 LuggageService
3.7 PassengerBookingService

Entity Properties

Property NameDatatypeData EntityReference Entity
AirplaneLONGFlightAirplane
ArrivalGateLONGFlightGate
DepartureGateLONGFlightGate
FlightNoSTRINGFlight
FlightRouteLONGFlightFlightRoute
FromDateLONGFlight
PrimaryKeyLONGFlight
ServerReplicationVersionLONGFlight
ToDateLONGFlight

Service Interfaces

Relative mapping URLRequest MethodMethod NameMicroserviceInvolved Entities
/flight/{id}GETfindFlightById(id)AirportServiceFlight
/passengerbooking/flight/{id}GETfindAllPassengerBookingOfFlight(id)PassengerBookingServiceFlight PassengerBooking
/flightPOSTinsertFlight(flight)AirportServiceFlight
/flight/arrivalgate/{id}GETfindAllFlightOfArrivalGate(id)AirportServiceGate Flight
/flight/flightroute/{id}GETfindAllFlightOfFlightRoute(id)AirportServiceFlightRoute Flight
/flight/airplane/{id}GETfindAllFlightOfAirplane(id)AirportServiceAirplane Flight
/cargobooking/flight/{id}GETfindAllCargoBookingOfFlight(id)EmployeeServiceFlight CargoBooking
/flight/{id}PUTupdateFlightById(flight)AirportServiceFlight
/flight/departuregate/{id}GETfindAllFlightOfDepartureGate(id)AirportServiceGate Flight
/flightGETfindAllFlight()AirportServiceFlight
/flight/{id}DELETEdeleteFlightById(id)AirportServiceFlight

Distributed transaction of <Flight>

Pseudo code snippet

final Flight flight = (Flight) this.callMicroservice(ServiceNames.AIRPORT_SERVICE + "/flight/" + id, Flight.class);
if (flight != null) {
    final Gate departuregate1 = (Gate) this.callMicroservice(ServiceNames.AIRPORT_SERVICE + "/gate/" + flight.getDepartureGate().getId(), Gate.class);
    if (departuregate1 != null) {
        final Terminal terminal2 = (Terminal) this.callMicroservice(ServiceNames.AIRPORT_SERVICE + "/terminal/" + departuregate1.getTerminal().getId(), Terminal.class);
        if (terminal2 != null) {
            final Airport airport3 = (Airport) this.callMicroservice(ServiceNames.AIRPORT_SERVICE + "/airport/" + terminal2.getAirport().getId(), Airport.class);
            if (airport3 != null) {
                final City city4 = (City) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/city/" + airport3.getCity().getId(), City.class);
                if (city4 != null) {
                    final Country country5 = (Country) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/country/" + city4.getCountry().getId(), Country.class);
                    if (country5 != null) {
                    }
                }
            }
        }
    }
    final Airplane airplane6 = (Airplane) this.callMicroservice(ServiceNames.AIRPLANE_SERVICE + "/airplane/" + flight.getAirplane().getId(), Airplane.class);
    if (airplane6 != null) {
        final Airline airline7 = (Airline) this.callMicroservice(ServiceNames.AIRPLANE_SERVICE + "/airline/" + airplane6.getAirline().getId(), Airline.class);
        if (airline7 != null) {
        }
        final AirplaneType airplanetype8 = (AirplaneType) this.callMicroservice(ServiceNames.AIRPLANE_SERVICE + "/airplanetype/" + airplane6.getAirplaneType().getId(), AirplaneType.class);
        if (airplanetype8 != null) {
            final AirplaneProducer airplaneproducer9 = (AirplaneProducer) this.callMicroservice(ServiceNames.AIRPLANE_SERVICE + "/airplaneproducer/" + airplanetype8.getAirplaneProducer().getId(), AirplaneProducer.class);
            if (airplaneproducer9 != null) {
            }
        }
    }
    final FlightRoute flightroute10 = (FlightRoute) this.callMicroservice(ServiceNames.AIRPORT_SERVICE + "/flightroute/" + flight.getFlightRoute().getId(), FlightRoute.class);
    if (flightroute10 != null) {
        final Airport destination11 = (Airport) this.callMicroservice(ServiceNames.AIRPORT_SERVICE + "/airport/" + flightroute10.getDestination().getId(), Airport.class);
        if (destination11 != null) {
            final City city12 = (City) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/city/" + destination11.getCity().getId(), City.class);
            if (city12 != null) {
                final Country country13 = (Country) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/country/" + city12.getCountry().getId(), Country.class);
                if (country13 != null) {
                }
            }
        }
        final Airport source14 = (Airport) this.callMicroservice(ServiceNames.AIRPORT_SERVICE + "/airport/" + flightroute10.getSource().getId(), Airport.class);
        if (source14 != null) {
            final City city15 = (City) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/city/" + source14.getCity().getId(), City.class);
            if (city15 != null) {
                final Country country16 = (Country) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/country/" + city15.getCountry().getId(), Country.class);
                if (country16 != null) {
                }
            }
        }
    }
    final Gate arrivalgate17 = (Gate) this.callMicroservice(ServiceNames.AIRPORT_SERVICE + "/gate/" + flight.getArrivalGate().getId(), Gate.class);
    if (arrivalgate17 != null) {
        final Terminal terminal18 = (Terminal) this.callMicroservice(ServiceNames.AIRPORT_SERVICE + "/terminal/" + arrivalgate17.getTerminal().getId(), Terminal.class);
        if (terminal18 != null) {
            final Airport airport19 = (Airport) this.callMicroservice(ServiceNames.AIRPORT_SERVICE + "/airport/" + terminal18.getAirport().getId(), Airport.class);
            if (airport19 != null) {
                final City city20 = (City) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/city/" + airport19.getCity().getId(), City.class);
                if (city20 != null) {
                    final Country country21 = (Country) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/country/" + city20.getCountry().getId(), Country.class);
                    if (country21 != null) {
                    }
                }
            }
        }
    }
}
return flight;


Table of content