public abstract class CRUDOperationContext extends Object implements MetadataResolver, Serializable
| Constructor and Description |
|---|
CRUDOperationContext(CRUDOperation op,
String entityName,
Factory f,
List<DocCtx> docs,
Set<String> callerRoles,
HookManager hookManager,
ExecutionOptions eo)
This constructor is used to construct an operation context that is
derived from another existing context.
|
CRUDOperationContext(CRUDOperation op,
String entityName,
Factory f,
List<JsonDoc> docs,
ExecutionOptions eo)
This is the constructor used to represent the context of an operation
|
CRUDOperationContext(CRUDOperation op,
String entityName,
Factory f,
Set<String> callerRoles,
HookManager hookManager,
List<JsonDoc> docs,
ExecutionOptions eo) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCallerRoles(Set<String> roles)
Sets the caller roles
|
DocCtx |
addDocument(JsonDoc doc)
Adds a new document to the context
|
void |
addDocuments(Collection<JsonDoc> docs)
Adds new documents to the context
|
void |
addError(Error e)
Adds an error to the context
|
void |
addErrors(Collection<Error> l)
Adds errors to the context
|
Set<String> |
getCallerRoles()
Returns the roles the caller is in
|
CRUDOperation |
getCRUDOperation()
Returns the current operation
|
List<DataError> |
getDataErrors()
Returns all the data errors in the context.
|
List<DocCtx> |
getDocuments()
Returns the list of documents in the context
|
List<DocCtx> |
getDocumentsWithoutErrors()
Returns a list of documents with no errors
|
String |
getEntityName()
Returns the entity name in the context
|
List<Error> |
getErrors()
Returns the list of errors
|
ExecutionOptions |
getExecutionOptions()
Returns the execution options
|
Factory |
getFactory()
Returns the factory instance that controls the validator and CRUD
instances.
|
HookManager |
getHookManager()
The hookManager for this operation
|
List<JsonDoc> |
getOutputDocumentsWithoutErrors()
Returns a list of output documents with no errors
|
Object |
getProperty(String name)
Properties for the context
|
boolean |
hasDocumentErrors()
Returns if there are any document errors
|
boolean |
hasDocumentsWithoutErrors()
Returns if there are documents with no errors
|
boolean |
hasErrors()
Returns if there are any errors.
|
void |
reset(List<DocCtx> docList)
Resets the operation context.
|
void |
setDocuments(List<DocCtx> docs) |
void |
setProperty(String name,
Object value)
Properties for the context
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEntityMetadatapublic CRUDOperationContext(CRUDOperation op, String entityName, Factory f, List<JsonDoc> docs, ExecutionOptions eo)
public CRUDOperationContext(CRUDOperation op, String entityName, Factory f, Set<String> callerRoles, HookManager hookManager, List<JsonDoc> docs, ExecutionOptions eo)
public CRUDOperationContext(CRUDOperation op, String entityName, Factory f, List<DocCtx> docs, Set<String> callerRoles, HookManager hookManager, ExecutionOptions eo)
public ExecutionOptions getExecutionOptions()
public void reset(List<DocCtx> docList)
public String getEntityName()
public Factory getFactory()
public DocCtx addDocument(JsonDoc doc)
public void addDocuments(Collection<JsonDoc> docs)
public CRUDOperation getCRUDOperation()
public List<DocCtx> getDocumentsWithoutErrors()
public List<JsonDoc> getOutputDocumentsWithoutErrors()
public void addError(Error e)
public void addErrors(Collection<Error> l)
public List<DataError> getDataErrors()
public boolean hasDocumentErrors()
public boolean hasDocumentsWithoutErrors()
public boolean hasErrors()
public HookManager getHookManager()
Copyright © 2016. All rights reserved.