Class ImportItem


  • public class ImportItem
    extends java.lang.Object
    Represents a value imported by an import connector.
    • Constructor Summary

      Constructors 
      Constructor Description
      ImportItem​(java.lang.String id)
      Creates a new import item object as new or updated.
      ImportItem​(java.lang.String id, ChangeType change, java.lang.String oldid)
      Creates a new import item object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addLink​(ItemLink link)
      Add an link to another item.
      void addValue​(ImportValue value)
      Add a value to the item.
      int getChangeCode()
      Get the type of change that has been detected for the item as the numerical code it is represented by in the connectivity framework.
      ChangeType getChangeType()
      Get the type of change that has been detected for the item.
      java.lang.String getChecksum()
      Get the checksum for the item.
      java.lang.String getId()
      Returns the ID of the ite,
      java.lang.String getOldId()
      Get the old ID of the item (used only for renames).
      java.util.Map<java.lang.String,​java.lang.String> getProperties()
      Get dictionary with item properties.
      java.util.Date getTimestamp()
      Get the timestamp for the item.
      void setChecksum​(java.lang.String checksum)
      Set the checksum for the item.
      void setProperty​(java.lang.String key, java.lang.String value)
      Set a property for this import item.
      void setTimestamp​(java.util.Date tstamp)
      Set the timestamp for the item.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImportItem

        public ImportItem​(java.lang.String id)
        Creates a new import item object as new or updated.
        Parameters:
        id - An ID string that identifies the item within the datasource.

        The ID is typically a filename for a file on a file system or a URL for a web resource. The ID string must be of a permanent nature so that it can be retrieved from the data source at any time (after authentication, if required).

      • ImportItem

        public ImportItem​(java.lang.String id,
                          ChangeType change,
                          java.lang.String oldid)
                   throws ConnectorException
        Creates a new import item object.
        Parameters:
        id - An ID string that identifies the item within the datasource.
        change - Type of change
        oldid - Old id for the item, required if the change type is Renamed.
        Throws:
        ConnectorException -

        The ID is typically a filename for a file on a file system or a URL for a web resource. The ID string must be of a permanent nature so that it can be retrieved from the data source at any time (after authentication, if required).

    • Method Detail

      • getId

        public java.lang.String getId()
        Returns the ID of the ite,
        Returns:
        Item ID
      • getOldId

        public java.lang.String getOldId()
        Get the old ID of the item (used only for renames).
        Returns:
        Old ID for item
      • getChangeType

        public ChangeType getChangeType()
        Get the type of change that has been detected for the item.
        Returns:
        Change type
      • getChangeCode

        public int getChangeCode()
        Get the type of change that has been detected for the item as the numerical code it is represented by in the connectivity framework.
        Returns:
        Change code
      • setTimestamp

        public void setTimestamp​(java.util.Date tstamp)
        Set the timestamp for the item.
        Parameters:
        tstamp - The date and time at which the item was last modified.
      • getTimestamp

        public java.util.Date getTimestamp()
        Get the timestamp for the item.
        Returns:
        The date and time at which the item was last modified.
      • setChecksum

        public void setChecksum​(java.lang.String checksum)
        Set the checksum for the item.
        Parameters:
        checksum - Checksum value for the item.

        A checksum should be used if a timestamp is not available.

      • getChecksum

        public java.lang.String getChecksum()
        Get the checksum for the item.
        Returns:
        Item checksum.
      • addValue

        public void addValue​(ImportValue value)
        Add a value to the item.
        Parameters:
        value - ImportValue object to add

        Values are typically added to the item in the {$link ImportConnector#loadItem} method.

        A values may be file data, the body text of an email, an email attachment, a downloaded web page, the column value of a row in a relational database table, or whatever thing is being imported.

        Data sources like file systems or web sites typicaly have ImportItems that represent indiviual files or web pages. For such items, there will only be one ImportValue needed. For other data sources such as email servers, items represent indiviual emails, in which case there may be multiple values (e.g. one for the mail body text and one per attachement).

      • addLink

        public void addLink​(ItemLink link)
        Add an link to another item.
        Parameters:
        link - Link to add

        Links are typically added to the item in the {$link ImportConnector#loadItem} method.

        Links are informative references between items that can be used by applications for cross-reference or naviational purposes.

      • getProperties

        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Get dictionary with item properties.
        Returns:
        Property dictionary
      • setProperty

        public void setProperty​(java.lang.String key,
                                java.lang.String value)
        Set a property for this import item.
        Parameters:
        key - Property name
        value - Property value