Class ProviderUtil

java.lang.Object
org.jolokia.server.core.util.ProviderUtil

public final class ProviderUtil extends Object
Utility class for helping in managing and finding provider parts of an objectname
Since:
16.12.13
Author:
roland
  • Field Details

    • PROVIDER_PATTERN

      public static final Pattern PROVIDER_PATTERN
  • Method Details

    • extractProvider

      public static ProviderUtil.ProviderObjectNamePair extractProvider(String pName) throws MalformedObjectNameException
      Extract an provider part from an ObjectName.
      Parameters:
      pName - object name from which the provider should be extracted. Must not be null.
      Returns:
      object name containing the extracted provider (which can be null) and the object name itself. Is never null.
      Throws:
      MalformedObjectNameException
    • extractProvider

      public static ProviderUtil.ProviderObjectNamePair extractProvider(ObjectName pName) throws MalformedObjectNameException
      Extract an provider part from an ObjectName.
      Parameters:
      pName - object name from which the provider should be extracted. Must not be null.
      Returns:
      object name containing the extracted provider (which can be null) and the object name itself. Is never null.
      Throws:
      MalformedObjectNameException
    • matchesProvider

      public static boolean matchesProvider(String pProvider, ObjectName pName)
      Check whether the given name matches the given provider. I.e. whether its domain starts with pProvider + "@". A special case is, when the object name doesnt contain any provider (or not even a domain (and the provider given is null, then this is considered a match as well.
      Parameters:
      pProvider - provider to check against
      pName - object name to check
      Returns:
      true if the object name matches the provider