no.ubicollab.osgi
Class Client

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

public class Client
extends java.lang.Object

The Class Client is used to represent a client which are registered with the Service Discovery Manager.

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

Constructor Summary
Client(int id)
          The Constructor for the Client class.
 
Method Summary
 boolean addService(Service s)
          Adds a service to the clients service queue.
 int getId()
          Gets the unique id.
 java.lang.String getServiceList()
          Returns the service list in XML-fromat and clear the list at the same time.
 int getTimeToLive()
          Gets the time to live remaining.
 void resetTimeToLive()
          Reset the time to live to a full lifetime, as defined by GlobalSettings.
 void setId(int id)
          Sets the unique id.
 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

Client

public Client(int id)
The Constructor for the Client class.

Parameters:
id - the unique id for identifying the client
Method Detail

addService

public boolean addService(Service s)
Adds a service to the clients service queue.

Parameters:
s - the service to add
Returns:
true, if service is added, false othervise

getServiceList

public java.lang.String getServiceList()
Returns the service list in XML-fromat and clear the list at the same time.

Returns:
the XML-formatted service list

resetTimeToLive

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


getId

public int getId()
Gets the unique id.

Returns:
the id

setId

public void setId(int id)
Sets the unique id.

Parameters:
id - the id

getTimeToLive

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

Returns:
the time to live

setTimeToLive

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

Parameters:
timeToLive - the time to live