org.opennms.netmgt.config.monitoringLocations
Class Locations

java.lang.Object
  extended by org.opennms.netmgt.config.monitoringLocations.Locations
All Implemented Interfaces:
Serializable

public class Locations
extends Object
implements Serializable

The name and polling configuration for each monitoring location. Note: multiple monitors can use the same monitoring location, they will get assigned and ID with the name of the location prepended (example: location name "SFO" instance could be "SFO-1" or "SFO-Building A" as the instance is defined by the user during registration of the distributed monitor).

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

Constructor Summary
Locations()
           
 
Method Summary
 void addLocationDef(int index, LocationDef vLocationDef)
           
 void addLocationDef(LocationDef vLocationDef)
           
 Enumeration<LocationDef> enumerateLocationDef()
          Method enumerateLocationDef.
 LocationDef[] getLocationDef()
          Method getLocationDef.Returns the contents of the collection in an Array.
 LocationDef getLocationDef(int index)
          Method getLocationDef.
 List<LocationDef> getLocationDefCollection()
          Method getLocationDefCollection.Returns a reference to '_locationDefList'.
 int getLocationDefCount()
          Method getLocationDefCount.
 boolean isValid()
          Method isValid.
 Iterator<LocationDef> iterateLocationDef()
          Method iterateLocationDef.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllLocationDef()
           
 boolean removeLocationDef(LocationDef vLocationDef)
          Method removeLocationDef.
 LocationDef removeLocationDefAt(int index)
          Method removeLocationDefAt.
 void setLocationDef(int index, LocationDef vLocationDef)
           
 void setLocationDef(List<LocationDef> vLocationDefList)
          Sets the value of '_locationDefList' by copying the given Vector.
 void setLocationDef(LocationDef[] vLocationDefArray)
           
 void setLocationDefCollection(List<LocationDef> locationDefList)
          Deprecated.  
static Locations 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

Locations

public Locations()
Method Detail

addLocationDef

public void addLocationDef(LocationDef vLocationDef)
                    throws IndexOutOfBoundsException
Parameters:
vLocationDef -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addLocationDef

public void addLocationDef(int index,
                           LocationDef vLocationDef)
                    throws IndexOutOfBoundsException
Parameters:
index -
vLocationDef -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateLocationDef

public Enumeration<LocationDef> enumerateLocationDef()
Method enumerateLocationDef.

Returns:
an Enumeration over all possible elements of this collection

getLocationDef

public LocationDef getLocationDef(int index)
                           throws IndexOutOfBoundsException
Method getLocationDef.

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

getLocationDef

public LocationDef[] getLocationDef()
Method getLocationDef.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

getLocationDefCollection

public List<LocationDef> getLocationDefCollection()
Method getLocationDefCollection.Returns a reference to '_locationDefList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getLocationDefCount

public int getLocationDefCount()
Method getLocationDefCount.

Returns:
the size of this collection

isValid

public boolean isValid()
Method isValid.

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

iterateLocationDef

public Iterator<LocationDef> iterateLocationDef()
Method iterateLocationDef.

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

removeAllLocationDef

public void removeAllLocationDef()

removeLocationDef

public boolean removeLocationDef(LocationDef vLocationDef)
Method removeLocationDef.

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

removeLocationDefAt

public LocationDef removeLocationDefAt(int index)
Method removeLocationDefAt.

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

setLocationDef

public void setLocationDef(int index,
                           LocationDef vLocationDef)
                    throws IndexOutOfBoundsException
Parameters:
index -
vLocationDef -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setLocationDef

public void setLocationDef(LocationDef[] vLocationDefArray)
Parameters:
vLocationDefArray -

setLocationDef

public void setLocationDef(List<LocationDef> vLocationDefList)
Sets the value of '_locationDefList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vLocationDefList - the Vector to copy.

setLocationDefCollection

public void setLocationDefCollection(List<LocationDef> locationDefList)
Deprecated. 

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

Parameters:
locationDefList - the Vector to set.

unmarshal

public static Locations 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.monitoringLocations.Locations
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.