Package org.qi4j.sample.dcicargo.sample_b.data.structure.voyage

Examples of org.qi4j.sample.dcicargo.sample_b.data.structure.voyage.CarrierMovement.arrivalLocation()


                    // ... We could notify cargo owner if we already now know that we will miss the next ship
                }

                ValueBuilder<NextHandlingEvent> nextHandlingEvent = vbf.newValueBuilder( NextHandlingEvent.class );
                nextHandlingEvent.prototype().handlingEventType().set( UNLOAD );
                nextHandlingEvent.prototype().location().set( carrierMovement.arrivalLocation().get() );
                nextHandlingEvent.prototype().time().set( estimatedArrivalDate );
                nextHandlingEvent.prototype().voyage().set( c.voyage );
                newDelivery.nextHandlingEvent().set( nextHandlingEvent.newInstance() );

                // Step 3 - Verify cargo is routed
View Full Code Here


                    cargo.delivery().set( newDeliveryBuilder.newInstance() );

                    // ...Expected arrival location - should we accept this?
                    if( plannedCarrierMovement.unloadLocation()
                        .get()
                        .equals( carrierMovement.arrivalLocation().get() ) )
                    {
                        throw new CargoMisdirectedException( c.loadEvent, c.itinerary, "Cargo is heading to expected arrival location "
                                                                                       + plannedCarrierMovement.unloadLocation()
                            .get() + " but on unexpected voyage "
                                                                                       + c.voyage
View Full Code Here

                                                                                   + plannedCarrierMovement.voyage()
                        .get() );
                }

                // Unexpected carrier destination
                if( !plannedCarrierMovement.unloadLocation().get().equals( carrierMovement.arrivalLocation().get() ) )
                {
                    newDelivery.isMisdirected().set( true );
                    cargo.delivery().set( newDeliveryBuilder.newInstance() );
                    throw new CargoMisdirectedException( c.loadEvent, "Itinerary expects voyage " + c.voyage.toString()
                                                                      + " to arrive in " + plannedCarrierMovement.unloadLocation()
View Full Code Here

                    newDelivery.isMisdirected().set( true );
                    cargo.delivery().set( newDeliveryBuilder.newInstance() );
                    throw new CargoMisdirectedException( c.loadEvent, "Itinerary expects voyage " + c.voyage.toString()
                                                                      + " to arrive in " + plannedCarrierMovement.unloadLocation()
                        .get() + " but carrier is now going to "
                                                                      + carrierMovement.arrivalLocation().get() );
                }

                // True exception
                if( ( c.loadLocation.getCode().equals( "SOMGQ" ) && new Random().nextInt( 100 ) < 20 ) ||
                    ( carrierMovement.arrivalLocation()
View Full Code Here

                                                                      + carrierMovement.arrivalLocation().get() );
                }

                // True exception
                if( ( c.loadLocation.getCode().equals( "SOMGQ" ) && new Random().nextInt( 100 ) < 20 ) ||
                    ( carrierMovement.arrivalLocation()
                          .get()
                          .getCode()
                          .equals( "SOMGQ" ) && new Random().nextInt( 100 ) < 15 ) )
                {
                    newDelivery.transportStatus().set( UNKNOWN );
View Full Code Here

                                    .get( depth );
                                final boolean goingFromSamePort = movement.departureLocation()
                                    .get()
                                    .getCode()
                                    .equals( port );
                                final boolean notGoingToDestination = !movement.arrivalLocation()
                                    .get()
                                    .equals( routeSpec.destination().get() );

                                if( goingFromSamePort && notGoingToDestination )
                                {
View Full Code Here

                    if( i == 17 )
                    {
                        voyage = uow.get( Voyage.class, voyageNumber );
                        for( CarrierMovement movement : voyage.schedule().get().carrierMovements().get() )
                        {
                            final String arrivalPort = movement.arrivalLocation().get().getCode();

                            // Take first voyage with different arrival location
                            if( !arrivalPort.equals( port ) )
                            {
                                wrongPort = movement.arrivalLocation().get().unLocode().get().code().get();
View Full Code Here

                            final String arrivalPort = movement.arrivalLocation().get().getCode();

                            // Take first voyage with different arrival location
                            if( !arrivalPort.equals( port ) )
                            {
                                wrongPort = movement.arrivalLocation().get().unLocode().get().code().get();
                                break;
                            }
                        }
                        registerEvent( time, time, trackingId, UNLOAD, wrongPort, voyageNumber );
                    }
View Full Code Here

                                                             .get()
                                                             .getTime() + duration );
                    }

                    nextHandlingEvent.handlingEventType().set( UNLOAD );
                    nextHandlingEvent.location().set( carrierMovement.arrivalLocation().get() );
                    nextHandlingEvent.time().set( estimatedArrivalDate );
                    nextHandlingEvent.voyage().set( c.lastHandlingEvent.voyage().get() );
                }
                else // IN_PORT
                {
View Full Code Here

                    if( carrierMovement == null )
                    {
                        throw new UnexpectedCarrierException( c.lastHandlingEvent );
                    }

                    newOrigin = carrierMovement.arrivalLocation().get();
                    newEarliestDeparture = carrierMovement.arrivalTime().get();
                }
                else
                {
                    newOrigin = c.lastHandlingEvent.location().get();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.