public class OperationResult extends Object implements Serializable, DebugDumpable, Cloneable
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT_IMPLEMENTATION_CLASS |
static String |
CONTEXT_ITEM |
static String |
CONTEXT_OBJECT |
static String |
CONTEXT_OID |
static String |
CONTEXT_PROGRESS |
static String |
CONTEXT_RESOURCE |
static String |
CONTEXT_TASK |
static String |
PARAM_OBJECT |
static String |
PARAM_OID |
static String |
PARAM_OPTIONS |
static String |
PARAM_QUERY |
static String |
PARAM_TASK |
static String |
PARAM_TYPE |
static String |
RETURN_BACKGROUND_TASK_OID |
static String |
RETURN_COUNT |
Constructor and Description |
---|
OperationResult(String operation) |
OperationResult(String operation,
long token,
String messageCode,
String message) |
OperationResult(String operation,
Map<String,Serializable> params,
Map<String,Serializable> context,
Map<String,Serializable> returns,
OperationResultStatus status,
long token,
String messageCode,
String message,
String localizationMessage,
List<Serializable> localizationArguments,
Throwable cause,
List<OperationResult> subresults) |
OperationResult(String operation,
Map<String,Serializable> params,
OperationResultStatus status,
long token,
String messageCode,
String message) |
OperationResult(String operation,
Map<String,Serializable> params,
OperationResultStatus status,
long token,
String messageCode,
String message,
List<OperationResult> subresults) |
OperationResult(String operation,
Map<String,Serializable> params,
OperationResultStatus status,
long token,
String messageCode,
String message,
String localizationMessage,
List<Serializable> localizationArguments,
Throwable cause,
List<OperationResult> subresults) |
OperationResult(String operation,
Map<String,Serializable> params,
OperationResultStatus status,
long token,
String messageCode,
String message,
String localizationMessage,
Throwable cause,
List<OperationResult> subresults) |
OperationResult(String operation,
OperationResultStatus status,
long token,
String messageCode,
String message) |
OperationResult(String operation,
OperationResultStatus status,
long token,
String messageCode,
String message,
Throwable cause) |
OperationResult(String operation,
OperationResultStatus status,
String message) |
OperationResult(String operation,
OperationResultStatus status,
String messageCode,
String message) |
OperationResult(String operation,
String messageCode,
String message) |
Modifier and Type | Method and Description |
---|---|
void |
addArbitraryCollectionAsParam(String paramName,
Collection values) |
void |
addArbitraryObjectAsParam(String paramName,
Object paramValue) |
void |
addCollectionOfSerializablesAsParam(String paramName,
Collection<? extends Serializable> paramValue) |
void |
addCollectionOfSerializablesAsReturn(String name,
Collection<? extends Serializable> value) |
void |
addContext(String contextName,
Serializable value) |
void |
addParam(String paramName,
Serializable paramValue) |
void |
addParams(String[] names,
Serializable... objects) |
void |
addReturn(String returnName,
Serializable value) |
void |
addSubresult(OperationResult subresult) |
void |
appendDetail(String detailLine) |
void |
cleanupResult()
Removes all the successful minor results.
|
void |
cleanupResult(Throwable e)
Removes all the successful minor results.
|
OperationResult |
clone() |
void |
computeStatus()
Computes operation result status based on subtask status.
|
void |
computeStatus(String errorMessage)
Computes operation result status based on subtask status and sets an
error message if the status is FATAL_ERROR.
|
void |
computeStatus(String errorMessage,
String warnMessage) |
void |
computeStatusComposite()
Used when the result contains several composite sub-result that are of equivalent meaning.
|
void |
computeStatusIfUnknown() |
OperationResult |
createMinorSubresult(String operation) |
static OperationResult |
createOperationResult(OperationResultType result) |
OperationResultType |
createOperationResultType() |
OperationResult |
createSubresult(String operation) |
String |
debugDump()
Show the content of the object intended for diagnostics by system administrator.
|
String |
debugDump(int indent) |
String |
dump(boolean withStack) |
OperationResult |
findSubresult(String operation) |
List<OperationResult> |
findSubresults(String operation) |
String |
getBackgroundTaskOid() |
Throwable |
getCause() |
OperationResultStatus |
getComputeStatus() |
Map<String,Serializable> |
getContext() |
<T> T |
getContext(Class<T> type,
String contextName) |
int |
getCount() |
List<String> |
getDetail() |
int |
getHiddenRecordsCount() |
OperationResult |
getLastSubresult() |
OperationResultStatus |
getLastSubresultStatus() |
List<Serializable> |
getLocalizationArguments() |
String |
getLocalizationMessage() |
String |
getMessage() |
String |
getMessageCode()
Contains mesage code based on module error catalog.
|
String |
getOperation()
Contains operation name.
|
Map<String,Serializable> |
getParams()
Method returns
Map with operation parameters. |
Serializable |
getReturn(String returnName) |
Map<String,Serializable> |
getReturns() |
OperationResultStatus |
getStatus()
Contains operation status as defined in
OperationResultStatus |
List<OperationResult> |
getSubresults()
Method returns list of operation subresults @{link
OperationResult . |
long |
getToken() |
boolean |
hasUnknownStatus()
Returns true if result status is UNKNOWN or any of the subresult status
is unknown (recursive).
|
void |
incrementCount() |
boolean |
isAcceptable()
Returns true if the result is acceptable for further processing.
|
boolean |
isEmpty() |
boolean |
isError() |
boolean |
isFatalError() |
boolean |
isHandledError() |
boolean |
isInProgress() |
boolean |
isNotApplicable() |
boolean |
isPartialError() |
boolean |
isSuccess()
Returns true if the result is success.
|
boolean |
isSummarizeErrors() |
boolean |
isSummarizePartialErrors() |
boolean |
isSummarizeSuccesses() |
boolean |
isUnknown() |
boolean |
isWarning() |
void |
muteError()
If the operation is an error then it will switch the status to EXPECTED_ERROR.
|
void |
muteLastSubresultError() |
void |
recomputeStatus() |
void |
recomputeStatus(String message) |
void |
recomputeStatus(String errorMessage,
String warningMessage) |
void |
record(CommonException exception)
Records result from a common exception type.
|
void |
recordFatalError(String message) |
void |
recordFatalError(String message,
Throwable cause) |
void |
recordFatalError(Throwable cause) |
void |
recordHandledError(String message) |
void |
recordHandledError(String message,
Throwable cause) |
void |
recordHandledError(Throwable cause) |
void |
recordInProgress() |
void |
recordNotApplicableIfUnknown() |
void |
recordPartialError(String message) |
void |
recordPartialError(String message,
Throwable cause) |
void |
recordPartialError(Throwable cause) |
void |
recordStatus(OperationResultStatus status,
String message) |
void |
recordStatus(OperationResultStatus status,
String message,
Throwable cause) |
void |
recordStatus(OperationResultStatus status,
Throwable cause) |
void |
recordSuccess() |
void |
recordSuccessIfUnknown() |
void |
recordUnknown() |
void |
recordWarning(String message) |
void |
recordWarning(String message,
Throwable cause) |
void |
recordWarning(Throwable cause) |
void |
removeLastSubresult() |
boolean |
representsHiddenRecords() |
void |
setBackgroundTaskOid(String oid) |
void |
setCount(int count) |
void |
setErrorsHandled()
Set all error status in this result and all subresults as handled.
|
void |
setHiddenRecordsCount(int hiddenRecordsCount) |
void |
setMessage(String message) |
void |
setStatus(OperationResultStatus status) |
void |
setSummarizeErrors(boolean summarizeErrors) |
void |
setSummarizePartialErrors(boolean summarizePartialErrors) |
void |
setSummarizeSuccesses(boolean summarizeSuccesses) |
void |
summarize() |
void |
summarize(boolean alsoSubresults) |
String |
toString() |
public static final String CONTEXT_IMPLEMENTATION_CLASS
public static final String CONTEXT_PROGRESS
public static final String CONTEXT_OID
public static final String CONTEXT_OBJECT
public static final String CONTEXT_ITEM
public static final String CONTEXT_TASK
public static final String CONTEXT_RESOURCE
public static final String PARAM_OID
public static final String PARAM_TYPE
public static final String PARAM_OPTIONS
public static final String PARAM_TASK
public static final String PARAM_OBJECT
public static final String PARAM_QUERY
public static final String RETURN_COUNT
public static final String RETURN_BACKGROUND_TASK_OID
public OperationResult(String operation)
public OperationResult(String operation, long token, String messageCode, String message)
public OperationResult(String operation, OperationResultStatus status, String message)
public OperationResult(String operation, OperationResultStatus status, String messageCode, String message)
public OperationResult(String operation, OperationResultStatus status, long token, String messageCode, String message)
public OperationResult(String operation, OperationResultStatus status, long token, String messageCode, String message, Throwable cause)
public OperationResult(String operation, Map<String,Serializable> params, OperationResultStatus status, long token, String messageCode, String message)
public OperationResult(String operation, Map<String,Serializable> params, OperationResultStatus status, long token, String messageCode, String message, List<OperationResult> subresults)
public OperationResult(String operation, Map<String,Serializable> params, OperationResultStatus status, long token, String messageCode, String message, String localizationMessage, Throwable cause, List<OperationResult> subresults)
public OperationResult(String operation, Map<String,Serializable> params, OperationResultStatus status, long token, String messageCode, String message, String localizationMessage, List<Serializable> localizationArguments, Throwable cause, List<OperationResult> subresults)
public OperationResult(String operation, Map<String,Serializable> params, Map<String,Serializable> context, Map<String,Serializable> returns, OperationResultStatus status, long token, String messageCode, String message, String localizationMessage, List<Serializable> localizationArguments, Throwable cause, List<OperationResult> subresults)
public OperationResult createSubresult(String operation)
public OperationResult createMinorSubresult(String operation)
public String getOperation()
String
constant in module interface with description and possible parameters. It
can be used for further processing. It will be used as key for
translation in admin-gui.public int getCount()
public void setCount(int count)
public void incrementCount()
public int getHiddenRecordsCount()
public void setHiddenRecordsCount(int hiddenRecordsCount)
public boolean representsHiddenRecords()
public boolean isSummarizeErrors()
public void setSummarizeErrors(boolean summarizeErrors)
public boolean isSummarizePartialErrors()
public void setSummarizePartialErrors(boolean summarizePartialErrors)
public boolean isSummarizeSuccesses()
public void setSummarizeSuccesses(boolean summarizeSuccesses)
public boolean isEmpty()
public List<OperationResult> getSubresults()
OperationResult
.public OperationResult getLastSubresult()
public void removeLastSubresult()
public OperationResultStatus getLastSubresultStatus()
public void addSubresult(OperationResult subresult)
public OperationResult findSubresult(String operation)
public List<OperationResult> findSubresults(String operation)
public OperationResultStatus getStatus()
OperationResultStatus
public void setStatus(OperationResultStatus status)
public boolean isSuccess()
public boolean isWarning()
public boolean isAcceptable()
public boolean isUnknown()
public boolean isInProgress()
public boolean isError()
public boolean isFatalError()
public boolean isPartialError()
public boolean isHandledError()
public boolean isNotApplicable()
public void setErrorsHandled()
public void computeStatus(String errorMessage)
errorMessage
- error messagepublic void computeStatus()
public void computeStatusComposite()
public OperationResultStatus getComputeStatus()
public void computeStatusIfUnknown()
public void recomputeStatus()
public void recomputeStatus(String message)
public void recordSuccessIfUnknown()
public void recordNotApplicableIfUnknown()
public Map<String,Serializable> getParams()
Map
with operation parameters. Parameters keys are
described in module interface for every operation.public void addParam(String paramName, Serializable paramValue)
public void addArbitraryObjectAsParam(String paramName, Object paramValue)
public void addCollectionOfSerializablesAsParam(String paramName, Collection<? extends Serializable> paramValue)
public void addCollectionOfSerializablesAsReturn(String name, Collection<? extends Serializable> value)
public void addArbitraryCollectionAsParam(String paramName, Collection values)
public void addParams(String[] names, Serializable... objects)
public Map<String,Serializable> getContext()
public void addContext(String contextName, Serializable value)
public Map<String,Serializable> getReturns()
public void addReturn(String returnName, Serializable value)
public Serializable getReturn(String returnName)
public long getToken()
public String getMessageCode()
public String getMessage()
public void setMessage(String message)
public String getLocalizationMessage()
public List<Serializable> getLocalizationArguments()
public Throwable getCause()
public void recordSuccess()
public void recordInProgress()
public void recordUnknown()
public void recordFatalError(Throwable cause)
public void muteError()
public void muteLastSubresultError()
public void recordPartialError(Throwable cause)
public void recordWarning(Throwable cause)
public void recordStatus(OperationResultStatus status, Throwable cause)
public void recordHandledError(String message)
public void recordHandledError(Throwable cause)
public void recordStatus(OperationResultStatus status, String message, Throwable cause)
public void recordFatalError(String message)
public void recordPartialError(String message)
public void recordWarning(String message)
public void record(CommonException exception)
exception
- common exceptionpublic void recordStatus(OperationResultStatus status, String message)
public boolean hasUnknownStatus()
public void appendDetail(String detailLine)
public static OperationResult createOperationResult(OperationResultType result)
public OperationResultType createOperationResultType()
public void summarize()
public void summarize(boolean alsoSubresults)
public void cleanupResult()
public void cleanupResult(Throwable e)
public String debugDump()
DebugDumpable
debugDump
in interface DebugDumpable
public String debugDump(int indent)
debugDump
in interface DebugDumpable
public String dump(boolean withStack)
public void setBackgroundTaskOid(String oid)
public String getBackgroundTaskOid()
public OperationResult clone()
Copyright © 2016 Evolveum. All rights reserved.