org.opennms.bb.dp.poller.scheduler.utils
Class ServiceInfo

java.lang.Object
  |
  +--org.opennms.bb.dp.poller.scheduler.utils.ServiceInfo

public class ServiceInfo
extends Object

This class is responsible for holding information about a service parsed from the package.xml file.

Version:
$Revision: 1.4 $
Author:
Jason Johns, OpenNMS

Field Summary
static String INTERVAL
           
private  PollerModel m_model
           
private  String m_modelName
          The name of the model that this service uses for unavailable scheduling
private  HashMap m_serviceDetails
          The group of parameters build from the tags under the tag
private  String m_serviceName
          The name of the service, from the tag
 
Constructor Summary
ServiceInfo()
          Default constructor, allocates the m_serviceDetails member
 
Method Summary
 void addServiceParameter(Parameter parameter)
          This method adds a new parameter to the service
 PollerModel getModel()
           
 String getModelName()
          This method returns the name of the model for this service.
 String getServiceName()
          This method returns the name of the service
 String getServiceParameter(String parmName)
          This method gets the value of a specific parameter from the service
private  StringBuffer hashMapPrint(HashMap map)
          This method walks through a HashMap and builds a StringBuffer pretty print version.
 void setModel(PollerModel aModel)
           
 void setModelName(String aModelName)
          This method sets the name of the model the services uses for unavailable scheduling
 void setServiceName(String aName)
          This method sets the name of the service
 String toString()
          This method returns a String representation of the service class
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

INTERVAL

public static final String INTERVAL

m_serviceName

private String m_serviceName
The name of the service, from the tag

m_modelName

private String m_modelName
The name of the model that this service uses for unavailable scheduling

m_model

private PollerModel m_model

m_serviceDetails

private HashMap m_serviceDetails
The group of parameters build from the tags under the tag
Constructor Detail

ServiceInfo

public ServiceInfo()
Default constructor, allocates the m_serviceDetails member
Method Detail

setModelName

public void setModelName(String aModelName)
This method sets the name of the model the services uses for unavailable scheduling
Parameters:
String - aModelName, the name of the model

setModel

public void setModel(PollerModel aModel)

getModelName

public String getModelName()
This method returns the name of the model for this service. If the model name is null when getModelName() method is called then there wasn't a model for the service in the package.xml file. In this case the caller should look at the interval included in this service for scheduling options.
Returns:
String, the name of the model to use for scheduling, null if no model was specified.

getModel

public PollerModel getModel()

addServiceParameter

public void addServiceParameter(Parameter parameter)
This method adds a new parameter to the service
Parameters:
Parameter, - a new parameter parsed from the xml

setServiceName

public void setServiceName(String aName)
This method sets the name of the service
Parameters:
String - name, the name of the service

getServiceName

public String getServiceName()
This method returns the name of the service
Returns:
String, the name of the service

getServiceParameter

public String getServiceParameter(String parmName)
This method gets the value of a specific parameter from the service
Parameters:
String - parmName, the name of the parameter being look up
Returns:
String, the value of the parameter

toString

public String toString()
This method returns a String representation of the service class
Overrides:
toString in class Object
Returns:
String, a string representation

hashMapPrint

private StringBuffer hashMapPrint(HashMap map)
This method walks through a HashMap and builds a StringBuffer pretty print version.
Parameters:
HashMap - map, the map to convert
Returns:
StringBuffer, a conversion of the HashMap into a string