Package com.wordpress.salaboy.model

Examples of com.wordpress.salaboy.model.Vehicle


        assertNotNull(procedure);

        trackingService.attachProcedure(emergency.getId(), procedure.getId());


        Vehicle vehicle = new Ambulance();

        persistenceService.storeVehicle(vehicle);
        assertNotSame("", vehicle.getId());

        vehicle = persistenceService.loadVehicle(vehicle.getId());
        assertNotNull(vehicle);


        trackingService.attachVehicle(procedure.getId(), vehicle.getId());

        Vehicle vehicle2 = new FireTruck();
        persistenceService.storeVehicle(vehicle2);
        assertNotSame("", vehicle2.getId());

        vehicle2 = persistenceService.loadVehicle(vehicle2.getId());
        assertNotNull(vehicle2);

        trackingService.attachVehicle(procedure.getId(), vehicle2.getId());

        ServiceChannel channel = new ServiceChannel("MyChannel");
        persistenceService.storeServiceChannel(channel);
        assertNotSame("", channel.getId());
       
View Full Code Here


        assertNotNull(procedure);

        trackingService.attachProcedure(emergency.getId(), procedure.getId());


        Vehicle vehicle = new Ambulance();

        persistenceService.storeVehicle(vehicle);
        assertNotSame("", vehicle.getId());

        vehicle = persistenceService.loadVehicle(vehicle.getId());
        assertNotNull(vehicle);


        trackingService.attachVehicle(procedure.getId(), vehicle.getId());

        Vehicle vehicle2 = new FireTruck();
        persistenceService.storeVehicle(vehicle2);
        assertNotSame("", vehicle2.getId());

        vehicle2 = persistenceService.loadVehicle(vehicle2.getId());
        assertNotNull(vehicle2);

        trackingService.attachVehicle(procedure.getId(), vehicle2.getId());

        ServiceChannel channel = new ServiceChannel("MyChannel");
        persistenceService.storeServiceChannel(channel);
        assertNotSame("", channel.getId());
       
View Full Code Here

   
    @Override
    public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
        String emergencyId = ((Emergency) workItem.getParameter("emergency")).getId();
        Vehicle vehicle = (Vehicle) workItem.getParameter("vehicle");
        try {
            MessageFactory.sendMessage(new VehicleDispatchedMessage(emergencyId, vehicle.getId()));
        } catch (HornetQException ex) {
            Logger.getLogger(DispatchVehicleWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
        }
        manager.completeWorkItem(workItem.getId(), null);
    }
View Full Code Here

    }

    @Override
    public void newVehicleDispatched(final String emergencyId, final String vehicleId) {
       
            Vehicle vehicle = PersistenceServiceProvider.getPersistenceService().loadVehicle(vehicleId);
            if (vehicle == null){
                throw new IllegalArgumentException("Unknown Vehicle "+vehicleId);
            }
           
           
View Full Code Here

               
                if (emergencies.get(callId)==null){
                    throw new IllegalArgumentException("Unknown emergency for call Id "+callId);
                }
               
                Vehicle vehicle = persistenceService.loadVehicle(message.getVehicleId());
                switchToEmergency(callId);
                assignVehicleToEmergency(callId, vehicle);
            }
        });
View Full Code Here

            if (vehicleServices.containsKey(vehicleId)){
                throw new IllegalStateException("A monitor service is already configured for this vehicle: "+vehicleId);
            }

            //get the vehicle from the persistent store
            Vehicle vehicle = persistenceService.loadVehicle(vehicleId);
            if (vehicle == null){
                throw new IllegalArgumentException("Unknown Vehicle "+vehicleId);
            }

            //instanciates a new VehicleMonitorService according to the type of vehicle
View Full Code Here

TOP

Related Classes of com.wordpress.salaboy.model.Vehicle

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.