Package com.wordpress.salaboy.model

Examples of com.wordpress.salaboy.model.Call


        ContextTrackingProvider.configFile = "local-config-beans.xml";
        PersistenceService persistenceService = PersistenceServiceProvider.getPersistenceService();
        ContextTrackingService trackingService = ContextTrackingProvider.getTrackingService();
       
       
        Call call = new Call(1, 1, new Date());
        persistenceService.storeCall(call);
       
        assertNotSame("", call.getId());

        call = persistenceService.loadCall(call.getId());
        assertNotNull(call);

        Emergency emergency = new Emergency();
        persistenceService.storeEmergency(emergency);
        assertNotSame("", emergency.getId());

        emergency = persistenceService.loadEmergency(emergency.getId());
        assertNotNull(emergency);
       
        trackingService.attachEmergency(call.getId(), emergency.getId());

        Procedure procedure = new Procedure("MyProcedure");
        persistenceService.storeProcedure(procedure);
        assertNotSame("", procedure.getId());

        procedure = persistenceService.loadProcedure(procedure.getId());
        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());
       
        channel = persistenceService.loadServiceChannel(channel.getId());
        assertNotNull(channel);
       
        trackingService.attachServiceChannel(emergency.getId(), channel.getId());


        CypherParser parser = new CypherParser();
        ExecutionEngine engine = new ExecutionEngine(trackingService.getGraphDb());


        //Give me all the vehicle associated with the procedures that are part of the emergency that was created by this phoneCallId
        Query query = parser.parse("start n=(calls, 'callId:" + call.getId() + "')  match (n)-[r:CREATES]->(x)-[i:INSTANTIATE]-> (w) -[u:USE]->v  return v");

        ExecutionResult result = engine.execute(query);
        Iterator<Node> n_column = result.columnAs("v");

View Full Code Here


        PersistenceServiceProvider.configFile = "remote-config-beans.xml";
        ContextTrackingProvider.configFile = "remote-config-beans.xml";
        PersistenceService persistenceService = PersistenceServiceProvider.getPersistenceService();
        ContextTrackingService trackingService = ContextTrackingProvider.getTrackingService();
        Call call = new Call(1, 1, new Date());
        persistenceService.storeCall(call);
       
        assertNotSame("", call.getId());

        call = persistenceService.loadCall(call.getId());
        assertNotNull(call);

        Emergency emergency = new Emergency();
        persistenceService.storeEmergency(emergency);
        assertNotSame("", emergency.getId());

        emergency = persistenceService.loadEmergency(emergency.getId());
        assertNotNull(emergency);
       
        trackingService.attachEmergency(call.getId(), emergency.getId());

        Procedure procedure = new Procedure("MyProcedure");
        persistenceService.storeProcedure(procedure);
        assertNotSame("", procedure.getId());

        procedure = persistenceService.loadProcedure(procedure.getId());
        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());
       
        channel = persistenceService.loadServiceChannel(channel.getId());
        assertNotNull(channel);
       
        trackingService.attachServiceChannel(emergency.getId(), channel.getId());


        CypherParser parser = new CypherParser();
        ExecutionEngine engine = new ExecutionEngine(trackingService.getGraphDb());


        //Give me all the vehicle associated with the procedures that are part of the emergency that was created by this phoneCallId
        HttpClient client = new HttpClient();
        PostMethod method = new PostMethod("http://localhost:7575/db/data/ext/CypherPlugin/graphdb/execute_query");
        method.setRequestHeader("Content-type", "application/json");
        method.setRequestHeader("Accept", "application/json");
        String content = "{\"query\": \"start n=(calls, 'callId:" + call.getId() + "')  match (n)-[r:CREATES]->(x)-[i:INSTANTIATE]-> (w) -[u:USE]->v  return v\"}";
        method.setRequestEntity(new StringRequestEntity(content, "application/json", "UTF-8"));
        client.executeMethod(method);
       
        Gson gson = new Gson();
