Class StreamReferenceFacade
java.lang.Object
org.graylog2.contentpacks.facades.StreamFacade
org.graylog2.contentpacks.facades.StreamReferenceFacade
- All Implemented Interfaces:
EntityFacade<Stream>,EntityWithExcerptFacade<Stream,Stream>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStreamReferenceFacade(com.fasterxml.jackson.databind.ObjectMapper objectMapper, StreamService streamService, StreamRuleService streamRuleService, V20190722150700_LegacyAlertConditionMigration legacyAlertsMigration, IndexSetService indexSetService, UserService userService) -
Method Summary
Modifier and TypeMethodDescriptioncreateExcerpt(Stream stream) Create an excerpt (id, type, title) of a native entity for display purposes.createNativeEntity(Entity entity, Map<String, ValueReference> parameters, Map<EntityDescriptor, Object> nativeEntities, String username) Create a native entity of typeTfrom an entity model.exportEntity(EntityDescriptor entityDescriptor, EntityDescriptorIds entityDescriptorIds) Create an exportable model of a native entity referenced by anEntityDescriptorincluding optional constraints.findExisting(Entity entity, Map<String, ValueReference> parameters) Find an existing instance of the native entity described by the entity model.getStreamEntityId(String id, EntityDescriptorIds entityDescriptorIds) static StringgetStreamEntityIdOrThrow(String id, EntityDescriptorIds entityDescriptorIds) Create entity excerpts of all native entities of typeT.com.google.common.graph.Graph<Entity>resolveForInstallation(Entity entity, Map<String, ValueReference> parameters, Map<EntityDescriptor, Entity> entities) Create the dependency graph of an entity described by the given entity model during content pack installation.com.google.common.graph.Graph<EntityDescriptor>resolveNativeEntity(EntityDescriptor entityDescriptor) Create the dependency graph of a native entity described by the given entity descriptor.static EntityresolveStreamEntity(String id, Map<EntityDescriptor, Entity> entities) static ObjectresolveStreamEntityObject(String id, Map entities) Methods inherited from class org.graylog2.contentpacks.facades.StreamFacade
delete, loadNativeEntityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graylog2.contentpacks.facades.EntityWithExcerptFacade
usesScopedEntities
-
Field Details
-
TYPE_V1
-
-
Constructor Details
-
Method Details
-
resolveNativeEntity
public com.google.common.graph.Graph<EntityDescriptor> resolveNativeEntity(EntityDescriptor entityDescriptor) Description copied from interface:EntityWithExcerptFacadeCreate the dependency graph of a native entity described by the given entity descriptor.- Specified by:
resolveNativeEntityin interfaceEntityWithExcerptFacade<Stream,Stream> - Overrides:
resolveNativeEntityin classStreamFacade- Parameters:
entityDescriptor- the descriptor of the native entity to resolve dependencies for- Returns:
- A directed graph of the native entity with entity descriptors as nodes.
- See Also:
-
Graph
-
exportEntity
public Optional<Entity> exportEntity(EntityDescriptor entityDescriptor, EntityDescriptorIds entityDescriptorIds) Description copied from interface:EntityWithExcerptFacadeCreate an exportable model of a native entity referenced by anEntityDescriptorincluding optional constraints.- Specified by:
exportEntityin interfaceEntityWithExcerptFacade<Stream,Stream> - Overrides:
exportEntityin classStreamFacade- Parameters:
entityDescriptor- the descriptor of the native entity to exportentityDescriptorIds- the IDs for all entity descriptors- Returns:
- an exportable (serializable) model of the entity including optional constraints,
or
Optional.empty()if the entity couldn't be found.
-
resolveForInstallation
public com.google.common.graph.Graph<Entity> resolveForInstallation(Entity entity, Map<String, ValueReference> parameters, Map<EntityDescriptor, Entity> entities) Description copied from interface:EntityWithExcerptFacadeCreate the dependency graph of an entity described by the given entity model during content pack installation.- Specified by:
resolveForInstallationin interfaceEntityWithExcerptFacade<Stream,Stream> - Overrides:
resolveForInstallationin classStreamFacade- Parameters:
entity- the entity model to resolve dependencies for- Returns:
- A directed graph of the native entity with entity models as nodes.
- See Also:
-
Graph
-
findExisting
public Optional<NativeEntity<Stream>> findExisting(Entity entity, Map<String, ValueReference> parameters) Description copied from interface:EntityWithExcerptFacadeFind an existing instance of the native entity described by the entity model.- Specified by:
findExistingin interfaceEntityWithExcerptFacade<Stream,Stream> - Overrides:
findExistingin classStreamFacade- Parameters:
entity- the entity model from which a native entity should be createdparameters- user-provided parameters to resolve parameters in the entity model- Returns:
- the existing native entity in the database wrapped in
NativeEntity<T>, orOptional.empty()if the entity couldn't be found. - See Also:
-
createNativeEntity
public NativeEntity<Stream> createNativeEntity(Entity entity, Map<String, ValueReference> parameters, Map<EntityDescriptor, Object> nativeEntities, String username) Description copied from interface:EntityWithExcerptFacadeCreate a native entity of typeTfrom an entity model.- Specified by:
createNativeEntityin interfaceEntityWithExcerptFacade<Stream,Stream> - Overrides:
createNativeEntityin classStreamFacade- Parameters:
entity- the entity model from which a native entity should be createdparameters- user-provided parameters to resolve parameters in the entity modelnativeEntities- existing native entities to reference during the creation of the native entityusername- the name of the user creating the entity- Returns:
- the created native entity wrapped in
- See Also:
-
createExcerpt
Description copied from interface:EntityWithExcerptFacadeCreate an excerpt (id, type, title) of a native entity for display purposes.- Specified by:
createExcerptin interfaceEntityWithExcerptFacade<Stream,Stream> - Overrides:
createExcerptin classStreamFacade- Parameters:
stream- The native entity to create an excerpt of- Returns:
- The entity excerpt of the native entity
- See Also:
-
listEntityExcerpts
Description copied from interface:EntityWithExcerptFacadeCreate entity excerpts of all native entities of typeT.- Specified by:
listEntityExcerptsin interfaceEntityWithExcerptFacade<Stream,Stream> - Overrides:
listEntityExcerptsin classStreamFacade- Returns:
- A collection of entity excerpts of all native entities of type
T - See Also:
-
resolveStreamEntity
-
resolveStreamEntityObject
-
getStreamEntityId
public static Optional<String> getStreamEntityId(String id, EntityDescriptorIds entityDescriptorIds) -
getStreamEntityIdOrThrow
-