com.sun.faban.harness.services
Class ServiceContext

java.lang.Object
  extended by com.sun.faban.harness.services.ServiceContext
All Implemented Interfaces:
Serializable

public class ServiceContext
extends Object
implements Serializable

This class provides the context for every service. Each service has only one context.

Author:
Sheetal Patil
See Also:
Serialized Form

Field Summary
 ServiceDescription desc
          The service description describing this context.
 
Method Summary
 List<NameValuePair<Integer>> getHostPorts()
          Obtains a list of host:ports as configured in the configuration file to be used by the role this service is associated.
 String getHostRole()
          Obtains host role.
 String[] getHosts()
          Obtains the list of hosts as configured in the configuration file for the role this service is associated.
 String getName()
          Obtains the name (aka id) of the service.
 String getProperty(String key)
          Obtains the property for a given key.
 String getRunDuration()
          Obtains the run duration.
 List<NameValuePair<Integer>> getUniqueHostPorts()
          Obtains a list of hostports non-duplicate hosts:ports.
 String[] getUniqueHosts()
          Obtains a list of non-duplicate hosts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

desc

public ServiceDescription desc
The service description describing this context.

Method Detail

getName

public String getName()
Obtains the name (aka id) of the service.

Returns:
The name of the service

getHosts

public String[] getHosts()
Obtains the list of hosts as configured in the configuration file for the role this service is associated.

Returns:
string array of hosts

getUniqueHosts

public String[] getUniqueHosts()
Obtains a list of non-duplicate hosts. If two or more host names refer to the same physical or virtual system (OS instance), only the first of such host names is returned as part of the list. This is used by services to avoid unwanted multiple starts of a service.

Returns:
The unique list of host names

getHostPorts

public List<NameValuePair<Integer>> getHostPorts()
Obtains a list of host:ports as configured in the configuration file to be used by the role this service is associated.

Returns:
List of host:ports

getUniqueHostPorts

public List<NameValuePair<Integer>> getUniqueHostPorts()
Obtains a list of hostports non-duplicate hosts:ports. If two or more host names with the same port refer to the same physical or virtual system (OS instance), only the first of such host:port pairs is returned as part of the list.

Returns:
Unique list of host:port pairs

getHostRole

public String getHostRole()
Obtains host role.

Returns:
host role

getProperty

public String getProperty(String key)
Obtains the property for a given key.

Parameters:
key -
Returns:
the property value

getRunDuration

public String getRunDuration()
Obtains the run duration.

Returns:
duration of steady state as String