org.universAAL.samples.context.reasoner.client.uaalinterface
Class CHECaller

Package class diagram package CHECaller
java.lang.Object
  extended by org.universAAL.middleware.bus.member.BusMember
      extended by org.universAAL.middleware.bus.member.Caller
          extended by org.universAAL.middleware.service.ServiceCaller
              extended by org.universAAL.samples.context.reasoner.client.uaalinterface.CHECaller

public class CHECaller
extends ServiceCaller

This class is just a shortened version of the CHE-Caller in the ctxt.situation.reasoner project. Here all methods remains that are needed to perform a SPARQL query at the CHE. This is here only used to offer the functionality of a written query. For further information please have a look at the other project

Author:
alfiva, amarinc

Field Summary
 
Fields inherited from class org.universAAL.middleware.bus.member.BusMember
busResourceURI, owner, theBus
 
Constructor Summary
CHECaller(ModuleContext context)
           
 
Method Summary
 String callDoSPARQL(String query)
          Call the CHE service
 void communicationChannelBroken()
          This abstract method is called for each member of the bus when the bus is being stopped.
 ContextEvent executeQuery(String theQuery)
          Execute a SPARQL CONSTRUCT query on the CHE that will return a reasoned event.
 void handleResponse(String reqID, ServiceResponse response)
          Will be called automatically in a new thread whenever the response corresponding to a previous call to ServiceCaller.sendRequest(ServiceRequest) is ready.
 
Methods inherited from class org.universAAL.middleware.service.ServiceCaller
addAvailabilitySubscription, busDyingOut, call, call, getAllServices, getMatchingService, getMatchingService, getMatchingService, getMyID, handleReply, removeAvailabilitySubscription, sendRequest
 
Methods inherited from class org.universAAL.middleware.bus.member.BusMember
close, getType, getURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CHECaller

public CHECaller(ModuleContext context)
Method Detail

communicationChannelBroken

public void communicationChannelBroken()
Description copied from class: ServiceCaller
This abstract method is called for each member of the bus when the bus is being stopped.

Specified by:
communicationChannelBroken in class ServiceCaller

handleResponse

public void handleResponse(String reqID,
                           ServiceResponse response)
Description copied from class: ServiceCaller
Will be called automatically in a new thread whenever the response corresponding to a previous call to ServiceCaller.sendRequest(ServiceRequest) is ready.

Specified by:
handleResponse in class ServiceCaller
Parameters:
reqID - the ID returned by the previous call to ServiceCaller.sendRequest(ServiceRequest).
response - the expected response.

executeQuery

public ContextEvent executeQuery(String theQuery)
Execute a SPARQL CONSTRUCT query on the CHE that will return a reasoned event. That event will be published.

Parameters:
theQuery - The SPARQL CONSTRUCT query

callDoSPARQL

public String callDoSPARQL(String query)
Call the CHE service

Parameters:
query - The CONSTRUCT query
Returns:
Serialized event constructed


Copyright © 2014 universAAL Consortium. All Rights Reserved.