|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.smila.blackboard.impl.TransientBlackboardImpl
public class TransientBlackboardImpl
A non-persisting Blackboard implementation.
| Constructor Summary | |
|---|---|
TransientBlackboardImpl(RecordFilterHelper filterHelper,
java.io.File attachmentsTempDir)
create instance. |
|
| Method Summary | |
|---|---|
protected void |
checkCachedFileAttachment(java.lang.String id,
java.lang.String name)
Checks if there is cached File attachment for given Id and prevents overwriting it. |
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. |
protected boolean |
containsRecord(java.lang.String id)
check if record exists on blackboard. |
protected void |
copyAttributes(AnyMap source,
AnyMap destination)
Copy attributes. |
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. |
protected java.lang.String |
getAttachmentId(java.lang.String id,
java.lang.String name)
Calculates the attachment id that will be used as a key in binary storage. |
protected Record |
getCachedRecord(java.lang.String id)
Returns cached record by id or null if record is not loaded into blackboard. |
DataFactory |
getDataFactory()
|
java.io.Serializable |
getGlobalNote(java.lang.String name)
Gets the global note. |
protected java.util.Collection<java.lang.String> |
getIds()
create a collection of all IDs of records on the blackboard. |
AnyMap |
getMetadata(java.lang.String id)
Shortcut for Blackboard.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)
same as create(String). |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransientBlackboardImpl(RecordFilterHelper filterHelper,
java.io.File attachmentsTempDir)
filterHelper - record filter manager.attachmentsTempDir - directory to use for temporary attachment files.| Method Detail |
|---|
public DataFactory getDataFactory()
getDataFactory in interface Blackboard
public Record getRecord(java.lang.String id)
throws BlackboardAccessException
Blackboard.load(String). Depending on the blackboard implementation, attachments may or may not be included in the
returned record.
getRecord in interface Blackboardid - the id
BlackboardAccessException - the blackboard access exception
public AnyMap getMetadata(java.lang.String id)
throws BlackboardAccessException
Blackboard.getRecord(String) + Record.getMetadata(). If Blackboard.getRecord(String) would yield
null, this method yields null, too.
getMetadata in interface Blackboardid - the id
BlackboardAccessException - the blackboard access exception
public Record getRecord(java.lang.String id,
java.lang.String filterName)
throws RecordFilterNotFoundException,
BlackboardAccessException
getRecord in interface Blackboardid - the idfilterName - the filter name
RecordFilterNotFoundException - the record filter not found exception
BlackboardAccessException - the blackboard access exception
public Record filterRecord(Record record,
java.lang.String filterName)
throws RecordFilterNotFoundException
filterRecord in interface Blackboardrecord - the recordfilterName - the filter name
RecordFilterNotFoundException - the record filter not found exception
public void setRecord(Record record)
throws BlackboardAccessException
setRecord in interface Blackboardrecord - the record
BlackboardAccessException - the blackboard access exception
public Record copyRecord(java.lang.String id,
java.lang.String newId)
throws BlackboardAccessException
copyRecord in interface Blackboardid - the idnewId - the id of the copy
BlackboardAccessException - the blackboard access exception
public void synchronizeRecord(Record record)
throws BlackboardAccessException
synchronizeRecord in interface Blackboardrecord - the record
BlackboardAccessException - the blackboard access exception
public void commit()
throws BlackboardAccessException
commit in interface BlackboardBlackboardAccessException - at least one record could not be committed.public void invalidate()
invalidate in interface Blackboardpublic Record create(java.lang.String id)
create in interface Blackboardid - the id
public Record load(java.lang.String id)
throws BlackboardAccessException
create(String).
Loads record data for the given ID from persistence (or prepare it to be loaded). Used by a client to indicate that
it wants to process this record.
The behavior is very implementation specific so check the the impl's doc.
load in interface Blackboardid - the id
null if record isn't found
(implementation specific)
BlackboardAccessException - the blackboard access exception
public void commit(java.lang.String id)
throws BlackboardAccessException
commit in interface Blackboardid - the id
BlackboardAccessException - the blackboard access exceptionpublic void invalidate(java.lang.String id)
invalidate in interface Blackboardid - the idpublic void removeRecord(java.lang.String id)
removeRecord in interface Blackboardid - record id
public boolean hasAttachment(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
hasAttachment in interface Blackboardid - the idname - the name
BlackboardAccessException - the blackboard access exception
public byte[] getAttachment(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
getAttachment in interface Blackboardid - the idname - the name
BlackboardAccessException
public java.io.InputStream getAttachmentAsStream(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
getAttachmentAsStream in interface Blackboardid - the idname - the name
BlackboardAccessException
public java.io.File getAttachmentAsFile(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
getAttachmentAsFile in interface Blackboardid - the idname - the name
BlackboardAccessException
public void setAttachment(java.lang.String id,
java.lang.String name,
byte[] attachment)
throws BlackboardAccessException
setAttachment in interface Blackboardid - the idname - the nameattachment - the attachment
BlackboardAccessException
public void setAttachmentFromStream(java.lang.String id,
java.lang.String name,
java.io.InputStream attachmentStream)
throws BlackboardAccessException
setAttachmentFromStream in interface Blackboardid - the idname - the nameattachmentStream - the attachment stream
BlackboardAccessException
public void setAttachmentFromFile(java.lang.String id,
java.lang.String name,
java.io.File attachmentFile)
throws BlackboardAccessException
setAttachmentFromFile in interface Blackboardid - the idname - the nameattachmentFile - attachment file
BlackboardAccessException
public void removeAttachment(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
removeAttachment in interface Blackboardid - the idname - the name
BlackboardAccessException - the blackboard access exceptionorg.eclipse.smila.blackboard.Blackboard#removeAttachment(org.eclipse.smila.datamodel.id.Id, java.lang.String)
public boolean hasGlobalNote(java.lang.String name)
throws BlackboardAccessException
hasGlobalNote in interface Blackboardname - the name
BlackboardAccessException - the blackboard access exception
public java.io.Serializable getGlobalNote(java.lang.String name)
throws BlackboardAccessException
getGlobalNote in interface Blackboardname - the name
BlackboardAccessException - the blackboard access exception
public void setGlobalNote(java.lang.String name,
java.io.Serializable object)
throws BlackboardAccessException
setGlobalNote in interface Blackboardname - the nameobject - the object
BlackboardAccessException - the blackboard access exception
public boolean hasRecordNote(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
hasRecordNote in interface Blackboardid - the idname - the name
BlackboardAccessException - the blackboard access exception
public java.io.Serializable getRecordNote(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
getRecordNote in interface Blackboardid - the idname - the name
BlackboardAccessException
public void setRecordNote(java.lang.String id,
java.lang.String name,
java.io.Serializable object)
throws BlackboardAccessException
setRecordNote in interface Blackboardid - the idname - the nameobject - the object
BlackboardAccessException - the blackboard access exception
protected java.lang.String getAttachmentId(java.lang.String id,
java.lang.String name)
id - the idname - the name
protected void checkCachedFileAttachment(java.lang.String id,
java.lang.String name)
throws BlackboardAccessException
id - Idname - attachment name
BlackboardAccessException - file exists.protected Record getCachedRecord(java.lang.String id)
id - Record id
protected boolean containsRecord(java.lang.String id)
id - record ID
protected java.util.Collection<java.lang.String> getIds()
protected void copyAttributes(AnyMap source,
AnyMap destination)
source - the sourcedestination - the destination
|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||