Package emissary.core

Class BaseDataObject

    • Field Detail

      • logger

        protected static final org.slf4j.Logger logger
      • theData

        @Nullable
        protected byte[] theData
      • theFileName

        protected String theFileName
        Original name of the input data. Can only be set in the constructor of the DataObject. returned via the getFilename() method. Also used in constructing the shortName() of the document.
      • shortName

        protected String shortName
        Terminal portion of theFileName
      • internalId

        protected UUID internalId
        The internal identifier, generated for each constructed object
      • currentForm

        protected List<String> currentForm
        The currentForm is a stack of the itinerary items. The contents of the list are String and map to the dataType portion of the keys in the emissary.DirectoryPlace.
      • procError

        protected StringBuilder procError
        History of processing errors. Lines of text are accumulated from String and returned in-toto as a String.
      • history

        protected TransformHistory history
        A travelogue built up as the agent moves about. Appended to by the agent as it goes from place to place.
      • fontEncoding

        @Nullable
        protected String fontEncoding
        The last determined language(characterset) of the data.
      • parameters

        protected com.google.common.collect.LinkedListMultimap<String,​Object> parameters
        Dynamic facets or metadata attributes of the data
      • numChildren

        protected int numChildren
        If this file caused other agents to be sprouted, indicate how many
      • numSiblings

        protected int numSiblings
        If this file has siblings that were sprouted at the same time, this will indicate how many total siblings there are. This can be used to navigate among siblings without needing to refer to the parent.
      • birthOrder

        protected int birthOrder
        What child is this in the family order
      • multipartAlternative

        protected Map<String,​byte[]> multipartAlternative
        Hash of alternate views of the data String current form is the key, byte[] is the value
      • header

        @Nullable
        protected byte[] header
        Any header that goes along with the data
      • footer

        @Nullable
        protected byte[] footer
        Any footer that goes along with the data
      • headerEncoding

        @Nullable
        protected String headerEncoding
        If the header has some encoding scheme record it
      • classification

        @Nullable
        protected String classification
        Record the classification scheme for the document
      • brokenDocument

        @Nullable
        protected StringBuilder brokenDocument
        Keep track of if and how the document is broken so we can report on it later
      • emptyFileTypes

        protected String[] emptyFileTypes
      • priority

        protected int priority
        The integer priority of the data object. A lower number is higher priority.
      • creationTimestamp

        protected Instant creationTimestamp
        The timestamp for when the BaseDataObject was created. Used in data provenance tracking.
      • extractedRecords

        @Nullable
        protected List<IBaseDataObject> extractedRecords
        The extracted records, if any
      • outputable

        protected boolean outputable
        Check to see if this tree is able to be written out.
      • id

        protected String id
        The unique identifier of this object
      • transactionId

        protected String transactionId
        The identifier used to track the object through the system
      • seekableByteChannelFactory

        @Nullable
        protected SeekableByteChannelFactory seekableByteChannelFactory
        A factory to create channels for the referenced data.
    • Constructor Detail

      • BaseDataObject

        public BaseDataObject()
        Create an empty BaseDataObject.
      • BaseDataObject

        public BaseDataObject​(byte[] newData,
                              String name)
        Create a new BaseDataObject with byte array and name passed in. WARNING: this implementation uses the passed in array directly, no copy is made so the caller should not reuse the array.
        Parameters:
        newData - the bytes to hold
        name - the name of the data item
      • BaseDataObject

        public BaseDataObject​(byte[] newData,
                              String name,
                              @Nullable
                              String form)
        Create a new BaseDataObject with byte array, name, and initial form WARNING: this implementation uses the passed in array directly, no copy is made so the caller should not reuse the array.
        Parameters:
        newData - the bytes to hold
        name - the name of the data item
        form - the initial form of the data
      • BaseDataObject

        public BaseDataObject​(byte[] newData,
                              String name,
                              String form,
                              @Nullable
                              String fileType)
    • Method Detail

      • getDataState

        protected BaseDataObject.DataState getDataState()

        Determine what state we're in with respect to the byte[] of data vs a channel.

        Not exposed publicly as consumers should be moving to channels, meaning ultimately the states will be simply either a channel factory exists or does not exist.

        Consumers should not modify their behaviour based on the state of the BDO, if they're being modified to handle channels, they should only handle channels, not both channels and byte[].

        Returns:
        the BaseDataObject.DataState of this BDO
      • setHeader

        public void setHeader​(byte[] header)
        Set the header byte array WARNING: this implementation uses the passed in array directly, no copy is made so the caller should not reuse the array.
        Specified by:
        setHeader in interface IBaseDataObject
        Parameters:
        header - the byte array of header data
      • getHeaderEncoding

        public String getHeaderEncoding()
        Get the value of headerEncoding. Tells how to interpret the header information.
        Specified by:
        getHeaderEncoding in interface IBaseDataObject
        Returns:
        Value of headerEncoding.
      • setHeaderEncoding

        public void setHeaderEncoding​(String v)
        Set the value of headerEncoding for proper interpretation and processing later
        Specified by:
        setHeaderEncoding in interface IBaseDataObject
        Parameters:
        v - Value to assign to headerEncoding.
      • setFooter

        public void setFooter​(byte[] footer)
        Set the footer byte array WARNING: this implementation uses the passed in array directly, no copy is made so the caller should not reuse the array.
        Specified by:
        setFooter in interface IBaseDataObject
        Parameters:
        footer - byte array of footer data
      • setFilename

        public void setFilename​(String f)
        Set the filename
        Specified by:
        setFilename in interface IBaseDataObject
        Parameters:
        f - the new name of the data including path
      • setChannelFactory

        public void setChannelFactory​(SeekableByteChannelFactory sbcf)
        Set the byte channel factory using whichever implementation is providing access to the data. Setting this will null out theData
        Specified by:
        setChannelFactory in interface IBaseDataObject
        Parameters:
        sbcf - the new channel factory to set on this object
      • getChannelFactory

        @Nullable
        public SeekableByteChannelFactory getChannelFactory()
        Returns the seekable byte channel factory containing a reference to the data, or wraps the in-memory data on the BDO in a new factory.
        Specified by:
        getChannelFactory in interface IBaseDataObject
        Returns:
        the factory containing the data reference or the data wrapped in a new factory
      • newInputStream

        @Nullable
        public InputStream newInputStream()
        Returns a new InputStream to the data that this BaseDataObject contains.

        NOTE 1: Mutating the data elements of this IBaseDataObject while reading from the InputStream will have indeterminate results.

        NOTE 2: The calling code is responsible for closing the returned InputStream.

        Specified by:
        newInputStream in interface IBaseDataObject
        Returns:
        a new stream that reads the data that this object contains, or null if this object has no data.
      • data

        @Nullable
        public byte[] data()

        Return BaseDataObjects byte array OR as much as we can from the reference to the data up to MAX_BYTE_ARRAY_SIZE.

        Data returned from a backing Channel will be truncated at MAX_BYTE_ARRAY_SIZE. Using channel-related methods is now preferred to allow handling of larger objects

        WARNING: There is no way for the caller to know whether the data being returned is the direct array held in memory, or a copy of the data from a byte channel factory, so the returned byte array should be treated as live and not be modified.

        Specified by:
        data in interface IBaseDataObject
        Returns:
        the data as a byte array
        See Also:
        getChannelFactory()
      • setData

        public void setData​(@Nullable
                            byte[] newData)
        Description copied from interface: IBaseDataObject
        Set BaseDataObjects data to byte array passed in.
        Specified by:
        setData in interface IBaseDataObject
        Parameters:
        newData - byte array to set replacing any existing data
        See Also:
        setData(byte[], int, int)
      • setData

        public void setData​(@Nullable
                            byte[] newData,
                            int offset,
                            int length)

        Set new data on the BDO, using a range of the provided byte array. This will remove the reference to any byte channel factory that backs this BDO so be careful!

        Limited in size to 2^31. Use channel-based methods for larger data.

        Specified by:
        setData in interface IBaseDataObject
        Parameters:
        newData - containing the source of the new data
        offset - where to start copying from
        length - how much to copy
        See Also:
        setChannelFactory(SeekableByteChannelFactory)
      • hasContent

        public boolean hasContent()
                           throws IOException
        Checks if the data is defined with a non-zero length.
        Specified by:
        hasContent in interface IBaseDataObject
        Returns:
        if data is undefined or zero length.
        Throws:
        IOException
      • getChannelSize

        public long getChannelSize()
                            throws IOException
        Convenience method to get the size of the channel or byte array providing access to the data.
        Specified by:
        getChannelSize in interface IBaseDataObject
        Returns:
        the channel size
        Throws:
        IOException - if an error occurs with the underlying channel
      • shortName

        public String shortName()
        Description copied from interface: IBaseDataObject
        Returns the name of the file without the path with which the file will be written.
        Specified by:
        shortName in interface IBaseDataObject
        Returns:
        the short name of the file (no path)
      • currentForm

        public String currentForm()
        Description copied from interface: IBaseDataObject
        Return the current form of the data (top of the stack)
        Specified by:
        currentForm in interface IBaseDataObject
        Returns:
        string value of current form
      • currentFormAt

        public String currentFormAt​(int i)
        Description copied from interface: IBaseDataObject
        Return the current form at specified position of the list
        Specified by:
        currentFormAt in interface IBaseDataObject
        Parameters:
        i - The specified position
        Returns:
        String containing the form or empty string if illegal position
      • searchCurrentForm

        public int searchCurrentForm​(String value)
        Description copied from interface: IBaseDataObject
        Check to see if this value is already on the stack of itinerary items
        Specified by:
        searchCurrentForm in interface IBaseDataObject
        Parameters:
        value - the string to look for
        Returns:
        the position where it was found or -1
      • searchCurrentForm

        @Nullable
        public String searchCurrentForm​(Collection<String> values)
        Description copied from interface: IBaseDataObject
        Check to see one of these values is on the stack of itinerary items
        Specified by:
        searchCurrentForm in interface IBaseDataObject
        Parameters:
        values - the List of strings to look for
        Returns:
        the String that was found out of the list sent in or null
      • currentFormSize

        public int currentFormSize()
        Description copied from interface: IBaseDataObject
        Get the size of the itinerary stack
        Specified by:
        currentFormSize in interface IBaseDataObject
        Returns:
        size of form stack
      • replaceCurrentForm

        public void replaceCurrentForm​(@Nullable
                                       String form)
        Description copied from interface: IBaseDataObject
        Replace all current forms with specified
        Specified by:
        replaceCurrentForm in interface IBaseDataObject
        Parameters:
        form - the new current form or null if none desired
      • popCurrentForm

        @Nullable
        public String popCurrentForm()
        Remove a form from the head of the list
        Specified by:
        popCurrentForm in interface IBaseDataObject
        Returns:
        The value that was removed, or null if the list was empty.
      • deleteCurrentForm

        public int deleteCurrentForm​(String form)
        Description copied from interface: IBaseDataObject
        Remove a form where ever it appears in the stack
        Specified by:
        deleteCurrentForm in interface IBaseDataObject
        Parameters:
        form - the value to remove
        Returns:
        the number of elements removed from the stack
      • deleteCurrentFormAt

        public int deleteCurrentFormAt​(int i)
        Description copied from interface: IBaseDataObject
        Remove a form at the specified location of the itinerary stack
        Specified by:
        deleteCurrentFormAt in interface IBaseDataObject
        Parameters:
        i - the position to delete
        Returns:
        the new size of the itinerary stack
      • addCurrentFormAt

        public int addCurrentFormAt​(int i,
                                    String newForm)
        Description copied from interface: IBaseDataObject
        Add current form newForm at idx
        Specified by:
        addCurrentFormAt in interface IBaseDataObject
        Parameters:
        i - the position to do the insert
        newForm - the value to insert
        Returns:
        size of the new stack
      • enqueueCurrentForm

        public int enqueueCurrentForm​(String newForm)
        Description copied from interface: IBaseDataObject
        Add a form to the end of the list (the bottom of the stack)
        Specified by:
        enqueueCurrentForm in interface IBaseDataObject
        Parameters:
        newForm - the new value to add to the tail of the stack
        Returns:
        the new size of the itinerary stack
      • pushCurrentForm

        public int pushCurrentForm​(String newForm)
        Description copied from interface: IBaseDataObject
        Push a form onto the head of the list
        Specified by:
        pushCurrentForm in interface IBaseDataObject
        Parameters:
        newForm - the new value to push on the stack
        Returns:
        the new size of the itinerary stack
      • setCurrentForm

        public void setCurrentForm​(String newForm)
        Description copied from interface: IBaseDataObject
        Replaces the current form of the data with a new form Does a pop() followed by a push(newForm) to simulate what would happen in the old "one form at a time system"
        Specified by:
        setCurrentForm in interface IBaseDataObject
        Parameters:
        newForm - value of the the new form of the data
      • setCurrentForm

        public void setCurrentForm​(String newForm,
                                   boolean clearAllForms)
        Description copied from interface: IBaseDataObject
        Replaces the current form of the data with a form passed and potentially clears the entire form stack
        Specified by:
        setCurrentForm in interface IBaseDataObject
        Parameters:
        newForm - value of the the new form of the data
        clearAllForms - whether or not to clear the entire form stack
      • getAllCurrentForms

        public List<String> getAllCurrentForms()
        Description copied from interface: IBaseDataObject
        Return a clone the whole current form list Note this is not a reference to our private store
        Specified by:
        getAllCurrentForms in interface IBaseDataObject
        Returns:
        ordered list of current forms
      • pullFormToTop

        public void pullFormToTop​(String curForm)
        Description copied from interface: IBaseDataObject
        Move curForm to the top of the stack pushing everything above it down one slot
        Specified by:
        pullFormToTop in interface IBaseDataObject
        Parameters:
        curForm - the form to pull to the top
      • transformHistory

        public List<String> transformHistory​(boolean includeCoordinated)
        Description copied from interface: IBaseDataObject
        List of places the data object was carried to.
        Specified by:
        transformHistory in interface IBaseDataObject
        Parameters:
        includeCoordinated - include the places that were coordinated
        Returns:
        List of strings making up the history
      • appendTransformHistory

        public void appendTransformHistory​(String key,
                                           boolean coordinated)
        Description copied from interface: IBaseDataObject
        Appends the new key to the transform history. This is called by MobileAgent before moving to the new place. It usually adds the four-tuple of a place's key. Coordinated history keys are meant for informational purposes and have no bearing on the routing algorithm. It is important to list the places visited in coordination, but should not report as the last place visited.
        Specified by:
        appendTransformHistory in interface IBaseDataObject
        Parameters:
        key - the new value to append
        coordinated - true if history entries are for informational purposes only
        See Also:
        MobileAgent.agentControl(emissary.place.IServiceProviderPlace)
      • hasVisited

        public boolean hasVisited​(String pattern)
        Description copied from interface: IBaseDataObject
        Return true if the payload has been to a place matching the key passed in.
        Specified by:
        hasVisited in interface IBaseDataObject
        Parameters:
        pattern - the key pattern to match
      • beforeStart

        public boolean beforeStart()
        Description copied from interface: IBaseDataObject
        True if this payload hasn't had any processing yet Does not count parent processing as being for this payload
        Specified by:
        beforeStart in interface IBaseDataObject
        Returns:
        true if not yet started
      • hasParameter

        public boolean hasParameter​(String key)
        Description copied from interface: IBaseDataObject
        Determine if parameter is present
        Specified by:
        hasParameter in interface IBaseDataObject
        Parameters:
        key - name of metadata element to check
      • setParameter

        public void setParameter​(String key,
                                 Object val)
        Description copied from interface: IBaseDataObject
        Set a new parameter value, deleting an old one
        Specified by:
        setParameter in interface IBaseDataObject
        Parameters:
        key - the name of the element
        val - the value of the element
      • putParameter

        public void putParameter​(String key,
                                 Object val)
        Description copied from interface: IBaseDataObject
        Put a new metadata element into the map
        Specified by:
        putParameter in interface IBaseDataObject
        Parameters:
        key - the name of the element
        val - the value of the element
      • putParameters

        public void putParameters​(Map<? extends String,​? extends Object> m)
        Put a collection of parameters into the metadata map, keeping both old and new values
        Specified by:
        putParameters in interface IBaseDataObject
        Parameters:
        m - the map of new parameters
      • putParameters

        public void putParameters​(Map<? extends String,​? extends Object> m,
                                  IBaseDataObject.MergePolicy policy)
        Merge in new parameters using the specified policy to determine whether to keep all values, unique values, or prefer existing values
        Specified by:
        putParameters in interface IBaseDataObject
        Parameters:
        m - map of new parameters
        policy - the merge policy
      • putUniqueParameters

        public void putUniqueParameters​(Map<? extends String,​? extends Object> m)
        Put a collection of parameters into the metadata map, adding only distinct k/v pairs
        Specified by:
        putUniqueParameters in interface IBaseDataObject
        Parameters:
        m - the map of new parameters
      • mergeParameters

        public void mergeParameters​(Map<? extends String,​? extends Object> m)
        Merge in parameters keeping existing keys unchanged
        Specified by:
        mergeParameters in interface IBaseDataObject
        Parameters:
        m - map of new parameters to consider
      • getParameter

        @Nullable
        public List<Object> getParameter​(String key)
        Description copied from interface: IBaseDataObject
        Retrieve a specified metadata element
        Specified by:
        getParameter in interface IBaseDataObject
        Parameters:
        key - name of the metadata element
        Returns:
        the value or null if no such element
      • appendParameter

        public void appendParameter​(String key,
                                    CharSequence value)
        Description copied from interface: IBaseDataObject
        Append data to the specified metadata element
        Specified by:
        appendParameter in interface IBaseDataObject
        Parameters:
        key - name of the metadata element
        value - the value to append
      • appendUniqueParameter

        public boolean appendUniqueParameter​(String key,
                                             CharSequence value)
        Append data to the specified metadata element if it doesn't already exist If you expect to append a lot if things this way, this method might not have the performance characteristics that you expect. You can build a set and externally and append the values after they are uniqued.
        Specified by:
        appendUniqueParameter in interface IBaseDataObject
        Parameters:
        key - name of the metadata element
        value - the value to append
        Returns:
        true if the item is added, false if it already exists
      • getParameterAsString

        @Nullable
        public String getParameterAsString​(String key)
        Description copied from interface: IBaseDataObject
        Retrieve the metadata value identified by key where the element is converted to a string
        Specified by:
        getParameterAsString in interface IBaseDataObject
        Parameters:
        key - name of the metadata element
        Returns:
        parameter converted to strings
      • getParameters

        public Map<String,​Collection<Object>> getParameters()
        Retrieve all the metadata elements of this object This method returns possibly mapped metadata element names
        Specified by:
        getParameters in interface IBaseDataObject
        Returns:
        map of metadata elements
      • deleteParameter

        public List<Object> deleteParameter​(String key)
        Description copied from interface: IBaseDataObject
        Delete the specified metadata element named
        Specified by:
        deleteParameter in interface IBaseDataObject
        Parameters:
        key - the name of the metadata item to delete
        Returns:
        the object deleted of null if none
      • setNumChildren

        public void setNumChildren​(int num)
        Description copied from interface: IBaseDataObject
        Sets the number of children that the current agents spawned.
        Specified by:
        setNumChildren in interface IBaseDataObject
        Parameters:
        num - the number value to set
      • setNumSiblings

        public void setNumSiblings​(int num)
        Description copied from interface: IBaseDataObject
        Sets the number of siblings for this data object.
        Specified by:
        setNumSiblings in interface IBaseDataObject
        Parameters:
        num - the number of siblings to set
      • setBirthOrder

        public void setBirthOrder​(int num)
        Description copied from interface: IBaseDataObject
        What number is this sibling in the family
        Specified by:
        setBirthOrder in interface IBaseDataObject
        Parameters:
        num - the birthorder number value to set
      • getNumChildren

        public int getNumChildren()
        Description copied from interface: IBaseDataObject
        Gets the number of children that have this as a parent
        Specified by:
        getNumChildren in interface IBaseDataObject
        Returns:
        the number of children that have this parent
      • getNumSiblings

        public int getNumSiblings()
        Description copied from interface: IBaseDataObject
        Get the number of siblings
        Specified by:
        getNumSiblings in interface IBaseDataObject
        Returns:
        the number of siblings including this one
      • getBirthOrder

        public int getBirthOrder()
        Description copied from interface: IBaseDataObject
        Get this sibling number, count from one.
        Specified by:
        getBirthOrder in interface IBaseDataObject
        Returns:
        the birth order of this sibling
      • header

        public byte[] header()
        Return a reference to the header byte array. WARNING: this implementation returns the actual array directly, no copy is made so the caller must be aware that modifications to the returned array are live.
        Specified by:
        header in interface IBaseDataObject
        Returns:
        byte array of header information or null if none
      • footer

        public byte[] footer()
        Return a reference to the footer byte array. WARNING: this implementation returns the actual array directly, no copy is made so the caller must be aware that modifications to the returned array are live.
        Specified by:
        footer in interface IBaseDataObject
        Returns:
        byte array of footer data or null if none
      • setFontEncoding

        public void setFontEncoding​(String fe)
        Description copied from interface: IBaseDataObject
        Set the font encoding string
        Specified by:
        setFontEncoding in interface IBaseDataObject
        Parameters:
        fe - string name of font encoding for the data
      • setFileType

        public void setFileType​(@Nullable
                                String v)
        Put the FILETYPE parameter, null to clear
        Specified by:
        setFileType in interface IBaseDataObject
        Parameters:
        v - the value to store or null
      • setFileTypeIfEmpty

        @Deprecated
        public boolean setFileTypeIfEmpty​(String v,
                                          String[] empties)
        Deprecated.
        Description copied from interface: IBaseDataObject
        Set FILETYPE parameter iff empty.
        Specified by:
        setFileTypeIfEmpty in interface IBaseDataObject
        Parameters:
        v - the value of the filetype to set
        empties - the list of things caller considers equal to being empty
        Returns:
        true if it was empty and set
      • setFileTypeIfEmpty

        public boolean setFileTypeIfEmpty​(String v)
        Description copied from interface: IBaseDataObject
        Set FILETYPE parameter iff empty using the built-in definition of empty
        Specified by:
        setFileTypeIfEmpty in interface IBaseDataObject
        Parameters:
        v - the value of the filetype to set
        Returns:
        true if it was empty and set
      • isFileTypeEmpty

        public boolean isFileTypeEmpty()
        Description copied from interface: IBaseDataObject
        Return true if the file type is null or in one of the "don't care" set
        Specified by:
        isFileTypeEmpty in interface IBaseDataObject
      • isFileTypeEmpty

        protected boolean isFileTypeEmpty​(@Nullable
                                          String[] empties)
        Return true if the file type is null or in one of the specified set of empties
        Parameters:
        empties - a list of types that count as empty
      • getNumAlternateViews

        public int getNumAlternateViews()
        Description copied from interface: IBaseDataObject
        Disclose how many multipart alternative views of the data exist
        Specified by:
        getNumAlternateViews in interface IBaseDataObject
        Returns:
        count of alternate views
      • getAlternateView

        public byte[] getAlternateView​(String s)
        Return a specified multipart alternative view of the data WARNING: this implementation returns the actual array directly, no copy is made so the caller must be aware that modifications to the returned array are live.
        Specified by:
        getAlternateView in interface IBaseDataObject
        Parameters:
        s - the name of the view to retrieve
        Returns:
        byte array of alternate view data or null if none
      • appendAlternateView

        public void appendAlternateView​(String name,
                                        byte[] data)
        Description copied from interface: IBaseDataObject
        Append the specified data to the alternate view
        Specified by:
        appendAlternateView in interface IBaseDataObject
        Parameters:
        name - the name of the new view
        data - the byte array of data for the view
      • appendAlternateView

        public void appendAlternateView​(String name,
                                        byte[] data,
                                        int offset,
                                        int length)
        Description copied from interface: IBaseDataObject
        Append to a multipart alternative view of the data
        Specified by:
        appendAlternateView in interface IBaseDataObject
        Parameters:
        name - the name of the view
        data - the byte array conatining data for the view
        offset - index of the first byte to use
        length - number of bytes to use
      • getAlternateViewBuffer

        @Nullable
        @Deprecated
        public ByteBuffer getAlternateViewBuffer​(String s)
        Deprecated.
        Return a specified multipart alternative view of the data in a buffer
        Specified by:
        getAlternateViewBuffer in interface IBaseDataObject
        Parameters:
        s - the name of the view to retrieve
        Returns:
        buffer of alternate view data or null if none
      • addAlternateView

        public void addAlternateView​(String name,
                                     @Nullable
                                     byte[] data)
        Add a multipart alternative view of the data WARNING: this implementation returns the actual array directly, no copy is made so the caller must be aware that modifications to the returned array are live.
        Specified by:
        addAlternateView in interface IBaseDataObject
        Parameters:
        name - the name of the new view
        data - the byte array of data for the view
      • addAlternateView

        public void addAlternateView​(String name,
                                     @Nullable
                                     byte[] data,
                                     int offset,
                                     int length)
        Description copied from interface: IBaseDataObject
        Add a multipart alternative view of the data
        Specified by:
        addAlternateView in interface IBaseDataObject
        Parameters:
        name - the name of the new view
        data - the byte array conatining data for the view
        offset - index of the first byte to use
        length - number of bytes to use
      • getAlternateViewNames

        public Set<String> getAlternateViewNames()
        Get the set of alt view names for new foreach loops
        Specified by:
        getAlternateViewNames in interface IBaseDataObject
        Returns:
        an ordered set of alternate view names
      • getAlternateViews

        public Map<String,​byte[]> getAlternateViews()
        Get the alternate view map. WARNING: this implementation returns the actual map directly, no copy is made so the caller must be aware that modifications to the returned map are live.
        Specified by:
        getAlternateViews in interface IBaseDataObject
        Returns:
        an map of alternate views ordered by name, key = String, value = byte[]
      • isBroken

        public boolean isBroken()
        Description copied from interface: IBaseDataObject
        Test for broken document
        Specified by:
        isBroken in interface IBaseDataObject
        Returns:
        true if broken
      • setBroken

        public void setBroken​(@Nullable
                              String v)
        Description copied from interface: IBaseDataObject
        Set brokenness for document
        Specified by:
        setBroken in interface IBaseDataObject
        Parameters:
        v - the message to record
      • getBroken

        @Nullable
        public String getBroken()
        Description copied from interface: IBaseDataObject
        Get brokenness indicator message
        Specified by:
        getBroken in interface IBaseDataObject
        Returns:
        string message of what is broken
      • setClassification

        public void setClassification​(String classification)
        Description copied from interface: IBaseDataObject
        Set the classification.
        Specified by:
        setClassification in interface IBaseDataObject
        Parameters:
        classification - string classification value
      • getPriority

        public int getPriority()
        Description copied from interface: IBaseDataObject
        Get data object's priority.
        Specified by:
        getPriority in interface IBaseDataObject
        Returns:
        int priority (lower the number, higher the priority).
      • setPriority

        public void setPriority​(int priority)
        Description copied from interface: IBaseDataObject
        Set the data object's priority, typically based on input dir/file priority.
        Specified by:
        setPriority in interface IBaseDataObject
        Parameters:
        priority - int (lower the number, higher the priority).
      • getCreationTimestamp

        public Instant getCreationTimestamp()
        Description copied from interface: IBaseDataObject
        Get the timestamp for when the object was created. This attribute will be used for data provenance.
        Specified by:
        getCreationTimestamp in interface IBaseDataObject
        Returns:
        date - the timestamp the object was created
      • setCreationTimestamp

        public void setCreationTimestamp​(Instant creationTimestamp)
        The creation timestamp is part of the provenance of the event represented by this instance. It is normally set from the constructor
        Specified by:
        setCreationTimestamp in interface IBaseDataObject
        Parameters:
        creationTimestamp - when this item was created
      • hasExtractedRecords

        public boolean hasExtractedRecords()
        Description copied from interface: IBaseDataObject
        Determine if this object has extracted records.
        Specified by:
        hasExtractedRecords in interface IBaseDataObject
        Returns:
        true if this object has extracted records.
      • getInternalId

        public UUID getInternalId()
        Description copied from interface: IBaseDataObject
        Returns the internally generated identifier used to track the object
        Specified by:
        getInternalId in interface IBaseDataObject
        Returns:
        a String representing the internal ID
      • isOutputable

        public boolean isOutputable()
        Description copied from interface: IBaseDataObject
        Test if tree is outputable
        Specified by:
        isOutputable in interface IBaseDataObject
        Returns:
        true if this tree is not able to be output, false otherwise
      • setOutputable

        public void setOutputable​(boolean outputable)
        Description copied from interface: IBaseDataObject
        Set whether or not the tree is able to be written out
        Specified by:
        setOutputable in interface IBaseDataObject
        Parameters:
        outputable - true if this tree is not able to be output, false otherwise
      • setId

        public void setId​(String id)
        Description copied from interface: IBaseDataObject
        Set the unique identifier of the IBaseDataObject
        Specified by:
        setId in interface IBaseDataObject
        Parameters:
        id - the unique identifier of the IBaseDataObject
      • setTransactionId

        public void setTransactionId​(String transactionId)
        Description copied from interface: IBaseDataObject
        Set the unique identifier of the transaction
        Specified by:
        setTransactionId in interface IBaseDataObject
        Parameters:
        transactionId - the unique identifier of the transaction
      • getTld

        public IBaseDataObject getTld()
        Description copied from interface: IBaseDataObject
        Return the top level document or null if there is none for this IBaseDataObject
        Specified by:
        getTld in interface IBaseDataObject
        Returns:
        The TLD IBaseDataObject