public abstract class ViewFacade extends Object implements EntityFacade<ViewDTO>
| Modifier and Type | Field and Description |
|---|---|
protected UserService |
userService |
| Constructor and Description |
|---|
ViewFacade(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
SearchDbService searchDbService,
ViewService viewService,
UserService userService) |
| Modifier and Type | Method and Description |
|---|---|
EntityExcerpt |
createExcerpt(ViewDTO nativeEntity)
Create an excerpt (id, type, title) of a native entity for display purposes.
|
NativeEntity<ViewDTO> |
createNativeEntity(Entity entity,
Map<String,ValueReference> parameters,
Map<EntityDescriptor,Object> nativeEntities,
String username)
Create a native entity of type
T from an entity model. |
protected NativeEntity<ViewDTO> |
decode(EntityV1 entityV1,
Map<String,ValueReference> parameters,
Map<EntityDescriptor,Object> nativeEntities,
User user) |
void |
delete(ViewDTO nativeEntity)
Delete the given native entity.
|
protected void |
ensureV1(Entity entity) |
Optional<Entity> |
exportEntity(EntityDescriptor entityDescriptor,
EntityDescriptorIds entityDescriptorIds)
Create an exportable model of a native entity referenced by an
EntityDescriptor
including optional constraints. |
abstract ViewDTO.Type |
getDTOType() |
abstract ModelType |
getModelType() |
protected Stream<ViewDTO> |
getNativeViews() |
Set<EntityExcerpt> |
listEntityExcerpts()
Create entity excerpts of all native entities of type
T. |
Optional<NativeEntity<ViewDTO>> |
loadNativeEntity(NativeEntityDescriptor nativeEntityDescriptor)
Loads the native entity instance for the given native entity descriptor.
|
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.
|
protected com.google.common.graph.Graph<Entity> |
resolveViewEntity(EntityV1 entity,
ViewEntity viewEntity,
Map<EntityDescriptor,Entity> entities) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindExistingprotected final UserService userService
@Inject
public ViewFacade(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
SearchDbService searchDbService,
ViewService viewService,
UserService userService)
public Optional<Entity> exportEntity(EntityDescriptor entityDescriptor, EntityDescriptorIds entityDescriptorIds)
EntityFacadeEntityDescriptor
including optional constraints.exportEntity in interface EntityFacade<ViewDTO>entityDescriptor - the descriptor of the native entity to exportentityDescriptorIds - the IDs for all entity descriptorsOptional.empty() if the entity couldn't be found.public abstract ModelType getModelType()
protected void ensureV1(Entity entity)
public NativeEntity<ViewDTO> createNativeEntity(Entity entity, Map<String,ValueReference> parameters, Map<EntityDescriptor,Object> nativeEntities, String username)
EntityFacadeT from an entity model.createNativeEntity in interface EntityFacade<ViewDTO>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 entityNativeEntityEntity,
NativeEntityprotected NativeEntity<ViewDTO> decode(EntityV1 entityV1, Map<String,ValueReference> parameters, Map<EntityDescriptor,Object> nativeEntities, User user)
public Optional<NativeEntity<ViewDTO>> loadNativeEntity(NativeEntityDescriptor nativeEntityDescriptor)
EntityFacadeloadNativeEntity in interface EntityFacade<ViewDTO>nativeEntityDescriptor - the native entity descriptorNativeEntity,
or Optional.empty() if the native entity doesn't exist.public void delete(ViewDTO nativeEntity)
EntityFacadedelete in interface EntityFacade<ViewDTO>nativeEntity - The native entity to deletepublic Set<EntityExcerpt> listEntityExcerpts()
EntityFacadeT.listEntityExcerpts in interface EntityFacade<ViewDTO>TEntityExcerptpublic EntityExcerpt createExcerpt(ViewDTO nativeEntity)
EntityFacadecreateExcerpt in interface EntityFacade<ViewDTO>nativeEntity - The native entity to create an excerpt ofEntityExcerptpublic abstract ViewDTO.Type getDTOType()
public com.google.common.graph.Graph<EntityDescriptor> resolveNativeEntity(EntityDescriptor entityDescriptor)
EntityFacaderesolveNativeEntity in interface EntityFacade<ViewDTO>entityDescriptor - the descriptor of the native entity to resolve dependencies forGraphpublic com.google.common.graph.Graph<Entity> resolveForInstallation(Entity entity, Map<String,ValueReference> parameters, Map<EntityDescriptor,Entity> entities)
EntityFacaderesolveForInstallation in interface EntityFacade<ViewDTO>entity - the entity model to resolve dependencies forGraphprotected com.google.common.graph.Graph<Entity> resolveViewEntity(EntityV1 entity, ViewEntity viewEntity, Map<EntityDescriptor,Entity> entities)
Copyright © 2012–2021 Graylog, Inc.. All rights reserved.