org.opennms.netmgt.config.service
Class ServiceConfiguration

java.lang.Object
  extended by org.opennms.netmgt.config.service.ServiceConfiguration
All Implemented Interfaces:
Serializable

public class ServiceConfiguration
extends Object
implements Serializable

Top-level element for the service-configuration.xml configuration file.

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

Constructor Summary
ServiceConfiguration()
           
 
Method Summary
 void addService(int index, Service vService)
           
 void addService(Service vService)
           
 Enumeration<Service> enumerateService()
          Method enumerateService.
 Service[] getService()
          Method getService.Returns the contents of the collection in an Array.
 Service getService(int index)
          Method getService.
 List<Service> getServiceCollection()
          Method getServiceCollection.Returns a reference to '_serviceList'.
 int getServiceCount()
          Method getServiceCount.
 boolean isValid()
          Method isValid.
 Iterator<Service> iterateService()
          Method iterateService.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllService()
           
 boolean removeService(Service vService)
          Method removeService.
 Service removeServiceAt(int index)
          Method removeServiceAt.
 void setService(int index, Service vService)
           
 void setService(List<Service> vServiceList)
          Sets the value of '_serviceList' by copying the given Vector.
 void setService(Service[] vServiceArray)
           
 void setServiceCollection(List<Service> serviceList)
          Deprecated.  
static ServiceConfiguration 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

ServiceConfiguration

public ServiceConfiguration()
Method Detail

addService

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

addService

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

enumerateService

public Enumeration<Service> enumerateService()
Method enumerateService.

Returns:
an Enumeration over all possible elements of this collection

getService

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

Parameters:
index -
Returns:
the value of the org.opennms.netmgt.config.service.Service at the given index
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getService

public Service[] 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<Service> 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

isValid

public boolean isValid()
Method isValid.

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

iterateService

public Iterator<Service> 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(Service vService)
Method removeService.

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

removeServiceAt

public Service removeServiceAt(int index)
Method removeServiceAt.

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

setService

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

setService

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

setService

public void setService(List<Service> 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<Service> 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.

unmarshal

public static ServiceConfiguration 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.service.ServiceConfiguration
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.