|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Blackboard
The Blackboard is a container for a set of records that are processed in a single step, e.g. to add a crawled record to SMILA in connectivity or to process a single queue message. The blackboard can be connected to storage services (binary storage, record storage) so that existing versions of records can be loaded before the processing starts and the result records can be persisted afterwards. However, a blackboard can also be just "transient", i.e. not connected to any storage services. Then all record data is lost after the processing is finished.
| Method Summary | |
|---|---|
void |
commit()
commit ALL records on this blackboard to storages (if any) and release resources. |
void |
commit(java.lang.String id)
All changes are written to the storages before the record is removed. |
Record |
copyRecord(java.lang.String id,
java.lang.String newId)
Creates a copy of the record with a new Id and returns the new record. |
Record |
create(java.lang.String id)
Creates a new record with a given ID in memory, but only if it doesn't exist there yet, if it does, then nothing happens and the existing record is returned. |
Record |
filterRecord(Record record,
java.lang.String filterName)
Filter record metadata. |
byte[] |
getAttachment(java.lang.String id,
java.lang.String name)
Gets the attachment. |
java.io.File |
getAttachmentAsFile(java.lang.String id,
java.lang.String name)
Gets attachment as file. |
java.io.InputStream |
getAttachmentAsStream(java.lang.String id,
java.lang.String name)
Gets the attachment as stream. |
DataFactory |
getDataFactory()
|
java.io.Serializable |
getGlobalNote(java.lang.String name)
Gets the global note. |
AnyMap |
getMetadata(java.lang.String id)
Shortcut for getRecord(String) + Record.getMetadata(). |
Record |
getRecord(java.lang.String id)
Gets the record for the given Id. |
Record |
getRecord(java.lang.String id,
java.lang.String filterName)
Gets the filtered record. |
java.io.Serializable |
getRecordNote(java.lang.String id,
java.lang.String name)
Gets the record note. |
boolean |
hasAttachment(java.lang.String id,
java.lang.String name)
Checks for attachment. |
boolean |
hasGlobalNote(java.lang.String name)
Checks for global note. |
boolean |
hasRecordNote(java.lang.String id,
java.lang.String name)
Checks for record note. |
void |
invalidate()
remove ALL records from blackboard and release all associated resources. |
void |
invalidate(java.lang.String id)
The record is removed from the blackboard. |
Record |
load(java.lang.String id)
Loads record data for the given ID from persistence (or prepare it to be loaded). |
void |
removeAttachment(java.lang.String id,
java.lang.String name)
Removes the attachment. |
void |
removeRecord(java.lang.String id)
remove record completely from blackboard and persistence. |
void |
setAttachment(java.lang.String id,
java.lang.String name,
byte[] attachment)
Sets the attachment. |
void |
setAttachmentFromFile(java.lang.String id,
java.lang.String name,
java.io.File attachmentFile)
Sets attachment from file. |
void |
setAttachmentFromStream(java.lang.String id,
java.lang.String name,
java.io.InputStream attachmentStream)
Sets the attachment from stream. |
void |
setGlobalNote(java.lang.String name,
java.io.Serializable object)
Sets the global note. |
void |
setRecord(Record record)
Stores a record on the blackboard. |
void |
setRecordNote(java.lang.String id,
java.lang.String name,
java.io.Serializable object)
Sets the record note. |
void |
synchronizeRecord(Record record)
Synchronize: copy all existing attributes from the incoming record to the blackboard record with the same ID. |
| Method Detail |
|---|
DataFactory getDataFactory()
Record getRecord(java.lang.String id)
throws BlackboardAccessException
load(String). Depending on the blackboard implementation, attachments may or may not be included in the
returned record.
id - the id
BlackboardAccessException - the blackboard access exception
AnyMap getMetadata(java.lang.String id)
throws BlackboardAccessException
getRecord(String) + Record.getMetadata(). If getRecord(String) would yield
null, this method yields null, too.
id - the id
BlackboardAccessException - the blackboard access exception
Record getRecord(java.lang.String id,
java.lang.String filterName)
throws BlackboardAccessException,
RecordFilterNotFoundException
id - the idfilterName - the filter name
BlackboardAccessException - the blackboard access exception
RecordFilterNotFoundException - the record filter not found exception
Record filterRecord(Record record,
java.lang.String filterName)
throws RecordFilterNotFoundException
record - the recordfilterName - the filter name
RecordFilterNotFoundException - the record filter not found exception
void setRecord(Record record)
throws BlackboardAccessException
record - the record
BlackboardAccessException - the blackboard access exception
Record copyRecord(java.lang.String id,
java.lang.String newId)
throws BlackboardAccessException
id - the idnewId - the id of the copy
BlackboardAccessException - the blackboard access exception
void synchronizeRecord(Record record)
throws BlackboardAccessException
record - the record
BlackboardAccessException - the blackboard access exception
void commit()
throws BlackboardAccessException
BlackboardAccessException - at least one record could not be committed.void invalidate()
Record create(java.lang.String id)
id - the id
Record load(java.lang.String id)
throws BlackboardAccessException
id - the id
null if record isn't found
(implementation specific)
BlackboardAccessException - the blackboard access exception
void commit(java.lang.String id)
throws BlackboardAccessException
id - the id
BlackboardAccessException - the blackboard access exceptionvoid invalidate(java.lang.String id)
id - the idvoid removeRecord(java.lang.String id)
id - record id
boolean hasAttachment(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - the blackboard access exception
byte[] getAttachment(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - the blackboard access exception
java.io.InputStream getAttachmentAsStream(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - the blackboard access exception
java.io.File getAttachmentAsFile(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - BlackboardAccessException
void setAttachment(java.lang.String id,
java.lang.String name,
byte[] attachment)
throws BlackboardAccessException
id - the idname - the nameattachment - the attachment
BlackboardAccessException - the blackboard access exception
void setAttachmentFromStream(java.lang.String id,
java.lang.String name,
java.io.InputStream attachmentStream)
throws BlackboardAccessException
id - the idname - the nameattachmentStream - the attachment stream
BlackboardAccessException - the blackboard access exception
void setAttachmentFromFile(java.lang.String id,
java.lang.String name,
java.io.File attachmentFile)
throws BlackboardAccessException
id - the idname - the nameattachmentFile - attachment file
BlackboardAccessException - BlackboardAccessException
void removeAttachment(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - the blackboard access exception
boolean hasGlobalNote(java.lang.String name)
throws BlackboardAccessException
name - the name
BlackboardAccessException - the blackboard access exception
java.io.Serializable getGlobalNote(java.lang.String name)
throws BlackboardAccessException
name - the name
BlackboardAccessException - the blackboard access exception
void setGlobalNote(java.lang.String name,
java.io.Serializable object)
throws BlackboardAccessException
name - the nameobject - the object
BlackboardAccessException - the blackboard access exception
boolean hasRecordNote(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - the blackboard access exception
java.io.Serializable getRecordNote(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - the blackboard access exception
void setRecordNote(java.lang.String id,
java.lang.String name,
java.io.Serializable object)
throws BlackboardAccessException
id - the idname - the nameobject - the object
BlackboardAccessException - the blackboard access exception
|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||