no.ubicollab.osgi
Class Plugin

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

public class Plugin
extends java.lang.Object

The Class Plugin is used to represent a service discovery plugin which have registered with the Service Discovery Manager.

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

Constructor Summary
Plugin()
          This constructor creates a new plugin object with no values set.
Plugin(java.lang.String name, int id)
          This Constructor is used to create a new plugin and give it a name and id.
 
Method Summary
 boolean addClientRequest(ClientRequest clientRequest)
          Adds a client request to the list of ClientRequest belonging to this Plugin.
 java.lang.String getClientRequestList()
          Gets a xml-string containing the client request list.
 int getId()
          Gets the unique identifier for the plugin.
 java.lang.String getName()
          Gets the plugins name.
 int getTimeToLive()
          Gets the remaining time to live for the plugin.
 java.lang.String getXML()
          Gets the XML representation for this plugin.
 void resetTimeToLive()
          Reset the time to live to a full lifetime, as defined by GlobalSettings.
 void setId(int id)
          Sets the unique identifier for the plugin.
 void setName(java.lang.String name)
          Sets the name of the plugin.
 void setTimeToLive(int timeToLive)
          Sets the time to live.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plugin

public Plugin(java.lang.String name,
              int id)
This Constructor is used to create a new plugin and give it a name and id.

Parameters:
name - the plugin name
id - the unique id

Plugin

public Plugin()
This constructor creates a new plugin object with no values set.

Method Detail

addClientRequest

public boolean addClientRequest(ClientRequest clientRequest)
Adds a client request to the list of ClientRequest belonging to this Plugin.

Parameters:
clientRequest - the client request to add
Returns:
true, if the ClientRequest is successfullt appended, false otherwise.

getClientRequestList

public java.lang.String getClientRequestList()
Gets a xml-string containing the client request list.

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>

Returns:
the String with the client request list.

getId

public int getId()
Gets the unique identifier for the plugin.

Returns:
the unique id

setId

public void setId(int id)
Sets the unique identifier for the plugin.

Parameters:
id - the unique id

getName

public java.lang.String getName()
Gets the plugins name.

Returns:
the name of the plugin

setName

public void setName(java.lang.String name)
Sets the name of the plugin.

Parameters:
name - the name of the plugin

setTimeToLive

public void setTimeToLive(int timeToLive)
Sets the time to live.

Parameters:
timeToLive - the time to live

getTimeToLive

public int getTimeToLive()
Gets the remaining time to live for the plugin.

Returns:
the time to live

resetTimeToLive

public void resetTimeToLive()
Reset the time to live to a full lifetime, as defined by GlobalSettings.


getXML

public java.lang.String getXML()
Gets the XML representation for this plugin.

The format for the xml-string is as follows

 <Plugin Name="String" Id="int" />
 

Returns:
the XML representation of this Plugin in a string