Class IndexStorageStrategy
- java.lang.Object
-
- org.opennms.netmgt.collection.support.IndexStorageStrategy
-
- All Implemented Interfaces:
StorageStrategy
- Direct Known Subclasses:
FrameRelayStorageStrategy
,HostFileSystemStorageStrategy
,JexlIndexStorageStrategy
,SiblingColumnStorageStrategy
,XmlStorageStrategy
public class IndexStorageStrategy extends Object implements StorageStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected StorageStrategyService
m_storageStrategyService
-
Constructor Summary
Constructors Constructor Description IndexStorageStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourcePath
getRelativePathForAttribute(ResourcePath resourceParent, String instance)
getRelativePathForAttributeString
getResourceNameFromIndex(CollectionResource resource)
This functions translate resourceIndex into a "unique" and "non-variable" name that could be identify a resource, as described earlier.String
getResourceTypeName()
getResourceTypeNamevoid
setParameters(List<Parameter> parameterCollection)
setParametersvoid
setResourceTypeName(String name)
setResourceTypeNamevoid
setStorageStrategyService(StorageStrategyService agent)
Add to a strategy the possibility to get additional information using SNMP when is necessary.
-
-
-
Field Detail
-
m_storageStrategyService
protected StorageStrategyService m_storageStrategyService
-
-
Method Detail
-
getRelativePathForAttribute
public final ResourcePath getRelativePathForAttribute(ResourcePath resourceParent, String instance)
getRelativePathForAttribute
- Specified by:
getRelativePathForAttribute
in interfaceStorageStrategy
- Parameters:
resourceParent
- aString
object.instance
- aString
object.- Returns:
- a
Path
object.
-
setResourceTypeName
public final void setResourceTypeName(String name)
setResourceTypeName
- Specified by:
setResourceTypeName
in interfaceStorageStrategy
- Parameters:
name
- aString
object.
-
getResourceTypeName
public final String getResourceTypeName()
getResourceTypeName
- Returns:
- a
String
object.
-
getResourceNameFromIndex
public String getResourceNameFromIndex(CollectionResource resource)
This functions translate resourceIndex into a "unique" and "non-variable" name that could be identify a resource, as described earlier. This method could be expensive because it could require send SNMP queries and make complicated functions to build the name. So you must try to call it only when is necessary.- Specified by:
getResourceNameFromIndex
in interfaceStorageStrategy
- Parameters:
resource
- aCollectionResource
object- Returns:
- a
String
object.
-
setStorageStrategyService
public final void setStorageStrategyService(StorageStrategyService agent)
Add to a strategy the possibility to get additional information using SNMP when is necessary. There are complex tables on some MIBs where indexes depends on indexes from other tables (indirect indexing). For this kind of resources we must send some additional SNMP queries to build a unique name.- Specified by:
setStorageStrategyService
in interfaceStorageStrategy
- Parameters:
agent
- aorg.opennms.netmgt.config.StorageStrategyService
object.
-
setParameters
public void setParameters(List<Parameter> parameterCollection) throws IllegalArgumentException
setParameters
- Specified by:
setParameters
in interfaceStorageStrategy
- Parameters:
parameterCollection
- aList
object.- Throws:
IllegalArgumentException
-
-