org.opennms.netmgt.config.monitoringLocations
Class LocationDef

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

public class LocationDef
extends Object
implements Serializable

This element contains the name of the location, the name of the monitoring area (used to aggregate locations, example: Area San Francisco, location name "SFO" which becomes SFO-1 or SFO-BuildingA, etc.) Additionally, a geolocation can be provided (an address or other identifying location that can be looked up with a geolocation API), as well as coordinates (latitude,longitude). Finally, a priority can be assigned to the location, for purposes of sorting (1 = highest, 100 = lowest). The polling package name is used to associate with a polling configuration found in the polling-configuration.xml file.

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

Constructor Summary
LocationDef()
           
 
Method Summary
 void deletePriority()
           
 boolean equals(Object obj)
          Overrides the java.lang.Object.equals method.
 String getCoordinates()
          Returns the value of field 'coordinates'.
 String getGeolocation()
          Returns the value of field 'geolocation'.
 String getLocationName()
          Returns the value of field 'locationName'.
 String getMonitoringArea()
          Returns the value of field 'monitoringArea'.
 String getPollingPackageName()
          Returns the value of field 'pollingPackageName'.
 long getPriority()
          Returns the value of field 'priority'.
 Tags getTags()
          Returns the value of field 'tags'.
 int hashCode()
          Overrides the java.lang.Object.hashCode method.
 boolean hasPriority()
          Method hasPriority.
 boolean isValid()
          Method isValid.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void setCoordinates(String coordinates)
          Sets the value of field 'coordinates'.
 void setGeolocation(String geolocation)
          Sets the value of field 'geolocation'.
 void setLocationName(String locationName)
          Sets the value of field 'locationName'.
 void setMonitoringArea(String monitoringArea)
          Sets the value of field 'monitoringArea'.
 void setPollingPackageName(String pollingPackageName)
          Sets the value of field 'pollingPackageName'.
 void setPriority(long priority)
          Sets the value of field 'priority'.
 void setTags(Tags tags)
          Sets the value of field 'tags'.
static LocationDef unmarshal(Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationDef

public LocationDef()
Method Detail

deletePriority

public void deletePriority()

equals

public boolean equals(Object obj)
Overrides the java.lang.Object.equals method.

Overrides:
equals in class Object
Parameters:
obj -
Returns:
true if the objects are equal.

getCoordinates

public String getCoordinates()
Returns the value of field 'coordinates'.

Returns:
the value of field 'Coordinates'.

getGeolocation

public String getGeolocation()
Returns the value of field 'geolocation'.

Returns:
the value of field 'Geolocation'.

getLocationName

public String getLocationName()
Returns the value of field 'locationName'.

Returns:
the value of field 'LocationName'.

getMonitoringArea

public String getMonitoringArea()
Returns the value of field 'monitoringArea'.

Returns:
the value of field 'MonitoringArea'.

getPollingPackageName

public String getPollingPackageName()
Returns the value of field 'pollingPackageName'.

Returns:
the value of field 'PollingPackageName'.

getPriority

public long getPriority()
Returns the value of field 'priority'.

Returns:
the value of field 'Priority'.

getTags

public Tags getTags()
Returns the value of field 'tags'. The field 'tags' has the following description: An collection of tags.

Returns:
the value of field 'Tags'.

hasPriority

public boolean hasPriority()
Method hasPriority.

Returns:
true if at least one Priority has been added

hashCode

public int hashCode()
Overrides the java.lang.Object.hashCode method.

The following steps came from Effective Java Programming Language Guide by Joshua Bloch, Chapter 3

Overrides:
hashCode in class Object
Returns:
a hash code value for the object.

isValid

public boolean isValid()
Method isValid.

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

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

setCoordinates

public void setCoordinates(String coordinates)
Sets the value of field 'coordinates'.

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

setGeolocation

public void setGeolocation(String geolocation)
Sets the value of field 'geolocation'.

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

setLocationName

public void setLocationName(String locationName)
Sets the value of field 'locationName'.

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

setMonitoringArea

public void setMonitoringArea(String monitoringArea)
Sets the value of field 'monitoringArea'.

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

setPollingPackageName

public void setPollingPackageName(String pollingPackageName)
Sets the value of field 'pollingPackageName'.

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

setPriority

public void setPriority(long priority)
Sets the value of field 'priority'.

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

setTags

public void setTags(Tags tags)
Sets the value of field 'tags'. The field 'tags' has the following description: An collection of tags.

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

unmarshal

public static LocationDef 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.LocationDef
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 © 2011. All Rights Reserved.