org.opennms.netmgt.config.categories
Class Category

java.lang.Object
  extended by org.opennms.netmgt.config.categories.Category
All Implemented Interfaces:
Serializable

public class Category
extends Object
implements Serializable

A category.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
Category()
           
 
Method Summary
 void addService(int index, String vService)
           
 void addService(String vService)
           
 void deleteNormal()
           
 void deleteWarning()
           
 Enumeration<String> enumerateService()
          Method enumerateService.
 String getComment()
          Returns the value of field 'comment'.
 String getLabel()
          Returns the value of field 'label'.
 double getNormal()
          Returns the value of field 'normal'.
 String getRule()
          Returns the value of field 'rule'.
 String[] getService()
          Method getService.Returns the contents of the collection in an Array.
 String getService(int index)
          Method getService.
 List<String> getServiceCollection()
          Method getServiceCollection.Returns a reference to '_serviceList'.
 int getServiceCount()
          Method getServiceCount.
 double getWarning()
          Returns the value of field 'warning'.
 boolean hasNormal()
          Method hasNormal.
 boolean hasWarning()
          Method hasWarning.
 boolean isValid()
          Method isValid.
 Iterator<String> iterateService()
          Method iterateService.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllService()
           
 boolean removeService(String vService)
          Method removeService.
 String removeServiceAt(int index)
          Method removeServiceAt.
 void setComment(String comment)
          Sets the value of field 'comment'.
 void setLabel(String label)
          Sets the value of field 'label'.
 void setNormal(double normal)
          Sets the value of field 'normal'.
 void setRule(String rule)
          Sets the value of field 'rule'.
 void setService(int index, String vService)
           
 void setService(List<String> vServiceList)
          Sets the value of '_serviceList' by copying the given Vector.
 void setService(String[] vServiceArray)
           
 void setServiceCollection(List<String> serviceList)
          Deprecated.  
 void setWarning(double warning)
          Sets the value of field 'warning'.
static Category unmarshal(Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Category

public Category()
Method Detail

addService

public void addService(String vService)
                throws IndexOutOfBoundsException
Parameters:
vService -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addService

public void addService(int index,
                       String vService)
                throws IndexOutOfBoundsException
Parameters:
index -
vService -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

deleteNormal

public void deleteNormal()

deleteWarning

public void deleteWarning()

enumerateService

public Enumeration<String> enumerateService()
Method enumerateService.

Returns:
an Enumeration over all possible elements of this collection

getComment

public String getComment()
Returns the value of field 'comment'. The field 'comment' has the following description: A comment describing the category.

Returns:
the value of field 'Comment'.

getLabel

public String getLabel()
Returns the value of field 'label'. The field 'label' has the following description: The category label. NOTE: category labels will need to be unique across category groups.

Returns:
the value of field 'Label'.

getNormal

public double getNormal()
Returns the value of field 'normal'. The field 'normal' has the following description: The normal threshold value for the category in percent. The UI displays the category in green if the overall availability for the category is equal to or greater than this value.

Returns:
the value of field 'Normal'.

getRule

public String getRule()
Returns the value of field 'rule'. The field 'rule' has the following description: The category rule.

Returns:
the value of field 'Rule'.

getService

public String getService(int index)
                  throws IndexOutOfBoundsException
Method getService.

Parameters:
index -
Returns:
the value of the java.lang.String at the given index
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getService

public String[] getService()
Method getService.Returns the contents of the collection in an Array.

Note: Just in case the collection contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This way we know that the Array returned is of exactly the correct length.

Returns:
this collection as an Array

getServiceCollection

public List<String> getServiceCollection()
Method getServiceCollection.Returns a reference to '_serviceList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getServiceCount

public int getServiceCount()
Method getServiceCount.

Returns:
the size of this collection

getWarning

public double getWarning()
Returns the value of field 'warning'. The field 'warning' has the following description: The warning threshold value for the category in percent. The UI displays the category in yellow if the overall availability for the category is equal to or greater than this value but less than the normal threashold. If availability is less than this value, category is displayed in red.

Returns:
the value of field 'Warning'.

hasNormal

public boolean hasNormal()
Method hasNormal.

Returns:
true if at least one Normal has been added

hasWarning

public boolean hasWarning()
Method hasWarning.

Returns:
true if at least one Warning has been added

isValid

public boolean isValid()
Method isValid.

Returns:
true if this object is valid according to the schema

iterateService

public Iterator<String> iterateService()
Method iterateService.

Returns:
an Iterator over all possible elements in this collection

marshal

public void marshal(Writer out)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
out -
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

marshal

public void marshal(ContentHandler handler)
             throws IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
handler -
Throws:
IOException - if an IOException occurs during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling

removeAllService

public void removeAllService()

removeService

public boolean removeService(String vService)
Method removeService.

Parameters:
vService -
Returns:
true if the object was removed from the collection.

removeServiceAt

public String removeServiceAt(int index)
Method removeServiceAt.

Parameters:
index -
Returns:
the element removed from the collection

setComment

public void setComment(String comment)
Sets the value of field 'comment'. The field 'comment' has the following description: A comment describing the category.

Parameters:
comment - the value of field 'comment'.

setLabel

public void setLabel(String label)
Sets the value of field 'label'. The field 'label' has the following description: The category label. NOTE: category labels will need to be unique across category groups.

Parameters:
label - the value of field 'label'.

setNormal

public void setNormal(double normal)
Sets the value of field 'normal'. The field 'normal' has the following description: The normal threshold value for the category in percent. The UI displays the category in green if the overall availability for the category is equal to or greater than this value.

Parameters:
normal - the value of field 'normal'.

setRule

public void setRule(String rule)
Sets the value of field 'rule'. The field 'rule' has the following description: The category rule.

Parameters:
rule - the value of field 'rule'.

setService

public void setService(int index,
                       String vService)
                throws IndexOutOfBoundsException
Parameters:
index -
vService -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setService

public void setService(String[] vServiceArray)
Parameters:
vServiceArray -

setService

public void setService(List<String> vServiceList)
Sets the value of '_serviceList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vServiceList - the Vector to copy.

setServiceCollection

public void setServiceCollection(List<String> serviceList)
Deprecated. 

Sets the value of '_serviceList' by setting it to the given Vector. No type checking is performed.

Parameters:
serviceList - the Vector to set.

setWarning

public void setWarning(double warning)
Sets the value of field 'warning'. The field 'warning' has the following description: The warning threshold value for the category in percent. The UI displays the category in yellow if the overall availability for the category is equal to or greater than this value but less than the normal threashold. If availability is less than this value, category is displayed in red.

Parameters:
warning - the value of field 'warning'.

unmarshal

public static Category unmarshal(Reader reader)
                          throws org.exolab.castor.xml.MarshalException,
                                 org.exolab.castor.xml.ValidationException
Method unmarshal.

Parameters:
reader -
Returns:
the unmarshaled org.opennms.netmgt.config.categories.Category
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

validate

public void validate()
              throws org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema


Copyright © 2008. All Rights Reserved.