|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ServiceDiscovery
This is the interface exported by the UbiCollab Service Discovery Manager (SDM). The methods provides Service Discovery (SD) access for UbiCollab applications and tools. In addition this module is general enough to also be used by other applications which is able to connect through the soap interface.
The principal functionality for the SDM is to be the broker between Service Discovery (SD) client applications (consumers) and SD plugins (producers). Client applications register their interests with the SDM and this information is passed on to the SD plugins which will search for matching services. The SD plugins will then register matching services in the queue that is assigned to the SD client, and he will retrive them from here.
Both clients and plugins must register with the SDM, before they can enter or retrieve any requests/interests. To maintain the principle of loose coupling, there is no unregister methods. Instead, sessions will be terminated by timeout.
Method Summary | |
---|---|
java.lang.String |
getClientRequest(int pluginID)
Method where SD plugins can get the interests/requests registered by the SDM client(s). |
java.lang.String |
getLogItems(int logLevel,
int numItems)
Read from the log and return selected log items in a XML-formatted string. |
java.lang.String |
getSDPlugins()
Method to return a list of the SD plugins which are registered with the SDM. |
java.lang.String |
getServices(int clientID)
Return the result queue identified by the provided search request ID. |
int |
registerClient()
This method allows any authenticated user (consumer/client app) to register as a client with the Service Discovery Manager (SDM). |
boolean |
registerClientRequest(int clientID,
java.lang.String name,
java.lang.String type,
java.lang.String location,
java.lang.String owner,
java.lang.String description)
This method allows any authenticated user (client) to register a search request with the Service Discovery Manager. |
int |
registerSDPlugin(java.lang.String protocolName)
Register a Service Discovery plugin with the Service Discovery Manager. |
boolean |
registerService(int searchRequestorID,
int protocolID,
java.lang.String descriptionURI,
java.lang.String serviceURI,
java.lang.String friendlyName,
java.lang.String type,
java.lang.String description,
java.lang.String owner,
java.lang.String location)
This method is provided for service discovery plugins to register services which matches client requests, with the Service Discovery Manager. |
Method Detail |
---|
int registerClient()
Upon registration the client will also be assigned a unique ID which will be used
for identification when sending messages/communicating with the SDM. The client
will also be assigned a time-to-live which initially is set to 1 minute. Every
time the client invokes getServices()
this time will be reset. If a
client fails to connect to SDM for 1 minute, his session will be garbage
collected (by the housekeeper thread).
boolean registerClientRequest(int clientID, java.lang.String name, java.lang.String type, java.lang.String location, java.lang.String owner, java.lang.String description)
After the request is placed, the client will get an ID which points to the queue
of services found. This ID can then be used to poll for, and retrieve matching
services using getServices
.
When a request is placed the queue spawned will have a lifetime of 1 minute, and when the queue is queried a fresh minute is awarded.
owner
- the Owner of the servicetype
- the service type to search fordescription
- the description of the servicelocation
- the location of the serviceclientID
- the unique client IDname
- the name of the service to search for
true
, if client request is registered successfully,
false
otherwise.java.lang.String getServices(int clientID)
The xml-structure used to represent the returned service list is:
<?xml version='1.0'?> <Servicelist> <Service Protocol="String" Name="String" ServiceUri="String" Location="String" Owner="String" DescriptionUri="String" Type="String" Description="String"/>
... more services ...
</Servicelist>
clientID
- the client ID (used to select the correct queue)
int registerSDPlugin(java.lang.String protocolName)
The registration will have a lifespan of 30 seconds, and will be
reset to 30 second every time getClientRequest()
or
registerService()
is invoked. When this time runs out the plugin
session will be garbage collected (by the housekeeper thread).
protocolName
- the name of the protocol, e.g. UPnP or RFID
java.lang.String getClientRequest(int pluginID)
The returned string is a well formatted XML-string with the following structure:
<?xml version='1.0'?> <ClientRequestList> <ClientRequest ClientID="int" Name="String" Type="String" Location="String" Owner="String" Description="String"/> ... more ClientRequest items ...
</ClientRequestList>
pluginID
- the plugin ID
String
containing the client request
if any requests have been registeredboolean registerService(int searchRequestorID, int protocolID, java.lang.String descriptionURI, java.lang.String serviceURI, java.lang.String friendlyName, java.lang.String type, java.lang.String description, java.lang.String owner, java.lang.String location)
friendlyName
- The user-friendly name of the servicedescriptionURI
- URI for service description (e.g. the URL to a WSDL-file).type
- The service type (classification)owner
- The person/company/responsible for the service.description
- Tags (words or short sentences) describing the service.location
- Location where the service can be foundsearchRequestorID
- the ID for the search request queue to add this service toprotocolID
- The id for the service discovery protocol plugin.serviceURI
- The URI to invoke the service
java.lang.String getSDPlugins()
The list returned is a well-formed xml-document, with the following structure:
<Pluginlist> <Plugin Name="String" Id="int" />
... more plugins ...
</Pluginlist>
String
with the SD plugins.java.lang.String getLogItems(int logLevel, int numItems)
The log levels are defined as follows:
Level - description 0 - DEBUG 1 - INFO 2 - WARNING 3 - ERROR 4 - FATALThe xml-structure used to represent the returned log is:
<?xml version='1.0'?> <Log> <Logitem Date="dd.mm.yyyy" Time="hh:mm:ss" LevelID="int" Level="String" Message="String"/>
... more log items ...
</Log>
logLevel
- The log level to include in the report.numItems
- The number of log items to include in the report
String
containg the resulting XML-document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |