Package org.opennms.pris.util
Class RequisitionUtils
java.lang.Object
org.opennms.pris.util.RequisitionUtils
Utility methods for looking up elements within a requisition or its nodes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RequisitionAssetfindAsset(RequisitionNode node, String assetName) Finds the asset on the given node with the given name.static RequisitionCategoryfindCategory(RequisitionNode node, String categoryName) Finds the category on the given node with the given name.static RequisitionInterfacefindInterface(RequisitionNode node, String ipAddress) Finds the interface on the given node with the given IP address.static MetaDatafindMetaData(RequisitionNode node, String context, String key) Finds the meta-data entry on the given node with the given context and key.static RequisitionMonitoredServicefindMonitoredService(RequisitionInterface _interface, String serviceName) Finds the monitored service on the given interface with the given name.static RequisitionNodefindNode(Requisition requisition, String foreignId) Finds the node with the given foreign ID.static BooleanhasCategory(RequisitionNode node, String categoryName, Boolean ignoreCase) Determines whether the given node carries the given category.
-
Method Details
-
findNode
Finds the node with the given foreign ID.- Parameters:
requisition- the requisition to searchforeignId- the foreign ID to match- Returns:
- the matching node, or
nullif none matches
-
findInterface
Finds the interface on the given node with the given IP address.- Parameters:
node- the node to searchipAddress- the IP address to match- Returns:
- the matching interface, or
nullif none matches
-
findCategory
Finds the category on the given node with the given name.- Parameters:
node- the node to searchcategoryName- the category name to match- Returns:
- the matching category, or
nullif none matches
-
hasCategory
Determines whether the given node carries the given category.- Parameters:
node- the node to searchcategoryName- the category name to matchignoreCase- whether a case-insensitive match is sufficient; whenfalsethe names must match exactly- Returns:
trueif a matching category exists
-
findAsset
Finds the asset on the given node with the given name.- Parameters:
node- the node to searchassetName- the asset name to match- Returns:
- the matching asset, or
nullif none matches
-
findMetaData
Finds the meta-data entry on the given node with the given context and key.- Parameters:
node- the node to searchcontext- the meta-data context to matchkey- the meta-data key to match- Returns:
- the matching meta-data entry, or
nullif none matches
-
findMonitoredService
public static RequisitionMonitoredService findMonitoredService(RequisitionInterface _interface, String serviceName) Finds the monitored service on the given interface with the given name.- Parameters:
_interface- the interface to searchserviceName- the service name to match- Returns:
- the matching monitored service, or
nullif none matches
-