public interface Blackboard
Modifier and Type | Interface and Description |
---|---|
static class |
Blackboard.Get
use as an argument in {@link #getRecord(String, CreateMode).
|
Modifier and Type | Method and Description |
---|---|
void |
commit()
commit ALL records on this blackboard to storages (if any) and release resources.
|
void |
commitRecord(java.lang.String id)
All changes are written to the storages before the record is removed.
|
Record |
filterRecord(Record record,
java.lang.String filterName)
Filter record metadata.
|
Attachment |
getAttachment(java.lang.String id,
java.lang.String name)
Gets the attachment.
|
byte[] |
getAttachmentAsBytes(java.lang.String id,
java.lang.String name)
Gets the attachment.
|
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)
Get current version of record with given ID.
|
Record |
getRecord(java.lang.String id,
Blackboard.Get mode)
get a reference to the record on the blackboard.
|
Record |
getRecord(java.lang.String id,
java.lang.String filterName)
Shortcut for
getRecord(String) + #filterRecord(Record, String)) : Gets the blackboard record and
applies the named filter. |
Record |
getRecordCopy(java.lang.String id,
boolean withAttachments)
get a shallow copy of the record on the blackboard.
|
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 |
removeAll()
remove all records currently stored on blackboard.
|
void |
removeAttachment(java.lang.String id,
java.lang.String name)
Removes the attachment.
|
void |
removeRecord(java.lang.String id)
remove record completely from blackboard.
|
void |
setAttachment(java.lang.String id,
Attachment attachment)
Sets the attachment.
|
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)
Sets 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 attributes and attachments from the incoming record to the blackboard record with the same
ID.
|
void |
unload()
remove ALL records from blackboard and release all associated resources.
|
void |
unloadRecord(java.lang.String id)
The record is removed from the blackboard.
|
DataFactory getDataFactory()
Record getRecord(java.lang.String id, Blackboard.Get mode) throws BlackboardAccessException
Blackboard.Get
for details on the
mode parameter.id
- the idmode
- configure behavior of method.BlackboardAccessException
Record getRecord(java.lang.String id) throws BlackboardAccessException
getRecord(String, Get)
with Blackboard.Get.EXISTING
.
This method is usually the correct one to use in pipelets or workers to process a record.id
- the idBlackboardAccessException
- error accessing attached storagesAnyMap getMetadata(java.lang.String id) throws BlackboardAccessException
getRecord(String)
+ Record.getMetadata()
. If getRecord(String)
would yield
null, this method yields null, too.id
- the idBlackboardAccessException
- error accessing attached storagesRecord getRecord(java.lang.String id, java.lang.String filterName) throws BlackboardAccessException, RecordFilterNotFoundException
getRecord(String)
+ #filterRecord(Record, String))
: Gets the blackboard record and
applies the named filter.id
- the idfilterName
- the filter nameBlackboardAccessException
- error accessing storages for reading the recordRecordFilterNotFoundException
- named record filter does not existRecord filterRecord(Record record, java.lang.String filterName) throws RecordFilterNotFoundException
record
- the recordfilterName
- the filter nameRecordFilterNotFoundException
- named record filter does not existRecord getRecordCopy(java.lang.String id, boolean withAttachments) throws BlackboardAccessException
id
- the idBlackboardAccessException
void setRecord(Record record) throws BlackboardAccessException
record
- the recordBlackboardAccessException
- error accessing storages for reading the record or writing attachmentsvoid synchronizeRecord(Record record) throws BlackboardAccessException
record
- the recordBlackboardAccessException
- error accessing storages for reading the record or writing attachmentsvoid removeRecord(java.lang.String id)
commit()
or commitRecord(String)
is called.id
- record idvoid removeAll()
commit()
or commitRecord(String)
is called.boolean hasAttachment(java.lang.String id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the nameBlackboardAccessException
- error accessing storages for checkAttachment getAttachment(java.lang.String id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the nameBlackboardAccessException
- error accessing storages for reading the record or attachmentbyte[] getAttachmentAsBytes(java.lang.String id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the nameBlackboardAccessException
- error accessing storages for reading the record or attachmentjava.io.InputStream getAttachmentAsStream(java.lang.String id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the nameBlackboardAccessException
- error accessing storages for reading the record or attachmentvoid setAttachment(java.lang.String id, Attachment attachment) throws BlackboardAccessException
id
- the idattachment
- the attachmentBlackboardAccessException
- error if record does not exist or on errors accessing storages for reading the record or writing the
attachmentvoid setAttachment(java.lang.String id, java.lang.String name, byte[] attachment) throws BlackboardAccessException
id
- the idname
- the nameattachment
- the attachmentBlackboardAccessException
- error if record does not exist or on errors accessing storages for reading the record or writing the
attachmentvoid setAttachmentFromStream(java.lang.String id, java.lang.String name, java.io.InputStream attachmentStream) throws BlackboardAccessException
id
- the idname
- the nameattachmentStream
- the attachment streamBlackboardAccessException
- error if record does not exist or on errors accessing storages for reading the record or writing the
attachmentvoid setAttachmentFromFile(java.lang.String id, java.lang.String name, java.io.File attachmentFile) throws BlackboardAccessException
id
- the idname
- the nameattachmentFile
- attachment fileBlackboardAccessException
- error if record does not exist or on errors accessing storages for reading the record or writing the
attachmentvoid removeAttachment(java.lang.String id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the nameBlackboardAccessException
- error if record does not exist or on errors accessing storages for reading the record or deleting the
attachmentboolean hasGlobalNote(java.lang.String name)
name
- the namejava.io.Serializable getGlobalNote(java.lang.String name)
name
- the namevoid setGlobalNote(java.lang.String name, java.io.Serializable object)
name
- the nameobject
- the objectboolean hasRecordNote(java.lang.String id, java.lang.String name)
id
- the idname
- the namejava.io.Serializable getRecordNote(java.lang.String id, java.lang.String name)
id
- the idname
- the namevoid setRecordNote(java.lang.String id, java.lang.String name, java.io.Serializable object)
id
- the idname
- the nameobject
- the objectvoid commitRecord(java.lang.String id) throws BlackboardAccessException
id
- the idBlackboardAccessException
- the blackboard access exceptionvoid unloadRecord(java.lang.String id)
id
- the idvoid commit() throws BlackboardAccessException
commit ALL records on this blackboard to storages (if any) and release resources.
The records will not be unloaded from the blackboard.
The operation throws an exception if at least one record could not be committed (e.g. written to storages) successfully. However, the implementation should try to commit as many records as possible and not stop on the first failed commit and invalidate the remaining records.
BlackboardAccessException
- at least one record could not be committed.void unload()