Class RequisitionUtils

java.lang.Object
org.opennms.pris.util.RequisitionUtils

public class RequisitionUtils extends Object
Utility methods for looking up elements within a requisition or its nodes.
  • Method Details

    • findNode

      public static RequisitionNode findNode(Requisition requisition, String foreignId)
      Finds the node with the given foreign ID.
      Parameters:
      requisition - the requisition to search
      foreignId - the foreign ID to match
      Returns:
      the matching node, or null if none matches
    • findInterface

      public static RequisitionInterface findInterface(RequisitionNode node, String ipAddress)
      Finds the interface on the given node with the given IP address.
      Parameters:
      node - the node to search
      ipAddress - the IP address to match
      Returns:
      the matching interface, or null if none matches
    • findCategory

      public static RequisitionCategory findCategory(RequisitionNode node, String categoryName)
      Finds the category on the given node with the given name.
      Parameters:
      node - the node to search
      categoryName - the category name to match
      Returns:
      the matching category, or null if none matches
    • hasCategory

      public static Boolean hasCategory(RequisitionNode node, String categoryName, Boolean ignoreCase)
      Determines whether the given node carries the given category.
      Parameters:
      node - the node to search
      categoryName - the category name to match
      ignoreCase - whether a case-insensitive match is sufficient; when false the names must match exactly
      Returns:
      true if a matching category exists
    • findAsset

      public static RequisitionAsset findAsset(RequisitionNode node, String assetName)
      Finds the asset on the given node with the given name.
      Parameters:
      node - the node to search
      assetName - the asset name to match
      Returns:
      the matching asset, or null if none matches
    • findMetaData

      public static MetaData findMetaData(RequisitionNode node, String context, String key)
      Finds the meta-data entry on the given node with the given context and key.
      Parameters:
      node - the node to search
      context - the meta-data context to match
      key - the meta-data key to match
      Returns:
      the matching meta-data entry, or null if 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 search
      serviceName - the service name to match
      Returns:
      the matching monitored service, or null if none matches