|
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 exception
void setRecord(Record record)
throws BlackboardAccessException
record - the record
BlackboardAccessException - the blackboard access exception
Id split(Id id,
java.lang.String fragmentName)
throws BlackboardAccessException
id - the idfragmentName - the fragment name
BlackboardAccessException - the blackboard access exception
void commit(Id id)
throws BlackboardAccessException
id - the id
BlackboardAccessException - the blackboard access exceptionvoid invalidate(Id id)
id - the id
Literal createLiteral(Id id)
throws BlackboardAccessException
id - the id
BlackboardAccessException - the blackboard access exception
Annotation createAnnotation(Id id)
throws BlackboardAccessException
id - the id
BlackboardAccessException - the blackboard access exception
java.util.Iterator<java.lang.String> getAttributeNames(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
java.util.Iterator<java.lang.String> getAttributeNames(Id id)
throws BlackboardAccessException
id - the id
BlackboardAccessException - the blackboard access exception
boolean hasAttribute(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
boolean hasLiterals(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
int getLiteralsSize(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
java.util.List<Literal> getLiterals(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
Literal getLiteral(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
void setLiterals(Id id,
Path path,
java.util.List<Literal> values)
throws BlackboardAccessException
id - the idpath - the pathvalues - the values
BlackboardAccessException - the blackboard access exception
void setLiteral(Id id,
Path path,
Literal value)
throws BlackboardAccessException
id - the idpath - the pathvalue - the value
BlackboardAccessException - the blackboard access exception
void addLiteral(Id id,
Path path,
Literal value)
throws BlackboardAccessException
id - the idpath - the pathvalue - the value
BlackboardAccessException - the blackboard access exception
void removeLiteral(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
void removeLiterals(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
boolean hasObjects(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
int getObjectSize(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
void removeObject(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
void removeObjects(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
java.lang.String getObjectSemanticType(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
void setObjectSemanticType(Id id,
Path path,
java.lang.String typename)
throws BlackboardAccessException
id - the idpath - the pathtypename - the typename
BlackboardAccessException - the blackboard access exception
java.util.Iterator<java.lang.String> getAnnotationNames(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
boolean hasAnnotations(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
boolean hasAnnotation(Id id,
Path path,
java.lang.String name)
throws BlackboardAccessException
id - the idpath - the pathname - the name
BlackboardAccessException - the blackboard access exception
java.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 exception
Annotation getAnnotation(Id id,
Path path,
java.lang.String name)
throws BlackboardAccessException
id - the idpath - the pathname - the name
BlackboardAccessException - the blackboard access exception
void 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 exception
void 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 exception
void 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 exception
void removeAnnotation(Id id,
Path path,
java.lang.String name)
throws BlackboardAccessException
id - the idpath - the pathname - the name
BlackboardAccessException - the blackboard access exception
void removeAnnotations(Id id,
Path path)
throws BlackboardAccessException
id - the idpath - the path
BlackboardAccessException - the blackboard access exception
boolean hasAttachment(Id id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - the blackboard access exception
byte[] getAttachment(Id id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - the blackboard access exception
java.io.InputStream getAttachmentAsStream(Id id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - the blackboard access exception
java.io.File getAttachmentAsFile(Id id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - BlackboardAccessException
void setAttachment(Id id,
java.lang.String name,
byte[] attachment)
throws BlackboardAccessException
id - the idname - the nameattachment - the attachment
BlackboardAccessException - the blackboard access exception
void 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 exception
void setAttachmentFromFile(Id id,
java.lang.String name,
java.io.File attachmentFile)
throws BlackboardAccessException
id - the idname - the nameattachmentFile - attachment file
BlackboardAccessException - BlackboardAccessException
void removeAttachment(Id 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(Id id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - the blackboard access exception
java.io.Serializable getRecordNote(Id id,
java.lang.String name)
throws BlackboardAccessException
id - the idname - the name
BlackboardAccessException - the blackboard access exception
void setRecordNote(Id id,
java.lang.String name,
java.io.Serializable object)
throws BlackboardAccessException
id - the idname - the nameobject - the object
BlackboardAccessException - the blackboard access exception
void synchronize(Record record)
throws BlackboardAccessException
record - the record
BlackboardAccessException - the blackboard access exception
Record 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 exception
Record 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 exception
Record 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 | ||||||||