Package org.jolokia.server.core.util
Class ProviderUtil
java.lang.Object
org.jolokia.server.core.util.ProviderUtil
Utility class for helping in managing and finding provider parts of an objectname
- Since:
- 16.12.13
- Author:
- roland
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classHelper class holding the provider (can be null) and an object name belonging to this provider) -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionextractProvider(String pName) Extract an provider part from anObjectName.extractProvider(ObjectName pName) Extract an provider part from anObjectName.static booleanmatchesProvider(String pProvider, ObjectName pName) Check whether the given name matches the given provider.
-
Field Details
-
PROVIDER_PATTERN
-
-
Method Details
-
extractProvider
public static ProviderUtil.ProviderObjectNamePair extractProvider(String pName) throws MalformedObjectNameException Extract an provider part from anObjectName.- 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 anObjectName.- 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
Check whether the given name matches the given provider. I.e. whether its domain starts withpProvider + "@". A special case is, when the object name doesnt contain any provider (or not even a domain (and the provider given isnull, then this is considered a match as well.- Parameters:
pProvider- provider to check againstpName- object name to check- Returns:
- true if the object name matches the provider
-