Class UrlWhitelistFacade
java.lang.Object
org.graylog2.contentpacks.facades.UrlWhitelistFacade
- All Implemented Interfaces:
EntityFacade<WhitelistEntry>
,EntityWithExcerptFacade<WhitelistEntry,
WhitelistEntry>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionUrlWhitelistFacade
(com.fasterxml.jackson.databind.ObjectMapper objectMapper, UrlWhitelistService urlWhitelistService) -
Method Summary
Modifier and TypeMethodDescriptioncreateExcerpt
(WhitelistEntry whitelistEntry) 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 typeT
from an entity model.void
delete
(WhitelistEntry nativeEntity) Delete the given native entity.exportEntity
(EntityDescriptor entityDescriptor, EntityDescriptorIds entityDescriptorIds) Create an exportable model of a native entity referenced by anEntityDescriptor
including optional constraints.Create entity excerpts of all native entities of typeT
.loadNativeEntity
(NativeEntityDescriptor nativeEntityDescriptor) Loads the native entity instance for the given native entity descriptor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.graylog2.contentpacks.facades.EntityWithExcerptFacade
findExisting, resolveForInstallation, resolveNativeEntity, usesScopedEntities
-
Field Details
-
TYPE_V1
-
-
Constructor Details
-
UrlWhitelistFacade
@Inject public UrlWhitelistFacade(com.fasterxml.jackson.databind.ObjectMapper objectMapper, UrlWhitelistService urlWhitelistService)
-
-
Method Details
-
exportEntity
public Optional<Entity> exportEntity(EntityDescriptor entityDescriptor, EntityDescriptorIds entityDescriptorIds) Description copied from interface:EntityWithExcerptFacade
Create an exportable model of a native entity referenced by anEntityDescriptor
including optional constraints.- Specified by:
exportEntity
in interfaceEntityWithExcerptFacade<WhitelistEntry,
WhitelistEntry> - 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.
-
createNativeEntity
public NativeEntity<WhitelistEntry> createNativeEntity(Entity entity, Map<String, ValueReference> parameters, Map<EntityDescriptor, Object> nativeEntities, String username) Description copied from interface:EntityWithExcerptFacade
Create a native entity of typeT
from an entity model.- Specified by:
createNativeEntity
in interfaceEntityWithExcerptFacade<WhitelistEntry,
WhitelistEntry> - 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:
-
loadNativeEntity
public Optional<NativeEntity<WhitelistEntry>> loadNativeEntity(NativeEntityDescriptor nativeEntityDescriptor) Description copied from interface:EntityWithExcerptFacade
Loads the native entity instance for the given native entity descriptor.- Specified by:
loadNativeEntity
in interfaceEntityWithExcerptFacade<WhitelistEntry,
WhitelistEntry> - Parameters:
nativeEntityDescriptor
- the native entity descriptor- Returns:
- the existing native entity in the database wrapped in
NativeEntity<T>
, orOptional.empty()
if the native entity doesn't exist.
-
delete
Description copied from interface:EntityWithExcerptFacade
Delete the given native entity.- Specified by:
delete
in interfaceEntityWithExcerptFacade<WhitelistEntry,
WhitelistEntry> - Parameters:
nativeEntity
- The native entity to delete
-
createExcerpt
Description copied from interface:EntityWithExcerptFacade
Create an excerpt (id, type, title) of a native entity for display purposes.- Specified by:
createExcerpt
in interfaceEntityWithExcerptFacade<WhitelistEntry,
WhitelistEntry> - Parameters:
whitelistEntry
- The native entity to create an excerpt of- Returns:
- The entity excerpt of the native entity
- See Also:
-
listEntityExcerpts
Description copied from interface:EntityWithExcerptFacade
Create entity excerpts of all native entities of typeT
.- Specified by:
listEntityExcerpts
in interfaceEntityWithExcerptFacade<WhitelistEntry,
WhitelistEntry> - Returns:
- A collection of entity excerpts of all native entities of type
T
- See Also:
-