Class DefaultCollectionAgent
- java.lang.Object
-
- org.opennms.netmgt.collection.core.DefaultCollectionAgent
-
- All Implemented Interfaces:
CollectionAgent
- Direct Known Subclasses:
DefaultSnmpCollectionAgent
public class DefaultCollectionAgent extends java.lang.Object implements CollectionAgent
Represents a remote agent on a specific IPv4 interface.- Version:
- $Id: $
- Author:
- ranger
-
-
Field Summary
Fields Modifier and Type Field Description protected CollectionAgentService
m_agentService
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultCollectionAgent(CollectionAgentService agentService, java.lang.String location)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CollectionAgent
create(java.lang.Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr)
createstatic CollectionAgent
create(java.lang.Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr, java.lang.String location)
java.net.InetAddress
getAddress()
Returns the address information for the interface.<V> V
getAttribute(java.lang.String property)
This method is used to return the object that is associated with the property name.java.util.Set<java.lang.String>
getAttributeNames()
Retrieves the names of all available attributes.java.lang.String
getForeignId()
getForeignIdjava.lang.String
getForeignSource()
getForeignSourcejava.lang.String
getHostAddress()
getHostAddressjava.lang.String
getLocationName()
getLocationNameint
getNodeId()
getNodeIdjava.lang.String
getNodeLabel()
getNodeLabellong
getSavedSysUpTime()
getSavedSysUpTimeResourcePath
getStorageResourcePath()
java.lang.Boolean
isStoreByForeignSource()
isStoreByForeignSourceprotected void
logCollectionParms()
protected void
logCompletion()
java.lang.Object
setAttribute(java.lang.String property, java.lang.Object value)
This method is used to associate an object value with a textual key.void
setSavedSysUpTime(long sysUpTime)
setSavedSysUpTimejava.lang.String
toString()
toString
-
-
-
Field Detail
-
m_agentService
protected CollectionAgentService m_agentService
-
-
Constructor Detail
-
DefaultCollectionAgent
protected DefaultCollectionAgent(CollectionAgentService agentService, java.lang.String location)
-
-
Method Detail
-
create
public static CollectionAgent create(java.lang.Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr)
create
- Parameters:
ifaceId
- aInteger
object.ifaceDao
- aIpInterfaceDao
object.transMgr
- aPlatformTransactionManager
object.- Returns:
- a
CollectionAgent
object.
-
create
public static CollectionAgent create(java.lang.Integer ifaceId, IpInterfaceDao ifaceDao, org.springframework.transaction.PlatformTransactionManager transMgr, java.lang.String location)
-
getAddress
public final java.net.InetAddress getAddress()
Returns the address information for the interface.
- Specified by:
getAddress
in interfaceCollectionAgent
- Returns:
- a
Object
object.
-
getAttributeNames
public final java.util.Set<java.lang.String> getAttributeNames()
Description copied from interface:CollectionAgent
Retrieves the names of all available attributes.- Specified by:
getAttributeNames
in interfaceCollectionAgent
- Returns:
- a
Set
that contains the name of all configured attributes
-
getAttribute
public final <V> V getAttribute(java.lang.String property)
This method is used to return the object that is associated with the property name. This is very similar to the java.util.Map get() method, but requires that the lookup be performed using a String name. The object may be of any instance that the monitor previous stored.
If there is no matching object for the property key, then a null pointer is returned to the application.
This method is used to return the object that is associated with the property name. This is very similar to the java.util.Map get() method, but requires that the lookup be performed using a String name. The object may be of any instance that the monitor previous stored.
If there is no matching object for the property key, then a null pointer is returned to the application.
- Specified by:
getAttribute
in interfaceCollectionAgent
- Parameters:
property
- The key for the lookup.- Returns:
- The resulting value for the key, null if no value exist.
- Throws:
java.lang.IllegalArgumentException
- Thrown if the passed key is empty or null.- See Also:
Map.get(java.lang.Object)
-
setAttribute
public final java.lang.Object setAttribute(java.lang.String property, java.lang.Object value)
This method is used to associate an object value with a textual key. If a previous value was associated with the key then the old value is returned to the caller. This is identical to the behavior defined by the java.util.Map put() method. The only restriction is that the key must be a java string instance.
This method is used to associate an object value with a textual key. If a previous value was associated with the key then the old value is returned to the caller. This is identical to the behavior defined by the java.util.Map put() method. The only restriction is that the key must be a java string instance.
- Specified by:
setAttribute
in interfaceCollectionAgent
- Parameters:
property
- The keyvalue
- The value to associate with the key- Returns:
- The object that was previously associated with the key. Null is returned if there was no previous value associated.
- Throws:
java.lang.IllegalArgumentException
- Thrown if the property name is empty or null.- See Also:
Map.put(java.lang.Object, java.lang.Object)
-
isStoreByForeignSource
public final java.lang.Boolean isStoreByForeignSource()
isStoreByForeignSource
- Specified by:
isStoreByForeignSource
in interfaceCollectionAgent
- Returns:
- a
Boolean
object.
-
getHostAddress
public final java.lang.String getHostAddress()
getHostAddress
- Specified by:
getHostAddress
in interfaceCollectionAgent
- Returns:
- a
String
object.
-
getNodeId
public final int getNodeId()
getNodeId
- Specified by:
getNodeId
in interfaceCollectionAgent
- Returns:
- a int.
-
getNodeLabel
public final java.lang.String getNodeLabel()
getNodeLabel
- Specified by:
getNodeLabel
in interfaceCollectionAgent
- Returns:
- a
String
object.
-
getForeignSource
public final java.lang.String getForeignSource()
getForeignSource
- Specified by:
getForeignSource
in interfaceCollectionAgent
- Returns:
- a
String
object.
-
getForeignId
public final java.lang.String getForeignId()
getForeignId
- Specified by:
getForeignId
in interfaceCollectionAgent
- Returns:
- a
String
object.
-
getLocationName
public final java.lang.String getLocationName()
Description copied from interface:CollectionAgent
getLocationName
- Specified by:
getLocationName
in interfaceCollectionAgent
- Returns:
- a
String
object.
-
getStorageResourcePath
public final ResourcePath getStorageResourcePath()
- Specified by:
getStorageResourcePath
in interfaceCollectionAgent
-
logCompletion
protected void logCompletion()
-
logCollectionParms
protected void logCollectionParms()
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a
String
object.
-
getSavedSysUpTime
public final long getSavedSysUpTime()
getSavedSysUpTime
- Specified by:
getSavedSysUpTime
in interfaceCollectionAgent
- Returns:
- a long.
-
setSavedSysUpTime
public final void setSavedSysUpTime(long sysUpTime)
setSavedSysUpTime
- Specified by:
setSavedSysUpTime
in interfaceCollectionAgent
- Parameters:
sysUpTime
- a long.
-
-