no.ubicollab.osgi.service.domainmanager
Interface DomainManager

All Known Implementing Classes:
DomainManagerImpl

public interface DomainManager

An interface for UbiCollab Service Domain Manager. Provides management functionality for services/bundles through web service calls.

Version:
0.9
Author:
Kim Steve Johansen

Method Summary
 boolean checkIfServiceExist(java.lang.String uri)
          Check if a given service exist.
 java.lang.String getInfoAboutService(java.lang.Long bundleID)
          Gets all registered information about the specified service.
 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 getServiceList()
          Return a list of the services which have been installed on this UbiNode through the Service Domain Manager.
 java.lang.String installService(java.lang.String url, java.lang.String friendlyName)
          Installs a service.
 boolean removeService(java.lang.Long bundleID)
          Removes the service proxy which is provided through the bundle represented by bundleID.
 boolean setActiveSpace(int SpaceID, boolean stopOtherServices)
          Activates all services belonging to the space identified by the provided id.
 boolean startService(java.lang.Long bundleID)
          Method to start a service installed on the UbiNode.
 boolean stopService(java.lang.Long bundleID)
          Method to stop a service installed on the UbiNode
 boolean updateServiceProperties(long bundleID, java.lang.String friendlyName, java.lang.String space, int spaceID, java.lang.String type, java.lang.String description)
          Method to update the properties of the service identified by serviceUri.
 

Method Detail

getServiceList

java.lang.String getServiceList()
Return a list of the services which have been installed on this UbiNode through the Service Domain Manager.

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

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

Returns:
The method returns a String with a XML-document which contains all installed services.

getInfoAboutService

java.lang.String getInfoAboutService(java.lang.Long bundleID)
Gets all registered information about the specified service.

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

   <?xml version='1.0'?>
      <Service>
          <Service ID="int" 
            ServiceUri="String" 
            Name="String" 
            Space="String"
            SpaceID="int"
            State="String" 
            DescriptionUri="String" 
            Type="String" 
            Description="String"/>
</Service>

Parameters:
bundleID - the bundle ID the bundle is registered with.
Returns:
An xml-encoded String containg information about the service, or "INVALID BUNDLE ID" if invalid bundle id is provided.

installService

java.lang.String installService(java.lang.String url,
                                java.lang.String friendlyName)
Installs a service. Use this method if you have the URL to a service bundle

Parameters:
friendlyName - the friendly name of the service
url - The Url to the service bundle.
Returns:
A text describing the outcome of the installation.

checkIfServiceExist

boolean checkIfServiceExist(java.lang.String uri)
Check if a given service exist.

Parameters:
uri - the service uri
Returns:
true, if service exists, false otherwise

removeService

boolean removeService(java.lang.Long bundleID)
Removes the service proxy which is provided through the bundle represented by bundleID.

Parameters:
bundleID - The URI for the service which is to be removed
Returns:
true if the service exist and are successfully removed, false othervise

updateServiceProperties

boolean updateServiceProperties(long bundleID,
                                java.lang.String friendlyName,
                                java.lang.String space,
                                int spaceID,
                                java.lang.String type,
                                java.lang.String description)
Method to update the properties of the service identified by serviceUri.

Parameters:
friendlyName - The service friendly name
description - the textual description of the service
space - The space this service will be active in
bundleID - the bundle ID
Returns:
true if URI is found and update is OK, false othervise

startService

boolean startService(java.lang.Long bundleID)
Method to start a service installed on the UbiNode.

Parameters:
bundleID - the bundle ID for the bundle providing the service
Returns:
true if the service is sucessfully started, false othervise

stopService

boolean stopService(java.lang.Long bundleID)
Method to stop a service installed on the UbiNode

Parameters:
bundleID - the bundle ID for the bundle providing the service
Returns:
true if the service is sucessfully stopped, false othervise

getLogItems

java.lang.String getLogItems(int 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

setActiveSpace

boolean setActiveSpace(int SpaceID,
                       boolean stopOtherServices)
Activates all services belonging to the space identified by the provided id. Also provides the option to stop the other services.

Parameters:
SpaceID - the ID for the Space to activate
stopOtherServices - true to stop the other service proxies, false othervise
Returns:
true if all proxies adhering to the space ID is started, false othervise