View Full Code Here

        persistenceService = PersistenceServiceProvider.getPersistenceService();
        trackingService = ContextTrackingProvider.getTrackingService();
       
        HumanTaskServerService.getInstance().initTaskServer();

        call = new Call(1, 2, new Date());
        assertEquals(0, persistenceService.getAllCalls().size());
        persistenceService.storeCall(call);
        assertEquals(1, persistenceService.getAllCalls().size());
        emergency = new Emergency();
        emergency.setCall(call);
View Full Code Here

        addXYEmergency(EmergencyType.UNDEFINED, null, x, y);
    }
    public void addXYEmergency(EmergencyType type,Integer nroOfPeople, int x, int y){
       
        System.out.println("x = " + xs[x] + " -> y =" + ys[y]);
        Call call = new Call(x, y, new Date(System.currentTimeMillis()));
       
        PersistenceServiceProvider.getPersistenceService().storeCall(call);
       
        int callSquare[] = {1, 1, 31, 1, 31, 31, 1, 31};
        BlockMap.emergencies.add(new Block(xs[call.getX()] * 16, ys[call.getY()] * 16, callSquare, "callId:" + call.getId()));
       
        GraphicableEmergency newEmergency = null;
       
        if (type == Emergency.EmergencyType.UNDEFINED){
            newEmergency = GraphicableFactory.newGenericEmergency(call);
           
        }else{
            newEmergency = GraphicableFactory.newEmergency(call, type, nroOfPeople);
        }
       
        emergencies.put(call.getId(), newEmergency);

        renderers.put(call.getId(), new ParticularEmergencyRenderer(this,newEmergency));
       
        try {
            MessageFactory.sendMessage(new IncomingCallMessage(call));
        } catch (HornetQException ex) {
            Logger.getLogger(WorldUI.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here


        fireTruck = new FireTruck("FireTruck 1");
        persistenceService.storeVehicle(fireTruck);

        call = new Call(1, 2, new Date());
        persistenceService.storeCall(call);

        emergency.setCall(call);
        emergency.setLocation(new Location(1, 2));
        emergency.setType(Emergency.EmergencyType.FIRE);
View Full Code Here

public class AsyncStartProcedureWorkItemHandler implements WorkItemHandler, Serializable{

    @Override
    public void executeWorkItem(WorkItem wi, WorkItemManager wim) {
        //Call Tracking Component for process?? or the ProcedureMGMTService can take care of that?
        Call call = (Call) wi.getParameter("call");
        String procedureName = (String) wi.getParameter("procedureName");
        Emergency emergency = (Emergency) wi.getParameter("emergency");
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("call", call);
        parameters.put("emergency", emergency);
View Full Code Here

public class StartProcedureWorkItemHandler implements WorkItemHandler, Serializable{

    @Override
    public void executeWorkItem(WorkItem wi, WorkItemManager wim) {
        //Call Tracking Component for process?? or the ProcedureMGMTService can take care of that?
        Call call = (Call) wi.getParameter("call");
        String procedureName = (String) wi.getParameter("procedureName");
        Emergency emergency = (Emergency) wi.getParameter("emergency");
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("call", call);
        parameters.put("emergency", emergency);
View Full Code Here

        emergency = new Emergency();
        emergency.setId("Emergency1");
        fireTruck = new FireTruck();
        fireTruck.setId("FireTruck1");

        call = new Call(1, 2, new Date());

        call.setId("Call1");
        emergency.setCall(call);
        emergency.setLocation(new Location(1, 2));
        emergency.setType(Emergency.EmergencyType.FIRE);
View Full Code Here

    }

    @Test
    public void defaultAdHocSimpleTest() throws InterruptedException, ClassNotFoundException, IOException {
        //String emergencyId = trackingService.newEmergencyId();
        call = new Call(1, 2, new Date());
        persistenceService.storeCall(call);
       
        emergency = new Emergency();
        emergency.setCall(call);
        emergency.setLocation(new Location(1, 2));
View Full Code Here

    }

    @Test
    public void defaultAdHocPlusTrackingTest() throws InterruptedException, ClassNotFoundException, IOException {
       
        call = new Call(1, 2, new Date());
        persistenceService.storeCall(call);
       
        emergency = new Emergency();
        emergency.setCall(call);
        emergency.setLocation(new Location(1, 2));
View Full Code Here

TOP

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

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.