Class 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
    • 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-aware message for error.
      • errorContexts

        public static java.lang.String[] errorContexts​(java.lang.String message)
      • created

        @Deprecated
        public void created​(PlatformMessage pm)
        Deprecated.
      • debug

        public void debug​(IngestDocument doc,
                          java.lang.String msg)
      • drop

        public void drop​(IngestDocument doc,
                         java.lang.String msg)
      • drop

        public void drop​(IngestDocument doc,
                         java.lang.Throwable t)
      • 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,
                         java.lang.String msg)
      • fail

        public void fail​(IngestDocument doc,
                         java.lang.Throwable e)
      • fail

        public void fail​(IngestDocument doc,
                         ErrorCode defaultErrorCode,
                         java.lang.Throwable e,
                         java.lang.String msg)
      • reset

        public void reset()
      • getClientId

        public java.util.UUID getClientId()
      • setClientId

        public void setClientId​(java.util.UUID value)
      • getComponent

        public java.lang.String getComponent()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • 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 a null in place of the document, the currentDocument is used. The currentDocument is cleared when the reset() method is called.

        A null parameter sets the current values to null.

        Parameters:
        currentDocument - may be null