public class PermissionAwareObjectFacade extends DefaultObjectFacade
DefaultObjectFacade and adds permission checks on each action.COCKPITNG_CRUD_COCKPIT_EVENT_NOTIFICATION, CTX_PARAM_UPDATED_OBJECT_IS_NEW, typeFacadeCTX_DISABLE_CRUD_COCKPIT_EVENT_NOTIFICATION, CTX_PARAM_SUPPRESS_EVENTOBJECT_CREATED_EVENT, OBJECTS_DELETED_EVENT, OBJECTS_UPDATED_EVENT| Constructor and Description |
|---|
PermissionAwareObjectFacade() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
clone(T objectToClone,
Context ctx)
Clone an object by given object data.
|
<T> T |
create(String typeId,
Context ctx)
Creates a new object in the system using given object data.
|
<T> ObjectFacadeOperationResult<T> |
delete(Collection<T> objects,
Context ctx)
Deletes many given objects from the system.
Default implementation calls ObjectCRUDHandler.delete(Object, Context) in a loop and does not publish
ObjectCRUDHandler.OBJECTS_DELETED_EVENT event. |
<T> void |
delete(T object,
Context ctx)
Deletes given object from the system.
|
protected <T> Set<String> |
getModifiedProperties(T objectToSave,
Context ctx)
Tries to identify modified properties.
|
PermissionFacade |
getPermissionFacade() |
TypeFacade |
getTypeFacade()
Active type facade.
|
<T> T |
load(String id,
Context ctx)
Gets an object instance by it's id.
|
<T> T |
save(T objectToSave,
Context ctx)
Persist an object by given object data.
|
void |
setLabelService(LabelService labelService) |
void |
setPermissionFacade(PermissionFacade permissionFacade) |
create, delete, getEventPublisher, isCockpitEventNotificationDisabledInCtx, isCockpitEventNotificationEnabled, isModified, isNew, load, populateEventContext, publishEvent, reload, reload, save, save, saveSingleObject, setCockpitProperties, setEventPublisher, setEventQueue, setStrategyRegistry, setTypeFacadeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclone, delete, reload, savereloadpublic <T> T load(String id, Context ctx) throws ObjectNotFoundException
ObjectCRUDHandlerload in interface ObjectCRUDHandlerload in class DefaultObjectFacadeid - for which the object is neededctx - context specifying the loaded attributes of the returned object as well as application settingsObjectNotFoundException - if no object with the given id could be foundpublic <T> void delete(T object,
Context ctx)
throws ObjectDeletionException
ObjectCRUDHandlerdelete in interface ObjectCRUDHandlerdelete in class DefaultObjectFacadeobject - which should get deletedctx - context specifying application settingsObjectDeletionException - if the given object could not be deletedpublic <T> ObjectFacadeOperationResult<T> delete(Collection<T> objects, Context ctx)
ObjectCRUDHandlerObjectCRUDHandler.delete(Object, Context) in a loop and does not publish
ObjectCRUDHandler.OBJECTS_DELETED_EVENT event.delete in interface ObjectCRUDHandlerdelete in class DefaultObjectFacadeobjects - which should get deletedpublic <T> T create(String typeId, Context ctx) throws ObjectCreationException
ObjectCRUDHandlercreate in interface ObjectCRUDHandlercreate in class DefaultObjectFacadetypeId - the data for creation of object in systemctx - context specifying the loaded attributes of the returned object as well as application settingsObjectCreationException - if the object couldn't be created, like an object with the specified id already existspublic <T> T clone(T objectToClone,
Context ctx)
throws ObjectCloningException
ObjectCRUDHandlerclone in interface ObjectCRUDHandlerclone in class DefaultObjectFacadeobjectToClone - - source object to be cloned.ctx - context specifying the loaded attributes of the returned object as well as application settings.ObjectCloningException - if cannot perform the clone.public <T> T save(T objectToSave,
Context ctx)
throws ObjectSavingException
ObjectCRUDHandlersave in interface ObjectCRUDHandlersave in class DefaultObjectFacadeobjectToSave - the data for updating an object in systemctx - context specifying the loaded attributes of the returned object as well as application settingsObjectSavingException - if the object couldn't be persisted, like a unique attribute was updated to be non-uniqueprotected <T> Set<String> getModifiedProperties(T objectToSave, Context ctx)
objectToSave - The object with potentially modified properties.ctx - An additional Context.public PermissionFacade getPermissionFacade()
public void setPermissionFacade(PermissionFacade permissionFacade)
public TypeFacade getTypeFacade()
public void setLabelService(LabelService labelService)
Copyright © 2018. All rights reserved.