Package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.exception

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.exception.InspectionFailedException


        // Pre-conditions
        if( arrivalEvent == null ||
            !arrivalEvent.handlingEventType().get().equals( UNLOAD ) ||
            !arrivalLocation.equals( destination ) )
        {
            throw new InspectionFailedException( "Can only inspect arrived cargo." );
        }

        deliveryInspector.inspectArrivedCargo();
    }
View Full Code Here


        // Pre-conditions
        if( unloadEvent == null || !unloadEvent.handlingEventType()
            .get()
            .equals( UNLOAD ) || unloadLocation.equals( destination ) )
        {
            throw new InspectionFailedException( "Can only inspect unloaded cargo that hasn't arrived at destination." );
        }

        deliveryInspector.inspectUnloadedCargo();
    }
View Full Code Here

                // Step 3 - Verify cargo is on track

                Leg plannedCarrierMovement = c.itinerary.leg( c.itineraryProgressIndex );
                if( plannedCarrierMovement == null )
                {
                    throw new InspectionFailedException( "Itinerary progress index '" + c.itineraryProgressIndex + "' is invalid!" );
                }

                Integer itineraryProgressIndex;
//                if (c.wasMisdirected && c.unloadLocation.equals( c.routeSpecification.origin().get() ))
                if( c.unloadLocation.equals( c.routeSpecification.origin().get() ) )
View Full Code Here

        throws InspectionException
    {
        // Pre-conditions
        if( customsEvent == null || !customsEvent.handlingEventType().get().equals( CUSTOMS ) )
        {
            throw new InspectionFailedException( "Can only inspect cargo in customs." );
        }

        if( transportStatus.equals( ONBOARD_CARRIER ) )
        {
            throw new InspectionFailedException( "Cannot handle cargo in customs on board a carrier." );
        }

        deliveryInspector.inspectCargoInCustoms();
    }
View Full Code Here

        // Pre-conditions

        // Cargo has already been received before
        if( previousEvent != null && !previousEvent.equals( receiveEvent ) )
        {
            throw new InspectionFailedException( "Can't receive cargo again." );
        }

        if( receiveEvent == null || !receiveEvent.handlingEventType().get().equals( RECEIVE ) )
        {
            throw new InspectionFailedException( "Can only inspect received cargo." );
        }

        deliveryInspector.inspectReceivedCargo();
    }
View Full Code Here

        throws InspectionException
    {
        // Pre-conditions
        if( loadEvent == null || !loadEvent.handlingEventType().get().equals( LOAD ) )
        {
            throw new InspectionFailedException( "Can only inspect loaded cargo." );
        }

        deliveryInspector.inspectLoadedCargo();
    }
View Full Code Here

                // Unexpected internal state
                if( plannedCarrierMovement == null )
                {
                    // We should always know the current itinerary leg
                    throw new InspectionFailedException( "Itinerary progress index '" + c.itineraryProgressIndex + "' is invalid!" );
                }

                // Unexpected load location - Cargo can't travel in time!
                // Either previous or current location is wrong - only investigation can clarify...
                if( !plannedCarrierMovement.loadLocation().get().equals( c.loadLocation ) )
View Full Code Here

        throws InspectionException
    {
        // Pre-conditions
        if( claimEvent == null || !claimEvent.handlingEventType().get().equals( CLAIM ) )
        {
            throw new InspectionFailedException( "Can only inspect claimed cargo." );
        }

        deliveryInspector.inspectClaimedCargo();
    }
View Full Code Here

        throws InspectionException
    {
        // Pre-conditions
        if( noEvent != null )
        {
            throw new InspectionFailedException( "Can only inspect unhandled cargo." );
        }

        deliveryInspector.inspectUnhandledCargo();
    }
View Full Code Here

TOP

Related Classes of org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.exception.InspectionFailedException

Copyright © 2018 www.massapicom. 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.