コード例 #1
0
 @Override
 public String bookNewCargo(String origin, String destination, Date arrivalDeadline) {
   TrackingId trackingId =
       bookingService.bookNewCargo(
           new UnLocode(origin), new UnLocode(destination), arrivalDeadline);
   return trackingId.idString();
 }
コード例 #2
0
  @Override
  public void assignCargoToRoute(String trackingIdStr, RouteCandidateDTO routeCandidateDTO) {
    final Itinerary itinerary =
        new ItineraryCandidateDTOAssembler()
            .fromDTO(routeCandidateDTO, voyageRepository, locationRepository);
    final TrackingId trackingId = new TrackingId(trackingIdStr);

    bookingService.assignCargoToRoute(itinerary, trackingId);
  }
コード例 #3
0
  @Override
  public List<RouteCandidateDTO> requestPossibleRoutesForCargo(String trackingId)
      throws RemoteException {
    final List<Itinerary> itineraries =
        bookingService.requestPossibleRoutesForCargo(new TrackingId(trackingId));

    final List<RouteCandidateDTO> routeCandidates =
        new ArrayList<RouteCandidateDTO>(itineraries.size());
    final ItineraryCandidateDTOAssembler dtoAssembler = new ItineraryCandidateDTOAssembler();
    for (Itinerary itinerary : itineraries) {
      routeCandidates.add(dtoAssembler.toDTO(itinerary));
    }

    return routeCandidates;
  }
コード例 #4
0
 @Override
 public void changeDestination(String trackingId, String destinationUnLocode)
     throws RemoteException {
   bookingService.changeDestination(new TrackingId(trackingId), new UnLocode(destinationUnLocode));
 }