|
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
The Class BlackboardServiceImpl.
| Constructor Summary | |
|---|---|
TransientBlackboardImpl(RecordFilterHelper filterHelper,
java.io.File attachmentsTempDir)
create instance. |
|
| Method Summary | |
|---|---|
void |
addAnnotation(Id id,
Path path,
java.lang.String name,
Annotation annotation)
Adds the annotation. |
void |
addLiteral(Id id,
Path path,
Literal literal)
Adds the value. |
protected void |
checkCachedFileAttachment(Id 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(Id id)
All changes are written to the storages before the record is removed. |
protected boolean |
containsRecord(Id id)
check if record exists on blackboard. |
void |
create(Id id)
Create a new record with a given ID. |
Annotation |
createAnnotation(Id id)
Creates the annotation. |
Literal |
createLiteral(Id id)
Creates the literal. |
Record |
filterRecord(Record record,
java.lang.String filterName)
Filter record. |
protected Annotatable |
getAnnotableObject(Id id,
Path path,
boolean create)
Returns annotable object at the specified path, optionally create missing objects on the path. |
protected Annotatable |
getAnnotatableObject(Id id,
Path path)
Returns annotable object at the specified path. |
Annotation |
getAnnotation(Id id,
Path path,
java.lang.String name)
Gets the first annotation if it exists. |
java.util.Iterator<java.lang.String> |
getAnnotationNames(Id id,
Path path)
Gets the annotation names. |
java.util.List<Annotation> |
getAnnotations(Id id,
Path path,
java.lang.String name)
Gets the annotations. |
byte[] |
getAttachment(Id id,
java.lang.String name)
Gets the attachment. |
java.io.File |
getAttachmentAsFile(Id id,
java.lang.String name)
Gets attachment as file. |
java.io.InputStream |
getAttachmentAsStream(Id id,
java.lang.String name)
Gets the attachment as stream. |
protected java.lang.String |
getAttachmentId(Id id,
java.lang.String name)
Calculates the attachment id that will be used as a key in binsary storage. |
protected Attribute |
getAttributeByName(Record record,
MObject metadata,
java.lang.String name,
boolean create)
get and optionally create named attribute of given mobject. |
protected Attribute |
getAttributeByPath(Id id,
Path path)
Returns the latest attribute specified by the given path; the last index is ignored. |
protected Attribute |
getAttributeByPath(Id id,
Path path,
boolean create)
Returns the latest attribute specified by the given path; the last index is ignored. |
java.util.Iterator<java.lang.String> |
getAttributeNames(Id id)
Returns iterator over attributes names by given record id. |
java.util.Iterator<java.lang.String> |
getAttributeNames(Id id,
Path path)
Returns iterator over attributes names or empty iterator if attribute was not found at the given path. |
protected Record |
getCachedRecord(Id id)
Returns cached record by id or null if record is not loaded into blackboard. |
java.io.Serializable |
getGlobalNote(java.lang.String name)
Gets the global note. |
protected java.util.Collection<Id> |
getIds()
create a collection of all IDs of records on the blackboard. |
protected int |
getLastIndex(Path path)
Returns the last index in the path. |
protected PathStep |
getLastStep(Path path)
Returns the last PathStep in the path. |
Literal |
getLiteral(Id id,
Path path)
Get single attribute value, index is specified in last step of path, defaults to 0. |
java.util.List<Literal> |
getLiterals(Id id,
Path path)
Get all literal attribute values of an attribute (index of last step is irrelevant) Returns empty list if attribute was not found. |
int |
getLiteralsSize(Id id,
Path path)
Returns number of attribute literals at the given path. |
java.lang.String |
getObjectSemanticType(Id id,
Path path)
Gets the metadata object semantic type. |
int |
getObjectSize(Id id,
Path path)
Gets size of metadata objects contained in this attribute. |
Record |
getRecord(Id id)
Gets the record. |
Record |
getRecord(Id id,
java.lang.String filterName)
Gets the record. |
java.io.Serializable |
getRecordNote(Id id,
java.lang.String name)
Gets the record note. |
boolean |
hasAnnotation(Id id,
Path path,
java.lang.String name)
Checks for annotation. |
boolean |
hasAnnotations(Id id,
Path path)
Checks for annotations. |
boolean |
hasAttachment(Id id,
java.lang.String name)
Checks for attachment. |
boolean |
hasAttribute(Id id,
Path path)
Checks for attribute. index of last step is irrelevant. |
boolean |
hasGlobalNote(java.lang.String name)
Checks for global note. |
boolean |
hasLiterals(Id id,
Path path)
Checks if attribute at the given path has literals. |
boolean |
hasObjects(Id id,
Path path)
Checks if attribute has sub metadata objects. |
boolean |
hasRecordNote(Id id,
java.lang.String name)
Checks for record note. |
void |
invalidate()
remove ALL records from blackboard and release all associated resources. |
void |
invalidate(Id id)
The record is removed from the blackboard. |
protected boolean |
isEmpty(Path path)
Checks if given path is empty. |
void |
load(Id id)
Loads record data for the given ID from persistence (or prepare it to be loaded). |
void |
removeAnnotation(Id id,
Path path,
java.lang.String name)
Removes the annotation. |
void |
removeAnnotations(Id id,
Path path)
Removes the annotations. |
void |
removeAttachment(Id id,
java.lang.String name)
Removes the attachment. |
void |
removeLiteral(Id id,
Path path)
Removes the value. |
void |
removeLiterals(Id id,
Path path)
Removes the values. |
void |
removeObject(Id id,
Path path)
Removes sub-objects specified by index in last step. |
void |
removeObjects(Id id,
Path path)
Removes all sub-objects of specified attribute. |
void |
setAnnotation(Id id,
Path path,
java.lang.String name,
Annotation annotation)
Sets the annotation. |
void |
setAnnotations(Id id,
Path path,
java.lang.String name,
java.util.List<Annotation> annotations)
Sets the annotations. |
void |
setAttachment(Id id,
java.lang.String name,
byte[] attachment)
Sets the attachment. |
void |
setAttachmentFromFile(Id id,
java.lang.String name,
java.io.File attachmentFile)
Sets attachment from file. |
void |
setAttachmentFromStream(Id 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 |
setLiteral(Id id,
Path path,
Literal literal)
Sets the value. |
void |
setLiterals(Id id,
Path path,
java.util.List<Literal> literals)
Sets the values. |
void |
setObjectSemanticType(Id id,
Path path,
java.lang.String typeName)
Sets the object semantic type. |
void |
setRecord(Record record)
Adds a record to the blackboard. |
void |
setRecordNote(Id id,
java.lang.String name,
java.io.Serializable object)
Sets the record note. |
Id |
split(Id id,
java.lang.String fragmentName)
Creates a fragment of a given record, i.e. the record content is copied to a new ID derived from the given by adding a frament name. |
void |
synchronize(Record record)
Synchronize. |
| 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 void commit()
throws BlackboardAccessException
commit in interface BlackboardBlackboardAccessException - at least one record could not be committed.public void invalidate()
invalidate in interface Blackboardpublic void create(Id id)
create in interface Blackboardid - the id
public void load(Id id)
throws BlackboardAccessException
load in interface Blackboardid - the id
BlackboardAccessException - the blackboard access exception
public void setRecord(Record record)
throws BlackboardAccessException
setRecord in interface Blackboardrecord - the record
BlackboardAccessException
public Id split(Id id,
java.lang.String fragmentName)
throws BlackboardAccessException
split in interface Blackboardid - the idfragmentName - the fragment name
BlackboardAccessException - the blackboard access exception
public void commit(Id id)
throws BlackboardAccessException
commit in interface Blackboardid - the id
BlackboardAccessException - the blackboard access exceptionpublic void invalidate(Id id)
invalidate in interface Blackboardid - the id
public Literal createLiteral(Id id)
throws BlackboardAccessException
createLiteral in interface Blackboardid - the id
BlackboardAccessException - the blackboard access exception
public Annotation createAnnotation(Id id)
throws BlackboardAccessException
createAnnotation in interface Blackboardid - the id
BlackboardAccessException - the blackboard access exception
public java.util.Iterator<java.lang.String> getAttributeNames(Id id,
Path path)
throws BlackboardAccessException
getAttributeNames in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public java.util.Iterator<java.lang.String> getAttributeNames(Id id)
throws BlackboardAccessException
getAttributeNames in interface Blackboardid - the id
BlackboardAccessException - the blackboard access exception
public boolean hasAttribute(Id id,
Path path)
throws BlackboardAccessException
hasAttribute in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public boolean hasLiterals(Id id,
Path path)
throws BlackboardAccessException
hasLiterals in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public int getLiteralsSize(Id id,
Path path)
throws BlackboardAccessException
getLiteralsSize in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public java.util.List<Literal> getLiterals(Id id,
Path path)
throws BlackboardAccessException
getLiterals in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public Literal getLiteral(Id id,
Path path)
throws BlackboardAccessException
getLiteral in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public void setLiterals(Id id,
Path path,
java.util.List<Literal> literals)
throws BlackboardAccessException
setLiterals in interface Blackboardid - the idpath - the pathliterals - the values
BlackboardAccessException - the blackboard access exception
public void setLiteral(Id id,
Path path,
Literal literal)
throws BlackboardAccessException
setLiteral in interface Blackboardid - the idpath - the pathliteral - the value
BlackboardAccessException - the blackboard access exception
public void addLiteral(Id id,
Path path,
Literal literal)
throws BlackboardAccessException
addLiteral in interface Blackboardid - the idpath - the pathliteral - the value
BlackboardAccessException - the blackboard access exception
public void removeLiteral(Id id,
Path path)
throws BlackboardAccessException
removeLiteral in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public void removeLiterals(Id id,
Path path)
throws BlackboardAccessException
removeLiterals in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public boolean hasObjects(Id id,
Path path)
throws BlackboardAccessException
hasObjects in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public int getObjectSize(Id id,
Path path)
throws BlackboardAccessException
getObjectSize in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public void removeObject(Id id,
Path path)
throws BlackboardAccessException
removeObject in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public void removeObjects(Id id,
Path path)
throws BlackboardAccessException
removeObjects in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public java.lang.String getObjectSemanticType(Id id,
Path path)
throws BlackboardAccessException
getObjectSemanticType in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public void setObjectSemanticType(Id id,
Path path,
java.lang.String typeName)
throws BlackboardAccessException
setObjectSemanticType in interface Blackboardid - the idpath - the pathtypeName - the typename
BlackboardAccessException - the blackboard access exception
public java.util.Iterator<java.lang.String> getAnnotationNames(Id id,
Path path)
throws BlackboardAccessException
getAnnotationNames in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public boolean hasAnnotation(Id id,
Path path,
java.lang.String name)
throws BlackboardAccessException
hasAnnotation in interface Blackboardid - the idpath - the pathname - the name
BlackboardAccessException - the blackboard access exception
public boolean hasAnnotations(Id id,
Path path)
throws BlackboardAccessException
hasAnnotations in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public java.util.List<Annotation> getAnnotations(Id id,
Path path,
java.lang.String name)
throws BlackboardAccessException
getAnnotations in interface Blackboardid - the idpath - the pathname - the name
BlackboardAccessException - the blackboard access exception
public Annotation getAnnotation(Id id,
Path path,
java.lang.String name)
throws BlackboardAccessException
getAnnotation in interface Blackboardid - the idpath - the pathname - the name
BlackboardAccessException - the blackboard access exception
public void setAnnotations(Id id,
Path path,
java.lang.String name,
java.util.List<Annotation> annotations)
throws BlackboardAccessException
setAnnotations in interface Blackboardid - the idpath - the pathname - the nameannotations - the annotations
BlackboardAccessException - the blackboard access exception
public void setAnnotation(Id id,
Path path,
java.lang.String name,
Annotation annotation)
throws BlackboardAccessException
setAnnotation in interface Blackboardid - the idpath - the pathname - the nameannotation - the annotation
BlackboardAccessException - the blackboard access exception
public void addAnnotation(Id id,
Path path,
java.lang.String name,
Annotation annotation)
throws BlackboardAccessException
addAnnotation in interface Blackboardid - the idpath - the pathname - the nameannotation - the annotation
BlackboardAccessException - the blackboard access exception
public void removeAnnotation(Id id,
Path path,
java.lang.String name)
throws BlackboardAccessException
removeAnnotation in interface Blackboardid - the idpath - the pathname - the name
BlackboardAccessException - the blackboard access exception
public void removeAnnotations(Id id,
Path path)
throws BlackboardAccessException
removeAnnotations in interface Blackboardid - the idpath - the path
BlackboardAccessException - the blackboard access exception
public boolean hasAttachment(Id id,
java.lang.String name)
throws BlackboardAccessException
hasAttachment in interface Blackboardid - the idname - the name
BlackboardAccessException - the blackboard access exception
public byte[] getAttachment(Id id,
java.lang.String name)
throws BlackboardAccessException
getAttachment in interface Blackboardid - the idname - the name
BlackboardAccessException
public java.io.InputStream getAttachmentAsStream(Id id,
java.lang.String name)
throws BlackboardAccessException
getAttachmentAsStream in interface Blackboardid - the idname - the name
BlackboardAccessException
public java.io.File getAttachmentAsFile(Id id,
java.lang.String name)
throws BlackboardAccessException
getAttachmentAsFile in interface Blackboardid - the idname - the name
BlackboardAccessException
public void setAttachment(Id id,
java.lang.String name,
byte[] attachment)
throws BlackboardAccessException
setAttachment in interface Blackboardid - the idname - the nameattachment - the attachment
BlackboardAccessException
public void setAttachmentFromStream(Id 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(Id 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(Id id,
java.lang.String name)
throws BlackboardAccessException
removeAttachment in interface Blackboardid - the idname - the name
BlackboardAccessException - the blackboard access exceptionBlackboard.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(Id 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(Id id,
java.lang.String name)
throws BlackboardAccessException
getRecordNote in interface Blackboardid - the idname - the name
BlackboardAccessException
public void setRecordNote(Id 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
public void synchronize(Record record)
throws BlackboardAccessException
synchronize in interface Blackboardrecord - the record
BlackboardAccessException - the blackboard access exceptionBlackboard.synchronize(org.eclipse.smila.datamodel.record.Record)
public Record getRecord(Id id)
throws BlackboardAccessException
getRecord in interface Blackboardid - the id
BlackboardAccessException - the blackboard access exceptionBlackboard.getRecord(org.eclipse.smila.datamodel.id.Id)
public Record getRecord(Id 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 exceptionBlackboard.getRecord(org.eclipse.smila.datamodel.id.Id, java.lang.String)
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 exceptionBlackboard.filterRecord(org.eclipse.smila.datamodel.record.Record,
java.lang.String)
protected java.lang.String getAttachmentId(Id id,
java.lang.String name)
id - the idname - the name
protected void checkCachedFileAttachment(Id id,
java.lang.String name)
throws BlackboardAccessException
id - Idname - attachment name
BlackboardAccessException - file exists.
protected Attribute getAttributeByPath(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
protected Attribute getAttributeByPath(Id id,
Path path,
boolean create)
throws BlackboardAccessException
id - the idpath - the pathcreate - true: create missing objects on path, false: return null, if path cannot be followed.
BlackboardAccessException - the blackboard access exception
protected Attribute getAttributeByName(Record record,
MObject metadata,
java.lang.String name,
boolean create)
record - containing record providing access to factory.metadata - metadata object to accessname - name of attributecreate - true to create a missing attribute, false to return null for missing attributes
protected int getLastIndex(Path path)
path - the path
protected PathStep getLastStep(Path path)
path - the path
protected boolean isEmpty(Path path)
path - the path
protected Annotatable getAnnotatableObject(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
protected Annotatable getAnnotableObject(Id id,
Path path,
boolean create)
throws BlackboardAccessException
id - the idpath - the pathcreate - true to create missing objects on path
BlackboardAccessException - the blackboard access exceptionprotected Record getCachedRecord(Id id)
id - Record id
protected boolean containsRecord(Id id)
id - record ID
protected java.util.Collection<Id> getIds()
|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||