no.ubicollab.osgi
Class PluginServiceRegistryImpl

java.lang.Object
  extended by no.ubicollab.osgi.PluginServiceRegistryImpl

public class PluginServiceRegistryImpl
extends java.lang.Object


Constructor Summary
PluginServiceRegistryImpl()
          This Constructor creates Web-service proxies for Service Registry and Service Discovery Manager, and conects to Discovery Manager.
 
Method Summary
 int connectToDiscoveryManager()
          Connects to discovery manager and returns a subscriber id.
 java.util.ArrayList<ClientRequest> getClientRequests()
          This method is used to query the Service Domain Manager for any new Client Requests.
 int getSdID()
          Gets the service discovery ID (subscriber id).
 java.util.ArrayList<Service> getServiceList(java.lang.String name, java.lang.String type, java.lang.String location, java.lang.String owner, java.lang.String description)
          Method to parse a provided String to a java.io.InputStream object.
 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 will register the provided service parameters with the Service Domain Manager.
 void setSdID(int sdID)
          Sets the service discovery ID (subscriber id).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginServiceRegistryImpl

public PluginServiceRegistryImpl()
This Constructor creates Web-service proxies for Service Registry and Service Discovery Manager, and conects to Discovery Manager. In addition the TimeKeeper Thread is started.

Method Detail

connectToDiscoveryManager

public int connectToDiscoveryManager()
Connects to discovery manager and returns a subscriber id.

Returns:
An int that is the subscriber id on the Service Discovery Manager or -1 if unable to connect.
Throws:
java.rmi.RemoteException - the remote exception received from the Service Discovery Manager

getClientRequests

public java.util.ArrayList<ClientRequest> getClientRequests()
This method is used to query the Service Domain Manager for any new Client Requests. The XML-response will be parsed and the ClientRequest objects are returned.

Returns:
An array of ClientRequest in a typed ArrayList
Throws:
java.rmi.RemoteException - the remote exception received from the host.

getServiceList

public java.util.ArrayList<Service> getServiceList(java.lang.String name,
                                                   java.lang.String type,
                                                   java.lang.String location,
                                                   java.lang.String owner,
                                                   java.lang.String description)
                                            throws java.rmi.RemoteException
Method to parse a provided String to a java.io.InputStream object.

Parameters:
xml - the xml to parse
Returns:
a valid input stream reading from the xml string
Throws:
java.rmi.RemoteException

registerService

public 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 will register the provided service parameters with the Service Domain Manager.

Parameters:
friendlyName - The user-friendly name of the service
type - The service type (classification)
descriptionURI - URI for service description (e.g. the URL to a WSDL-file).
owner - The person/company/responsible for the service.
description - Tags (words or short sentences) describing the service.
location - Location where the service can be found
protocolID - The id for the service discovery protocol plugin.
searchRequestorID - the ID for the search request queue to add this service to
serviceURI - The URI to invoke the service
Returns:
True if the service is successfully registered, false otherwise.

getSdID

public int getSdID()
Gets the service discovery ID (subscriber id).

Returns:
the service discovery ID

setSdID

public void setSdID(int sdID)
Sets the service discovery ID (subscriber id).

Parameters:
the - service discovery ID