|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.cmu.aura.service.rpc.GenericStub
|
+--edu.cmu.aura.service.PrimitiveServiceStub
PrimitiveServiceStub is used by clients send requests to services. There are three general ways that this class may be used: 1 - specifying all query arguments, 2 - passing in an object that represents a query or trigger, 3 - calling one of the simple attribute retrieval methods.
The attribute retrieval methods are shortcuts to performing a query of the form: select attribName where keyName = keyVal. Note that the use of the name key here merely signifies that the attribute is acting as a key for this query and is not necessarily what the service would consider a key (though it probably is most of the time).
| Field Summary |
| Fields inherited from interface edu.cmu.aura.service.PrimitiveService |
ALL_ATTRIBS, ANY_CHANGE, DEFAULT_EXEC_INTERVAL, DEFAULT_SERVICE, DEFAULT_SERVICE_NAME, NO_REQS, NO_TIME_LIMIT, RELATION_ATTRIB, SELECT_ALL |
| Constructor Summary | |
PrimitiveServiceStub(edu.cmu.aura.service.rpc.RemoteReference dest)
Creates a PrimitiveServiceStub. |
|
PrimitiveServiceStub(java.lang.String hostName,
int port)
Creates a PrimitiveServiceStub. |
|
| Method Summary | |
boolean |
getBoolean(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
Retrieve an attribute of type boolean from a service by specifying a lookup key name and value. |
char |
getChar(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
Retrieve an attribute of type char from a service by specifying a lookup key name and value. |
double |
getDouble(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
Retrieve an attribute of type double from a service by specifying a lookup key name and value. |
float |
getFloat(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
Retrieve an attribute of type float from a service by specifying a lookup key name and value. |
int |
getInt(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
Retrieve an attribute of type int from a service by specifying a lookup key name and value. |
long |
getLong(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
Retrieve an attribute of type long from a service by specifying a lookup key name and value. |
short |
getShort(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
Retrieve an attribute of type short from a service by specifying a lookup key name and value. |
java.lang.String |
getString(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
Retrieve an attribute of type string from a service by specifying a lookup key name and value. |
int |
postCondTrigger(java.util.ArrayList selectedAttribs,
java.util.ArrayList serviceNames,
ExpressionNode expression,
java.util.ArrayList attribReqs,
long timeLimit,
long execInterval,
ExpressionNode triggerExpression,
edu.cmu.aura.service.rpc.RemoteReference queryClient)
Post a trigger that is to execute when a particular condition is met. |
int |
postCondTrigger(CondTrigger condTrigger)
Post a trigger that is to execute when a particular condition is met. |
int |
postModTrigger(java.util.ArrayList selectedAttribs,
java.util.ArrayList serviceNames,
ExpressionNode expression,
java.util.ArrayList attribReqs,
long timeLimit,
long execInterval,
java.util.ArrayList triggerAttribs,
java.util.ArrayList triggerDeltas,
edu.cmu.aura.service.rpc.RemoteReference queryClient)
Post a trigger that is to execute when any one of a given set of attributes changes by a specified amount. |
int |
postModTrigger(ModTrigger modTrigger)
Post a trigger that is to execute when any one of a given set of attributes changes by a specified amount. |
int |
postQuery(java.util.ArrayList selectedAttributes,
java.util.ArrayList fromServices,
ExpressionNode expression,
java.util.ArrayList attribReqs,
long timeLimit,
long execInterval,
edu.cmu.aura.service.rpc.RemoteReference queryClient)
Query a service repeatedly at a regular interval. |
int |
postQuery(PostedQuery postedQuery)
Query a service repeatedly at a regular interval. |
QueryResult |
query(java.util.ArrayList selectedAttributes,
java.util.ArrayList fromServices,
ExpressionNode expression,
java.util.ArrayList attribReqs,
long timeLimit)
Query a service. |
QueryResult |
query(Query query)
Query a service. |
void |
removeQuery(java.lang.String serviceName,
int queryID)
Remove a recurrent query. |
void |
removeTrigger(java.lang.String serviceName,
int queryID)
Remove a trigger. |
| Methods inherited from class edu.cmu.aura.service.rpc.GenericStub |
setDest |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PrimitiveServiceStub(java.lang.String hostName,
int port)
hostName - the hostName where the service residesport - the port on which the service is listeningpublic PrimitiveServiceStub(edu.cmu.aura.service.rpc.RemoteReference dest)
dest - the RemoteReference of this service| Method Detail |
public QueryResult query(Query query)
throws java.rmi.RemoteException,
ServiceException
query - the query to perform
java.rmi.RemoteException
ServiceException
public QueryResult query(java.util.ArrayList selectedAttributes,
java.util.ArrayList fromServices,
ExpressionNode expression,
java.util.ArrayList attribReqs,
long timeLimit)
throws java.rmi.RemoteException,
ServiceException
query in interface PrimitiveServiceexpression - expression selecting which entities or
relations in the service should be returned. PrimitiveService.SELECT_ALL
indicates all entities are to be selected.attribReqs - requirements on dynamic attributes.
PrimitiveService.NO_REQS indicates there are no requirements
in effect.timeLimit - this is used by clients to inform the service
on when they need the results by. This may also be viewed as
a suggestion on how hard to work to retrieve the results.
PrimitiveService.NO_TIME_LIMIT indicates that the client has no
hard limit on how long the query should take; though a client will
likely still desire reasonably fast execution.selectedAttributes - attribsutes to select. ALL_ATTRIBS
indicates that all attributes are to be selected.fromServices - names of services to retrieve
attributes from. DEFAULT_SERVICE may be used if
there is only one service listening on a given port.
java.rmi.RemoteException
ServiceException
public int postQuery(PostedQuery postedQuery)
throws java.rmi.RemoteException,
ServiceException
java.rmi.RemoteException
ServiceException
public int postQuery(java.util.ArrayList selectedAttributes,
java.util.ArrayList fromServices,
ExpressionNode expression,
java.util.ArrayList attribReqs,
long timeLimit,
long execInterval,
edu.cmu.aura.service.rpc.RemoteReference queryClient)
throws java.rmi.RemoteException,
ServiceException
postQuery in interface PrimitiveServiceexpression - expression selecting which entities or
relations in the service should be returned. PrimitiveService.SELECT_ALL
indicates all entities are to be selected.attribReqs - requirements on dynamic attributes.
PrimitiveService.NO_REQS indicates there are no requirements in effect.timeLimit - this is used by clients to inform the service
on when they need the results by. This may also be viewed as
a suggestion on how hard to work to retrieve the results.
PrimitiveService.NO_TIME_LIMIT indicates that the client has no
hard limit on how long the query should take; though a client will
likely still desire reasonably fast execution.execInterval - interval at which to execute the query.
PrimitiveService.DEFAULT_EXEC_INTERVAL may be specified if they service
is to select the interval at which the query should execute.queryClient - the client that should be informed when
this query executes.selectedAttributes - attribsutes to select. ALL_ATTRIBS
indicates that all attributes are to be selected.fromServices - names of services to retrieve
attributes from. DEFAULT_SERVICE may be used if
there is only one service listening on a given port.
java.rmi.RemoteException
ServiceException
public void removeQuery(java.lang.String serviceName,
int queryID)
throws java.rmi.RemoteException
removeQuery in interface PrimitiveServiceserviceName - name of the service to remove the query fromqueryID - the ID of the query to remove
java.rmi.RemoteException
public int postCondTrigger(CondTrigger condTrigger)
throws java.rmi.RemoteException,
ServiceException
condTrigger - the trigger to post
java.rmi.RemoteException
ServiceException
public int postCondTrigger(java.util.ArrayList selectedAttribs,
java.util.ArrayList serviceNames,
ExpressionNode expression,
java.util.ArrayList attribReqs,
long timeLimit,
long execInterval,
ExpressionNode triggerExpression,
edu.cmu.aura.service.rpc.RemoteReference queryClient)
throws java.rmi.RemoteException,
ServiceException
postCondTrigger in interface PrimitiveServiceserviceNames - names of services to retrieve
attributes from. PrimitiveService.DEFAULT_SERVICE may be used if
there is only one service listening on a given port.expression - expression selecting which entities or
relations in the service should be returned. PrimitiveService.SELECT_ALL
indicates all entities are to be selected.attribReqs - requirements on dynamic attributes.
PrimitiveService.NO_REQS indicates there are no requirements in effect.timeLimit - this is used by clients to inform the service
on when they need the results by. This may also be viewed as
a suggestion on how hard to work to retrieve the results.
PrimitiveService.NO_TIME_LIMIT indicates that the client has
no hard limit on
how long the processing should take; though a client will likely
still desire reasonably fast execution.execInterval - interval at which to check the trigger.triggerExpression - condition indicating when to
fire the trigger.queryClient - the client that should be informed when
this trigger executes.selectedAttribs - attribsutes to select. ALL_ATTRIBS
indicates that all attributes are to be selected.
java.rmi.RemoteException
ServiceException
public int postModTrigger(ModTrigger modTrigger)
throws java.rmi.RemoteException,
ServiceException
modTrigger - the trigger to post
java.rmi.RemoteException
ServiceException
public int postModTrigger(java.util.ArrayList selectedAttribs,
java.util.ArrayList serviceNames,
ExpressionNode expression,
java.util.ArrayList attribReqs,
long timeLimit,
long execInterval,
java.util.ArrayList triggerAttribs,
java.util.ArrayList triggerDeltas,
edu.cmu.aura.service.rpc.RemoteReference queryClient)
throws java.rmi.RemoteException,
ServiceException
postModTrigger in interface PrimitiveServiceserviceNames - names of services to retrieve
attributes from. DEFAULT_SERVICE may be used if
there is only one service listening on a given port.expression - expression selecting which entities or
relations in the service should be returned. SELECT_ALL
indicates all entities are to be selected.attribReqs - requirements on dynamic attributes. NO_REQS
indicates there are no requirements in effect.timeLimit - this is used by clients to inform the service
on when they need the results by. This may also be viewed as
a suggestion on how hard to work to retrieve the results.
NO_TIME_LIMIT indicates that the client has no hard limit on
how long the processing should take; though a client will likely
still desire reasonably fast execution.execInterval - interval at which to check the trigger.triggerAttribs - attributes to watch for changes.
PrimitiveService.ANY_CHANGE may be specified if any change
to any attribute should cause the trigger to fire. In this
case triggerDeltas should be specified as
PrimitiveService.ANY_CHANGE as well.triggerDeltas - amount of change that will cause the
trigger to fire for the corresponding attribute.
PrimitiveService.ANY_CHANGE may be specified if for any of
the specified attributes, any amount of change should cause
the trigger to fire.queryClient - the client that should be informed when
this trigger executes.selectedAttribs - attribsutes to select. ALL_ATTRIBS
indicates that all attributes are to be selected.
java.rmi.RemoteException
ServiceException
public void removeTrigger(java.lang.String serviceName,
int queryID)
throws java.rmi.RemoteException
removeTrigger in interface PrimitiveServiceserviceName - name of the service to remove the trigger fromqueryID - the ID of the trigger to remove
java.rmi.RemoteException
public double getDouble(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
throws java.rmi.RemoteException,
ServiceException
attribName - name of attribute to retrievekeyName - name of attribute to use as a lookup keykeyVal - value of key attribute
java.rmi.RemoteException
ServiceException
public float getFloat(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
throws java.rmi.RemoteException,
ServiceException
attribName - name of attribute to retrievekeyName - name of attribute to use as a lookup keykeyVal - value of key attribute
java.rmi.RemoteException
ServiceException
public long getLong(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
throws java.rmi.RemoteException,
ServiceException
attribName - name of attribute to retrievekeyName - name of attribute to use as a lookup keykeyVal - value of key attribute
java.rmi.RemoteException
ServiceException
public int getInt(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
throws java.rmi.RemoteException,
ServiceException
attribName - name of attribute to retrievekeyName - name of attribute to use as a lookup keykeyVal - value of key attribute
java.rmi.RemoteException
ServiceException
public short getShort(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
throws java.rmi.RemoteException,
ServiceException
attribName - name of attribute to retrievekeyName - name of attribute to use as a lookup keykeyVal - value of key attribute
java.rmi.RemoteException
ServiceException
public char getChar(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
throws java.rmi.RemoteException,
ServiceException
attribName - name of attribute to retrievekeyName - name of attribute to use as a lookup keykeyVal - value of key attribute
java.rmi.RemoteException
ServiceException
public boolean getBoolean(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
throws java.rmi.RemoteException,
ServiceException
attribName - name of attribute to retrievekeyName - name of attribute to use as a lookup keykeyVal - value of key attribute
java.rmi.RemoteException
ServiceException
public java.lang.String getString(java.lang.String attribName,
java.lang.String keyName,
java.lang.Object keyVal)
throws java.rmi.RemoteException,
ServiceException
attribName - name of attribute to retrievekeyName - name of attribute to use as a lookup keykeyVal - value of key attribute
java.rmi.RemoteException
ServiceException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||