|
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 |
addAnnotation(Id id,
Path path,
java.lang.String name,
Annotation annotation)
Adds the annotation. |
void |
addLiteral(Id id,
Path path,
Literal value)
Adds the value. |
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. |
Record |
create(Id id)
Creates a new record with a given ID in memory, but only if it doesnt exist there yet, if it does, then nothing happens and the existing record is returned. |
Annotation |
createAnnotation(Id id)
Creates the annotation. |
Literal |
createLiteral(Id id)
Creates the literal. |
Record |
filterRecord(Record record,
java.lang.String filterName)
Filter record. |
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. |
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. |
java.io.Serializable |
getGlobalNote(java.lang.String name)
Gets the global note. |
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 for the given Id. |
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. |
Record |
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 value)
Sets the value. |
void |
setLiterals(Id id,
Path path,
java.util.List<Literal> values)
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. |
Method Detail |
---|
void commit() throws BlackboardAccessException
BlackboardAccessException
- at least one record could not be committed.void invalidate()
Record create(Id id)
id
- the id
Record load(Id id) throws BlackboardAccessException
id
- the id
BlackboardAccessException
- the blackboard access exceptionvoid setRecord(Record record) throws BlackboardAccessException
record
- the record
BlackboardAccessException
- the blackboard access exceptionId split(Id id, java.lang.String fragmentName) throws BlackboardAccessException
id
- the idfragmentName
- the fragment name
BlackboardAccessException
- the blackboard access exceptionvoid commit(Id id) throws BlackboardAccessException
id
- the id
BlackboardAccessException
- the blackboard access exceptionvoid invalidate(Id id)
id
- the idLiteral createLiteral(Id id) throws BlackboardAccessException
id
- the id
BlackboardAccessException
- the blackboard access exceptionAnnotation createAnnotation(Id id) throws BlackboardAccessException
id
- the id
BlackboardAccessException
- the blackboard access exceptionjava.util.Iterator<java.lang.String> getAttributeNames(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionjava.util.Iterator<java.lang.String> getAttributeNames(Id id) throws BlackboardAccessException
id
- the id
BlackboardAccessException
- the blackboard access exceptionboolean hasAttribute(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionboolean hasLiterals(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionint getLiteralsSize(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionjava.util.List<Literal> getLiterals(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionLiteral getLiteral(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionvoid setLiterals(Id id, Path path, java.util.List<Literal> values) throws BlackboardAccessException
id
- the idpath
- the pathvalues
- the values
BlackboardAccessException
- the blackboard access exceptionvoid setLiteral(Id id, Path path, Literal value) throws BlackboardAccessException
id
- the idpath
- the pathvalue
- the value
BlackboardAccessException
- the blackboard access exceptionvoid addLiteral(Id id, Path path, Literal value) throws BlackboardAccessException
id
- the idpath
- the pathvalue
- the value
BlackboardAccessException
- the blackboard access exceptionvoid removeLiteral(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionvoid removeLiterals(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionboolean hasObjects(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionint getObjectSize(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionvoid removeObject(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionvoid removeObjects(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionjava.lang.String getObjectSemanticType(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionvoid setObjectSemanticType(Id id, Path path, java.lang.String typename) throws BlackboardAccessException
id
- the idpath
- the pathtypename
- the typename
BlackboardAccessException
- the blackboard access exceptionjava.util.Iterator<java.lang.String> getAnnotationNames(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionboolean hasAnnotations(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionboolean hasAnnotation(Id id, Path path, java.lang.String name) throws BlackboardAccessException
id
- the idpath
- the pathname
- the name
BlackboardAccessException
- the blackboard access exceptionjava.util.List<Annotation> getAnnotations(Id id, Path path, java.lang.String name) throws BlackboardAccessException
id
- the idpath
- the pathname
- the name
BlackboardAccessException
- the blackboard access exceptionAnnotation getAnnotation(Id id, Path path, java.lang.String name) throws BlackboardAccessException
id
- the idpath
- the pathname
- the name
BlackboardAccessException
- the blackboard access exceptionvoid setAnnotations(Id id, Path path, java.lang.String name, java.util.List<Annotation> annotations) throws BlackboardAccessException
id
- the idpath
- the pathname
- the nameannotations
- the annotations
BlackboardAccessException
- the blackboard access exceptionvoid setAnnotation(Id id, Path path, java.lang.String name, Annotation annotation) throws BlackboardAccessException
id
- the idpath
- the pathname
- the nameannotation
- the annotation
BlackboardAccessException
- the blackboard access exceptionvoid addAnnotation(Id id, Path path, java.lang.String name, Annotation annotation) throws BlackboardAccessException
id
- the idpath
- the pathname
- the nameannotation
- the annotation
BlackboardAccessException
- the blackboard access exceptionvoid removeAnnotation(Id id, Path path, java.lang.String name) throws BlackboardAccessException
id
- the idpath
- the pathname
- the name
BlackboardAccessException
- the blackboard access exceptionvoid removeAnnotations(Id id, Path path) throws BlackboardAccessException
id
- the idpath
- the path
BlackboardAccessException
- the blackboard access exceptionboolean hasAttachment(Id id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the name
BlackboardAccessException
- the blackboard access exceptionbyte[] getAttachment(Id id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the name
BlackboardAccessException
- the blackboard access exceptionjava.io.InputStream getAttachmentAsStream(Id id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the name
BlackboardAccessException
- the blackboard access exceptionjava.io.File getAttachmentAsFile(Id id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the name
BlackboardAccessException
- BlackboardAccessExceptionvoid setAttachment(Id id, java.lang.String name, byte[] attachment) throws BlackboardAccessException
id
- the idname
- the nameattachment
- the attachment
BlackboardAccessException
- the blackboard access exceptionvoid setAttachmentFromStream(Id id, java.lang.String name, java.io.InputStream attachmentStream) throws BlackboardAccessException
id
- the idname
- the nameattachmentStream
- the attachment stream
BlackboardAccessException
- the blackboard access exceptionvoid setAttachmentFromFile(Id id, java.lang.String name, java.io.File attachmentFile) throws BlackboardAccessException
id
- the idname
- the nameattachmentFile
- attachment file
BlackboardAccessException
- BlackboardAccessExceptionvoid removeAttachment(Id id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the name
BlackboardAccessException
- the blackboard access exceptionboolean hasGlobalNote(java.lang.String name) throws BlackboardAccessException
name
- the name
BlackboardAccessException
- the blackboard access exceptionjava.io.Serializable getGlobalNote(java.lang.String name) throws BlackboardAccessException
name
- the name
BlackboardAccessException
- the blackboard access exceptionvoid setGlobalNote(java.lang.String name, java.io.Serializable object) throws BlackboardAccessException
name
- the nameobject
- the object
BlackboardAccessException
- the blackboard access exceptionboolean hasRecordNote(Id id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the name
BlackboardAccessException
- the blackboard access exceptionjava.io.Serializable getRecordNote(Id id, java.lang.String name) throws BlackboardAccessException
id
- the idname
- the name
BlackboardAccessException
- the blackboard access exceptionvoid setRecordNote(Id id, java.lang.String name, java.io.Serializable object) throws BlackboardAccessException
id
- the idname
- the nameobject
- the object
BlackboardAccessException
- the blackboard access exceptionvoid synchronize(Record record) throws BlackboardAccessException
record
- the record
BlackboardAccessException
- the blackboard access exceptionRecord getRecord(Id id) throws BlackboardAccessException
load(Id)
. Hence the bahvior is hightly implementation specfic. so check the doc there.
id
- the id
BlackboardAccessException
- the blackboard access exceptionRecord getRecord(Id 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 exceptionRecord filterRecord(Record record, java.lang.String filterName) throws RecordFilterNotFoundException
record
- the recordfilterName
- the filter name
RecordFilterNotFoundException
- the record filter not found exception
|
SMILA (incubation) API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |