public class ImportItem
extends java.lang.Object
Constructor and 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.
|
Modifier and Type | Method and 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.
|
public ImportItem(java.lang.String id)
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).
public ImportItem(java.lang.String id, ChangeType change, java.lang.String oldid) throws ConnectorException
id
- An ID string that identifies the item within the datasource.change
- Type of changeoldid
- Old id for the item, required if the change type is Renamed.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).
public java.lang.String getId()
public java.lang.String getOldId()
public ChangeType getChangeType()
public int getChangeCode()
public void setTimestamp(java.util.Date tstamp)
tstamp
- The date and time at which the item was last modified.public java.util.Date getTimestamp()
public void setChecksum(java.lang.String checksum)
checksum
- Checksum value for the item.
A checksum should be used if a timestamp is not available.
public java.lang.String getChecksum()
public void addValue(ImportValue value)
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).
public void addLink(ItemLink link)
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.
public java.util.Map<java.lang.String,java.lang.String> getProperties()
public void setProperty(java.lang.String key, java.lang.String value)
key
- Property namevalue
- Property value