Class ImportItem

java.lang.Object
ag.smaser.trip.cfw.ImportItem

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

    • ImportItem

      public ImportItem(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(String id, ChangeType change, 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 Details

    • getId

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

      public 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(Date tstamp)
      Set the timestamp for the item.
      Parameters:
      tstamp - The date and time at which the item was last modified.
    • getTimestamp

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

      public void setChecksum(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 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 Map<String,String> getProperties()
      Get dictionary with item properties.
      Returns:
      Property dictionary
    • setProperty

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