Package com.attivio.sdk.esb
Class ProcessingResult
- java.lang.Object
-
- com.attivio.sdk.esb.ProcessingResult
-
- All Implemented Interfaces:
java.io.Serializable
public class ProcessingResult extends java.lang.Object implements java.io.Serializable
A ProcessingResult at a minimum contains the result Code of a document processing step. The ProcessingResult may contain an arbitrary status message. Additionally a ProcessingResult may contain new auxiliary messages (ProcessingResult#addMessage(PlatformMessage)
or new documents derived from the processing step (ProcessingResult#addDocument(IngestDocument)
.Generally a processing step will only set a Code however more complex stages such as those that process archive files may produce new documents and messages.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProcessingResult.Data
static class
ProcessingResult.DocData
static class
ProcessingResult.MsgData
-
Constructor Summary
Constructors Constructor Description ProcessingResult()
Convenience constructor.ProcessingResult(java.util.UUID clientId, java.lang.String component)
Creates a new Processing result.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(ProcessingResult.DocData dd)
void
addDocumentData(ProcessingResult.DocData dd)
void
addMessageData(ProcessingResult.MsgData md)
void
completed(PlatformMessage pm)
void
completed(IngestDocument doc)
void
created(PlatformMessage pm)
Deprecated.void
debug(IngestDocument doc, java.lang.String msg)
void
drop(PlatformMessage pm)
void
drop(PlatformMessage pm, ErrorCode errorCode, java.lang.String msg)
void
drop(PlatformMessage pm, ErrorCode errorCode, java.lang.Throwable t)
void
drop(PlatformMessage pm, ErrorCode errorCode, java.lang.Throwable t, java.lang.String msg)
void
drop(IngestDocument doc)
void
drop(IngestDocument doc, ErrorCode errorCode)
void
drop(IngestDocument doc, java.lang.String msg)
void
drop(IngestDocument doc, java.lang.Throwable t)
boolean
equals(java.lang.Object obj)
void
error(IngestDocument doc, java.lang.Throwable e, java.lang.String msg)
static java.lang.String[]
errorContexts(java.lang.String message)
void
fail(PlatformMessage pm, AttivioException ex)
void
fail(PlatformMessage pm, ErrorCode errorCode, java.lang.String msg)
void
fail(PlatformMessage pm, ErrorCode errorCode, java.lang.Throwable t, java.lang.String msg)
void
fail(PlatformMessage pm, java.lang.Throwable t)
void
fail(IngestDocument doc)
void
fail(IngestDocument doc, ErrorCode errorCode, java.lang.Throwable e)
void
fail(IngestDocument doc, ErrorCode defaultErrorCode, java.lang.Throwable e, java.lang.String msg)
void
fail(IngestDocument doc, java.lang.String msg)
void
fail(IngestDocument doc, java.lang.Throwable e)
static java.lang.String
formatError(ErrorCode error, java.lang.String message)
Format context-awaremessage
forerror
.java.util.UUID
getClientId()
ProcessingResultCode
getCode(java.lang.String docId)
Returns the worst code as determined by the ordinal of theProcessingResultCode
.java.lang.String
getComponent()
java.util.List<ProcessingResult.DocData>
getDocData()
java.util.List<ProcessingResult.MsgData>
getMsgData()
int
hashCode()
void
lost(IngestDocument doc)
void
merge(ProcessingResult pr)
void
notHandled(PlatformMessage pm)
void
notHandled(PlatformMessage pm, ErrorCode errorCode, java.lang.Throwable t)
void
notHandled(IngestDocument doc)
void
reset()
void
setClientId(java.util.UUID value)
void
setCurrentDocument(IngestDocument currentDocument)
Convenience function to set the current document context.java.lang.String
toString()
void
warn(PlatformMessage pm, ErrorCode errorCode, java.lang.Throwable t, java.lang.String msg)
void
warn(IngestDocument doc, ErrorCode errorCode, java.lang.String msg, java.lang.Object... args)
void
warn(IngestDocument doc, ErrorCode defaultErrorCode, java.lang.Throwable e, java.lang.String msg)
void
warn(IngestDocument doc, java.lang.Throwable e)
void
warn(IngestDocument doc, java.lang.Throwable e, java.lang.String msg, java.lang.Object... args)
-
-
-
Constructor Detail
-
ProcessingResult
public ProcessingResult()
Convenience constructor.This form should only be used when it will be merged with another result which has the clientId and component set.
-
ProcessingResult
public ProcessingResult(java.util.UUID clientId, java.lang.String component)
Creates a new Processing result. A processing result with no message or document actions will be treated as an OK result.
-
-
Method Detail
-
formatError
public static java.lang.String formatError(ErrorCode error, java.lang.String message)
Format context-awaremessage
forerror
.
-
errorContexts
public static java.lang.String[] errorContexts(java.lang.String message)
-
created
@Deprecated public void created(PlatformMessage pm)
Deprecated.
-
drop
public void drop(PlatformMessage pm)
-
drop
public void drop(PlatformMessage pm, ErrorCode errorCode, java.lang.Throwable t)
-
drop
public void drop(PlatformMessage pm, ErrorCode errorCode, java.lang.String msg)
-
drop
public void drop(PlatformMessage pm, ErrorCode errorCode, java.lang.Throwable t, java.lang.String msg)
-
fail
public void fail(PlatformMessage pm, ErrorCode errorCode, java.lang.String msg)
-
fail
public void fail(PlatformMessage pm, java.lang.Throwable t)
-
fail
public void fail(PlatformMessage pm, AttivioException ex)
-
fail
public void fail(PlatformMessage pm, ErrorCode errorCode, java.lang.Throwable t, java.lang.String msg)
-
warn
public void warn(PlatformMessage pm, ErrorCode errorCode, java.lang.Throwable t, java.lang.String msg)
-
notHandled
public void notHandled(PlatformMessage pm)
-
notHandled
public void notHandled(PlatformMessage pm, ErrorCode errorCode, java.lang.Throwable t)
-
completed
public void completed(PlatformMessage pm)
-
debug
public void debug(IngestDocument doc, java.lang.String msg)
-
drop
public void drop(IngestDocument doc)
-
drop
public void drop(IngestDocument doc, ErrorCode errorCode)
-
drop
public void drop(IngestDocument doc, java.lang.String msg)
-
lost
public void lost(IngestDocument doc)
-
drop
public void drop(IngestDocument doc, java.lang.Throwable t)
-
notHandled
public void notHandled(IngestDocument doc)
-
error
public void error(IngestDocument doc, java.lang.Throwable e, java.lang.String msg)
-
warn
public void warn(IngestDocument doc, java.lang.Throwable e)
-
warn
public void warn(IngestDocument doc, java.lang.Throwable e, java.lang.String msg, java.lang.Object... args)
-
warn
public void warn(IngestDocument doc, ErrorCode errorCode, java.lang.String msg, java.lang.Object... args)
-
warn
public void warn(IngestDocument doc, ErrorCode defaultErrorCode, java.lang.Throwable e, java.lang.String msg)
-
fail
public void fail(IngestDocument doc)
-
fail
public void fail(IngestDocument doc, java.lang.String msg)
-
fail
public void fail(IngestDocument doc, java.lang.Throwable e)
-
fail
public void fail(IngestDocument doc, ErrorCode errorCode, java.lang.Throwable e)
-
fail
public void fail(IngestDocument doc, ErrorCode defaultErrorCode, java.lang.Throwable e, java.lang.String msg)
-
completed
public void completed(IngestDocument doc)
-
reset
public void reset()
-
merge
public void merge(ProcessingResult pr)
-
addDocumentData
public void addDocumentData(ProcessingResult.DocData dd)
-
addMessageData
public void addMessageData(ProcessingResult.MsgData md)
-
getClientId
public java.util.UUID getClientId()
-
setClientId
public void setClientId(java.util.UUID value)
-
getComponent
public java.lang.String getComponent()
-
getMsgData
public java.util.List<ProcessingResult.MsgData> getMsgData()
-
getDocData
public java.util.List<ProcessingResult.DocData> getDocData()
-
getCode
public ProcessingResultCode getCode(java.lang.String docId)
Returns the worst code as determined by the ordinal of theProcessingResultCode
.- Parameters:
docId
-- Returns:
- the "worst" code for the
docId
in the results orProcessingResultCode.OK
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
add
public void add(ProcessingResult.DocData dd)
-
setCurrentDocument
public void setCurrentDocument(IngestDocument currentDocument)
Convenience function to set the current document context. This is useful in cases where the code providing feedback or warnings is not passed the document but perhaps a part of it such as a field. If any of the document oriented methods is passed anull
in place of the document, thecurrentDocument
is used. ThecurrentDocument
is cleared when thereset()
method is called.A
null
parameter sets the current values tonull
.- Parameters:
currentDocument
- may be null
-
-