public class RegistryUtility extends Object
Modifier and Type | Field and Description |
---|---|
static String |
REGISTRY_ID_REGEX |
Constructor and Description |
---|
RegistryUtility() |
Modifier and Type | Method and Description |
---|---|
static boolean |
getBooleanAttribute(Metacard metacard,
String attributeToCheck)
Identifies whether the metacard has the attribute and its boolean value
|
static List<String> |
getListOfStringAttribute(Metacard metacard,
String attributeToCheck)
Attempts to return a List of Strings from an attribute.
|
static String |
getRegistryId(Metacard metacard)
Returns the registry id of the metacard passed in.
|
static String |
getStringAttribute(Metacard metacard,
String attributeToCheck,
String defaultValue)
Attempts to return a String attribute's value.
|
static boolean |
hasAttribute(Metacard metacard,
String attributeName)
Simple method to just check for the existance of an attribute on a metacard
|
static boolean |
isIdentityNode(Metacard metacard)
Identifies whether the metacard is a registry identity node
|
static boolean |
isInternalRegistryMetacard(Metacard metacard)
Checks that the metacard passed in has the internal Registry metacard tag and a valid
RegistryId.
|
static boolean |
isLocalNode(Metacard metacard)
Identifies whether the metacard is a local registry node
|
static boolean |
isRegistryMetacard(Metacard metacard)
Checks that the metacard passed in has the Registry metacard tag and a valid RegistryId.
|
static boolean |
validRegistryId(String registryId)
Checks if the given registryId is of a valid format.
|
public static final String REGISTRY_ID_REGEX
public static boolean validRegistryId(String registryId)
registryId
- registryId to be checkedpublic static boolean isRegistryMetacard(Metacard metacard)
metacard
- - will have tags and RegistryId evaluatedpublic static boolean isInternalRegistryMetacard(Metacard metacard)
metacard
- - will have tags and RegistryId evaluatedpublic static String getRegistryId(Metacard metacard)
metacard
- - the metacard for which the registry Id will be returnedpublic static boolean isIdentityNode(Metacard metacard)
metacard
- - metacard to be evaluated for registry identity statuspublic static boolean isLocalNode(Metacard metacard)
metacard
- - metacard to be evaluated for local registry statuspublic static boolean getBooleanAttribute(Metacard metacard, String attributeToCheck)
metacard
- - metacard to be evaluated for boolean attributeattributeToCheck
- - attribute to be evaluted, expected to be boolean in valuepublic static String getStringAttribute(Metacard metacard, String attributeToCheck, String defaultValue)
metacard
- - metacard to be evaluated for a String type attributeattributeToCheck
- - attribute to be checked for, should have a String typedefaultValue
- - the value expected to be returned if the attribute is not presentpublic static List<String> getListOfStringAttribute(Metacard metacard, String attributeToCheck)
metacard
- - metacard to be evaluated for a List of Strings type attributeattributeToCheck
- - attribute to be checked for, should be a List of Strings typeThis work is licensed under a Creative Commons Attribution 4.0 International License.