SMILA 1.0 API documentation

org.eclipse.smila.datamodel
Interface Record

All Known Implementing Classes:
RecordImpl

public interface Record

SMILA record interface. This is the main object that describes entities that are created and processed in the system.

Author:
jschumacher

Field Summary
static java.lang.String RECORD_ID
          key for the record id in metadata.
static java.lang.String SOURCE
          key for the data source in metadata.
 
Method Summary
 int attachmentSize()
          get number of attachments.
 Attachment getAttachment(java.lang.String name)
          get attachment value with the specified name.
 byte[] getAttachmentAsBytes(java.lang.String name)
          get attachment value for the specified name.
 java.util.Iterator<java.lang.String> getAttachmentNames()
          Get iterator on names of attachments of this record.
 DataFactory getFactory()
          get record factory to use for adding objects to this record.
 java.lang.String getId()
          Get the ID of this record.
 AnyMap getMetadata()
          Get the metadata of this record.
 java.lang.String getSource()
          Get the data source of this record.
 boolean hasAttachment(java.lang.String name)
          check if this record has an attachment of the specified name.
 boolean hasAttachments()
          check if this record has attachments.
 void removeAttachment(java.lang.String name)
          remove attachment for specified name.
 void removeAttachments()
          remove attachments.
 void setAttachment(Attachment attachment)
          set attachment.
 void setAttachment(java.lang.String name, byte[] attachment)
          set attachment content for the specified name.
 void setId(java.lang.String id)
          Set the ID of this record.
 void setSource(java.lang.String source)
          Set the data source of this record.
 

Field Detail

RECORD_ID

static final java.lang.String RECORD_ID
key for the record id in metadata.

See Also:
Constant Field Values

SOURCE

static final java.lang.String SOURCE
key for the data source in metadata.

See Also:
Constant Field Values
Method Detail

getFactory

DataFactory getFactory()
get record factory to use for adding objects to this record.

Returns:
record factory for this record.

getId

java.lang.String getId()
Get the ID of this record.

Returns:
record ID

setId

void setId(java.lang.String id)
Set the ID of this record.

Parameters:
id - new record ID

getSource

java.lang.String getSource()
Get the data source of this record.

Returns:
data source

setSource

void setSource(java.lang.String source)
Set the data source of this record.

Parameters:
source - data source

getMetadata

AnyMap getMetadata()
Get the metadata of this record. Contains attributes and other properties of this record.

Returns:
the metadata describing this record.

hasAttachments

boolean hasAttachments()
check if this record has attachments.

Returns:
true if this record has attachments, else false.

hasAttachment

boolean hasAttachment(java.lang.String name)
check if this record has an attachment of the specified name.

Parameters:
name - attachment name.
Returns:
true if this record has an attachment for this name, else false.

attachmentSize

int attachmentSize()
get number of attachments.

Returns:
number of attachments.

getAttachmentNames

java.util.Iterator<java.lang.String> getAttachmentNames()
Get iterator on names of attachments of this record. Returns empty iterator if record has no attachments.

Returns:
iterator on attachment names.

getAttachment

Attachment getAttachment(java.lang.String name)
get attachment value with the specified name.

Parameters:
name - attachment name.
Returns:
attachment.

getAttachmentAsBytes

byte[] getAttachmentAsBytes(java.lang.String name)
get attachment value for the specified name.

Parameters:
name - attachment name.
Returns:
attachment content.

setAttachment

void setAttachment(Attachment attachment)
set attachment.

Parameters:
attachment - the new attachment.

setAttachment

void setAttachment(java.lang.String name,
                   byte[] attachment)
set attachment content for the specified name.

Parameters:
name - attachment name.
attachment - attachment value.

removeAttachment

void removeAttachment(java.lang.String name)
remove attachment for specified name.

Parameters:
name - attachment name.

removeAttachments

void removeAttachments()
remove attachments.


SMILA 1.0 API documentation