|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.cmu.aura.service.SimpleService
|
+--edu.cmu.aura.service.dbw.WrapperService
A simple service to provide access to an SQL database via the primitive service API. This allows services to be written without the need to write any code.
To use this class you must provide it four things: 1 - a name for this service, 2 - a port to provide this service on, 3 - the jdbc URL to contact the database on, 4 - the class name of the jdbc driver.
This class currently performs no real error checking and returns all attributes as static attributes. Future versions should provide the ability to support dynamic attributes, attribute requirements, time limits, etc..
| 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 | |
WrapperService(java.lang.String serviceName,
int port,
java.lang.String dbURL,
java.lang.String jdbcDriver)
Creates the WrapperService. |
|
| Method Summary | |
static void |
main(java.lang.String[] args)
Accept command line parameters and run the test. |
QueryResult |
query(java.util.ArrayList sAttribs,
java.util.ArrayList serviceNames,
ExpressionNode expression,
java.util.ArrayList attribReqs,
long timeLimit)
Handle incoming queries from clients by passing them to the SQL database. |
| Methods inherited from class edu.cmu.aura.service.SimpleService |
computeQueryResult, postCondTrigger, postModTrigger, postQuery, removeQuery, removeTrigger |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public WrapperService(java.lang.String serviceName,
int port,
java.lang.String dbURL,
java.lang.String jdbcDriver)
throws java.lang.Exception
serviceName - the name of the service to provideport - port on which to listen for requestsdbURL - the jdbc URL on which to contact the databasejdbcDriver - the class name of the jdbc driver| Method Detail |
public QueryResult query(java.util.ArrayList sAttribs,
java.util.ArrayList serviceNames,
ExpressionNode expression,
java.util.ArrayList attribReqs,
long timeLimit)
throws ServiceException
query in interface PrimitiveServicequery in class SimpleServicesAttribs - the attribs to select.serviceNames - names of services to retrieve
attributes from.expression - expression selecting which entities or
relations in the service should be returned.attribReqs - requirements on dynamic attributes.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.
ServiceExceptionpublic static void main(java.lang.String[] args)
args - command line parameters
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||