Class AddNamedOperationHandler
- java.lang.Object
-
- uk.gov.gchq.gaffer.store.operation.handler.named.AddNamedOperationHandler
-
- All Implemented Interfaces:
AddToCacheHandler<AddNamedOperation>
,OperationHandler<AddNamedOperation>
public class AddNamedOperationHandler extends Object implements AddToCacheHandler<AddNamedOperation>
Operation handler for AddNamedOperation which adds a Named Operation to the cache.
-
-
Field Summary
Fields Modifier and Type Field Description static Boolean
DEFAULT_IS_NESTED_NAMED_OPERATIONS_ALLOWED
-
Constructor Summary
Constructors Constructor Description AddNamedOperationHandler(String suffixNamedOperationCacheName, Boolean isNestedNamedOperationsAllowed)
AddNamedOperationHandler(NamedOperationCache cache, Boolean isNestedNamedOperationsAllowed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Void
doOperation(AddNamedOperation operation, Context context, Store store)
Adds a NamedOperation to a cache which must be specified in the operation declarations file.String
getSuffixCacheName()
boolean
isNestedNamedOperationsAllowed()
-
-
-
Field Detail
-
DEFAULT_IS_NESTED_NAMED_OPERATIONS_ALLOWED
public static final Boolean DEFAULT_IS_NESTED_NAMED_OPERATIONS_ALLOWED
-
-
Constructor Detail
-
AddNamedOperationHandler
public AddNamedOperationHandler(String suffixNamedOperationCacheName, Boolean isNestedNamedOperationsAllowed)
-
AddNamedOperationHandler
public AddNamedOperationHandler(NamedOperationCache cache, Boolean isNestedNamedOperationsAllowed)
-
-
Method Detail
-
isNestedNamedOperationsAllowed
public boolean isNestedNamedOperationsAllowed()
-
getSuffixCacheName
public String getSuffixCacheName()
- Specified by:
getSuffixCacheName
in interfaceAddToCacheHandler<AddNamedOperation>
-
doOperation
public Void doOperation(AddNamedOperation operation, Context context, Store store) throws OperationException
Adds a NamedOperation to a cache which must be specified in the operation declarations file. An NamedOperationDetail is built using the fields on the AddNamedOperation. The operation name and operation chain fields must be set and cannot be left empty, or the build() method will fail and a runtime exception will be thrown. The handler then adds/overwrites the NamedOperation according toa an overwrite flag.- Specified by:
doOperation
in interfaceOperationHandler<AddNamedOperation>
- Parameters:
operation
- theOperation
to be executedcontext
- the operation chain context, containing the user who executed the operationstore
- theStore
the operation should be run on- Returns:
- null (since the output is void)
- Throws:
OperationException
- if the operation on the cache fails
-
-