no.ubicollab.osgi.service.registry
Interface ServiceRegistry

All Known Implementing Classes:
ServiceRegistryImpl

public interface ServiceRegistry

An interface for UbiCollab Service Registry. Provides the neccessary functionality for the centraliced service registry. The registry will be accessible through web service calls.

Since:
0.1
Version:
0.9
Author:
Kim-Steve Johansen

Method Summary
 boolean addService(java.lang.String serviceURI, java.lang.String descriptionURI, java.lang.String friendlyName, java.lang.String type, java.lang.String location, java.lang.String owner, java.lang.String description)
          Adds a service reference to the registry.
 boolean deleteService(int serviceId)
          Removes the service which matches the provided service ID.
 java.lang.String getLogItems(java.lang.String logLevel, int numItems)
          Read from the log and return selected log items in a XML-formatted string.
 java.lang.String getServiceDetails(int serviceId)
          Gets all registered information about the service specified by the provided serviceId.
 java.lang.String getServiceDetails(java.lang.String serviceUri)
          Gets all registered information about the service specified by the provided serviceUri.
 java.lang.String getServices()
          This method returns an XML-formatted list containing all the services in the registry.
 java.lang.String getServices(java.lang.String name, java.lang.String type, java.lang.String location, java.lang.String owner, java.lang.String description)
          Method to return a list of service refrences matching the criteria specified in the query.
 boolean updateService(int serviceID, java.lang.String serviceURI, java.lang.String descriptionURI, java.lang.String friendlyName, java.lang.String type, java.lang.String location, java.lang.String owner, java.lang.String description)
          Updates the properties of service reference in the service registry.
 

Method Detail

getServices

java.lang.String getServices()
This method returns an XML-formatted list containing all the services in the registry.

The xml-structure used to represent the returned service list is:

   <?xml version='1.0'?>
      <Servicelist>
          <Service ID="int" 
            ServiceUri="String" 
            DescriptionUri="String" 
            Name="String" 
            Type="String" 
            Location="String"
            Owner="String" 
            Description="String"/>
... more services ...
</Servicelist>

Returns:
A String containing an XML-formatted list with 0..n service elements.

getServices

java.lang.String getServices(java.lang.String name,
                             java.lang.String type,
                             java.lang.String location,
                             java.lang.String owner,
                             java.lang.String description)
Method to return a list of service refrences matching the criteria specified in the query. The different search criteria can be freely combined and also partial hits will be returned. Criterias not used should contain an empty string.

The xml-structure used to represent the returned service list is:

   <?xml version='1.0'?>
      <Servicelist>
          <Service ID="int" 
            ServiceUri="String" 
            DescriptionUri="String" 
            Name="String" 
            Type="String" 
            Location="String"
            Owner="String" 
            Description="String"/>
... more services ...
</Servicelist>

Parameters:
type - the type of service, or a partial type specification
owner - the owner of the service, or a part of the owners name
description - the textual description of the service
location - the location for the service, or a part of the location
name - the name of the service, or a part of it
Returns:
A String containing an XML-formatted document with 0..n service elements.

getServiceDetails

java.lang.String getServiceDetails(java.lang.String serviceUri)
Gets all registered information about the service specified by the provided serviceUri.

The format used for the returned data is the minimum for a well-formed XML-document, containing only one element with this syntax:

 <Service ID="int" 
   ServiceUri="String" 
   DescriptionUri="String" 
   Name="String" 
   Type="String" 
   Location="String"
   Owner="String" 
   Description="String"/>
 

Parameters:
serviceUri - The service URI that uniquly identifies the service.
Returns:
A String with an XML-document if successful, "NO SERVICES MATCHES THE QUERY" otherwise.

getServiceDetails

java.lang.String getServiceDetails(int serviceId)
Gets all registered information about the service specified by the provided serviceId.

The format used for the returned data is the minimum for a well-formed XML-document, containing only one element with this syntax:

 <Service ID="int" 
   ServiceUri="String" 
   DescriptionUri="String" 
   Name="String" 
   Type="String" 
   Location="String"
   Owner="String" 
   Description="String"/>

Parameters:
serviceId - The unique id refrencing the service.
Returns:
A String with an XML-document if successful, "NO SERVICES MATCHES THE QUERY" otherwise.

addService

boolean addService(java.lang.String serviceURI,
                   java.lang.String descriptionURI,
                   java.lang.String friendlyName,
                   java.lang.String type,
                   java.lang.String location,
                   java.lang.String owner,
                   java.lang.String description)
Adds a service reference to the registry. Use this method to add new services which can be found by other users.

Parameters:
friendlyName - A selected name the user should be able to understand
type - Classification of service (in service type hierarchy)
descriptionURI - The description URI for the service
owner - The owner or responsible for the service
description - a textual service description
location - The location of the service
serviceURI - The Url to the service bundle.
Returns:
true if the service refrence is successfully added, false otherwise.

updateService

boolean updateService(int serviceID,
                      java.lang.String serviceURI,
                      java.lang.String descriptionURI,
                      java.lang.String friendlyName,
                      java.lang.String type,
                      java.lang.String location,
                      java.lang.String owner,
                      java.lang.String description)
Updates the properties of service reference in the service registry. The key used to select which service to update is serviceID.

Parameters:
serviceID - the service ID for the service to update
friendlyName - A selected name the user should be able to understand
descriptionURI - The description URI for the service
type - Classification of service (in service type hierarchy)
owner - The owner or responsible for the service
description - a textual service description
location - The location of the service
serviceURI - The Url to the service bundle.
Returns:
true if the service refrence is successfully updated, false otherwise.

deleteService

boolean deleteService(int serviceId)
Removes the service which matches the provided service ID.

Parameters:
serviceId - The service ID for the service to remove
Returns:
true if the service reference is successfully removed, false otherwise.

getLogItems

java.lang.String getLogItems(java.lang.String logLevel,
                             int numItems)
Read from the log and return selected log items in a XML-formatted string.

The xml-structure used to represent the returned log is:

   <?xml version='1.0'?>
      <Log>
          <Logitem Date="dd.mm.yyyy" 
            Time="hh:mm:ss" 
            Level="String" 
            Message="String"/>
... more log items ...
</Log>

Parameters:
logLevel - The log level to include in the report. Valid arguments are: 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'FATAL' and 'ALL' for all types.
numItems - The number of log items to include in the report
Returns:
the String containg the resulting XML