Package uk.gov.gchq.gaffer.graph.hook
Class UpdateViewHook
- java.lang.Object
-
- uk.gov.gchq.gaffer.graph.hook.UpdateViewHook
-
- All Implemented Interfaces:
GraphHook
public class UpdateViewHook extends Object implements GraphHook
This is a hook to update all operation views in a chain before it is executed. This hook can be configured to add additional view configurations such as extra filters and it can also be used to remove element groups out of a view. This hook will have no effect with operations that do not correctly implementOperationViewtherefore THIS HOOK SHOULD NOT BE USED TO ENFORCE ROLE BASED FILTERING OF ELEMENTS. Instead please make use of the visibility property (Schema.visibilityProperty).All fields are Optional:
- withOpAuth = Apply this hook to Users with any of these operation authorisations
- withoutOpAuth = Apply this hook to Users without any of these operation authorisations, overrides withOpAuth
- withDataAuth = Apply this hook to Users with any of these data authorisations
- withoutDataAuth = Apply this hook to Users without any of these data authorisations, overrides withDataAuth
- whiteListElementGroups = When this hook is applied, only allow View Element Groups from this list, overrides viewToMerge
- blackListElementGroups = When this hook is applied, remove all View Element Groups from this list, overrides whiteListElementGroups and viewToMerge
- viewToMerge = the view to be merged into the current view.
- First the viewToMerge is merged into the user provided operation view.
- Then the white list of element groups is applied.
- Then the black list of element groups is applied.
- See Also:
GraphHook,Schema.visibilityProperty
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUpdateViewHook.Builder
-
Field Summary
Fields Modifier and Type Field Description static booleanADD_EXTRA_GROUPS_DEFAULT
-
Constructor Summary
Constructors Constructor Description UpdateViewHook()
-
Method Summary
-
-
-
Field Detail
-
ADD_EXTRA_GROUPS_DEFAULT
public static final boolean ADD_EXTRA_GROUPS_DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
preExecute
public void preExecute(OperationChain<?> opChain, Context context)
Description copied from interface:GraphHookCalled fromGraphbefore anOperationChainis executed.- Specified by:
preExecutein interfaceGraphHook- Parameters:
opChain- theOperationChainbeing executed. This can be modified/optimised in any GraphHook.context- theContextin which the operation chain was executed. The context also holds a reference to the original operation chain.
-
postExecute
public <T> T postExecute(T result, OperationChain<?> opChain, Context context)Description copied from interface:GraphHookCalled fromGraphafter anOperationChainis executed.- Specified by:
postExecutein interfaceGraphHook- Type Parameters:
T- the result type- Parameters:
result- the result from the operation chainopChain- theOperationChainthat was executed. This can be modified/optimised in any GraphHook.context- theContextin which the operation chain was executed. The context also holds a reference to the original operation chain.- Returns:
- result object
-
onFailure
public <T> T onFailure(T result, OperationChain<?> opChain, Context context, Exception e)Description copied from interface:GraphHookCalled fromGraphif an error occurs whilst executing theOperationChain.- Specified by:
onFailurein interfaceGraphHook- Type Parameters:
T- the result type- Parameters:
result- the result from the operation chain - likely to be null.opChain- theOperationChainthat was executed. This can be modified/optimised in any GraphHook.context- theContextin which the operation chain was executed. The context also holds a reference to the original operation chain.e- the exception- Returns:
- result object
-
setWithOpAuth
public UpdateViewHook setWithOpAuth(Set<String> withOpAuth)
-
setWithoutOpAuth
public UpdateViewHook setWithoutOpAuth(Set<String> withoutOpAuth)
-
setWithDataAuth
public UpdateViewHook setWithDataAuth(Set<String> withDataAuth)
-
setWithoutDataAuth
public UpdateViewHook setWithoutDataAuth(Set<String> withoutDataAuth)
-
setWhiteListElementGroups
public UpdateViewHook setWhiteListElementGroups(Set<String> whiteListElementGroups)
-
setBlackListElementGroups
public UpdateViewHook setBlackListElementGroups(Set<String> blackListElementGroups)
-
setViewToMerge
public UpdateViewHook setViewToMerge(View viewToMerge)
-
getViewToMerge
public View getViewToMerge()
-
isAddExtraGroups
public boolean isAddExtraGroups()
-
setAddExtraGroups
public UpdateViewHook setAddExtraGroups(boolean addExtraGroups)
-
-