Package org.graylog.grn
Class GRNRegistry
java.lang.Object
org.graylog.grn.GRNRegistry
The global
GRN
registry.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic GRNRegistry
Returns an empty registry.static GRNRegistry
Returns a registry that has been initialized with the builtin Graylog GRN types.static GRNRegistry
createWithTypes
(Collection<GRNType> types) Returns a registry that has been initialized with the given GRN types.boolean
Returns theGRN
for the given type and entity.Returns theGRN
for the given type and entity.newGRNBuilder
(String type) Returns a newGRN.Builder
for the given type string.newGRNBuilder
(GRNType type) Returns a newGRN.Builder
for the given type string.ofEventDefinition
(EventDefinition eventDefinition) Parses the given GRN string and returns aGRN
.void
registerType
(GRNType type) Registers the given GRN type.
-
Field Details
-
GLOBAL_USER_GRN
-
-
Method Details
-
createEmpty
Returns an empty registry.- Returns:
- the registry
-
createWithBuiltinTypes
Returns a registry that has been initialized with the builtin Graylog GRN types.- Returns:
- the registry
-
createWithTypes
Returns a registry that has been initialized with the given GRN types.- Parameters:
types
- the GRN types to initialize the registry with- Returns:
- the registry
-
parse
Parses the given GRN string and returns aGRN
.- Parameters:
grnString
- the GRN string to parse- Returns:
- the GRN
- Throws:
IllegalArgumentException
- when given GRN string is invalid
-
newGRN
Returns theGRN
for the given type and entity.- Parameters:
type
- the GRN type stringentity
- the entity string- Returns:
- the GRN
- Throws:
IllegalArgumentException
- when given type doesn't exist or any arguments are null or empty
-
newGRN
Returns theGRN
for the given type and entity.- Parameters:
type
- the GRN type stringentity
- the entity string- Returns:
- the GRN
- Throws:
IllegalArgumentException
- when given type doesn't exist or any arguments are null or empty
-
ofEventDefinition
-
ofUser
-
isUser
-
newGRNBuilder
Returns a newGRN.Builder
for the given type string.- Parameters:
type
- the GRN type string- Returns:
- the GRN builder
- Throws:
IllegalArgumentException
- when given type doesn't exist
-
newGRNBuilder
Returns a newGRN.Builder
for the given type string.- Parameters:
type
- the GRN type string- Returns:
- the GRN builder
- Throws:
IllegalArgumentException
- when given type doesn't exist
-
registerType
Registers the given GRN type.- Parameters:
type
- the typt to register- Throws:
IllegalStateException
- when given type is already registered
-