|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ContentItem
A unit of content that Stanbol Enhancer can enhance.
Gives access to the binary content that was registered, and the Graph that represents its metadata (provided by client and/or generated).
| Method Summary | ||
|---|---|---|
java.lang.Object |
addPart(org.apache.clerezza.rdf.core.UriRef uriRef,
java.lang.Object object)
Add a new part to this ContentItem |
|
Blob |
getBlob()
The main content of this content item |
|
java.util.concurrent.locks.ReadWriteLock |
getLock()
Read/write lock used to synchronise access to the metadata and the content parts of this content item. |
|
org.apache.clerezza.rdf.core.access.LockableMGraph |
getMetadata()
Optional metadata |
|
java.lang.String |
getMimeType()
The MimeType. |
|
|
getPart(int index,
java.lang.Class<T> clazz)
A content item may consists of multiple parts, while the part with index 0 should always be a blob, higher position may be used by Enhancer to story arbitrary objects, such objects can be used for accessing the precomputations of EnhancementEngines previous in the chain. |
|
|
getPart(org.apache.clerezza.rdf.core.UriRef uri,
java.lang.Class<T> clazz)
Each part of the content item has a URI. |
|
org.apache.clerezza.rdf.core.UriRef |
getPartUri(int index)
Get the uri of the part at the specified index |
|
java.io.InputStream |
getStream()
The binary content stream. |
|
org.apache.clerezza.rdf.core.UriRef |
getUri()
The Uri of this ContentItem (either supplied by client or generated by Stanbol Enhancer) |
|
void |
removePart(int index)
Removes a part - other than the main content part - from this ContentItem |
|
void |
removePart(org.apache.clerezza.rdf.core.UriRef uriRef)
Removes a part - other than the main content part - from this ContentItem |
|
| Method Detail |
|---|
org.apache.clerezza.rdf.core.UriRef getUri()
java.io.InputStream getStream()
getBlob().getStream()
java.lang.String getMimeType()
getBlob().getMimeType().
java.util.concurrent.locks.ReadWriteLock getLock()
metadata and the content parts of this content item.
The lock used by the LockableMGraph.getLock() MUST BE the same
as the lock returned by this Instance. This is to avoid deadlocks when
using a lock while iterating over the metadata and
simultaneously accessing the content parts. In other words
calling contentItem.getLock() == contentItem.getMetadata().getLock()
MUST BE true
LockableMGraph
containing the metadata of this content item.org.apache.clerezza.rdf.core.access.LockableMGraph getMetadata()
Blob getBlob()
<T> T getPart(int index,
java.lang.Class<T> clazz)
throws NoSuchPartException
NoSuchPartException - if no part with the parsed index exists
java.lang.ClassCastException - if the class of the part is not compatiple with
the requested class
java.lang.IllegalArgumentException - if null is parsed as
clazz.
<T> T getPart(org.apache.clerezza.rdf.core.UriRef uri,
java.lang.Class<T> clazz)
throws NoSuchPartException
NoSuchPartException - if no part with the parsed uri exists
java.lang.ClassCastException - if the class of the part is not compatiple with
the requested class
java.lang.IllegalArgumentException - if null is parsed as
uri or clazz.
org.apache.clerezza.rdf.core.UriRef getPartUri(int index)
throws NoSuchPartException
NoSuchPartException - if no part with the parsed index exists
java.lang.Object addPart(org.apache.clerezza.rdf.core.UriRef uriRef,
java.lang.Object object)
uriRef - the URI of the partobject - the part
null if
no part with the parsed URI was present
java.lang.IllegalArgumentException - if null is parsed as
uriRef or object.void removePart(int index)
index - the index of the part to remove. NOTE that index '0'
- the main content part - can NOT be removed!
NoSuchPartException - if no ContentPart with the parsed id exists
java.lang.IllegalArgumentException - it the parsed index < 0
java.lang.IllegalStateException - if '0' is parsed as index. The index '0'
- the main content part - can NOT be removed!void removePart(org.apache.clerezza.rdf.core.UriRef uriRef)
uriRef - the uri of the part to remove. NOTE that the part with the
uri getPartUri(0) - the main
content part - can NOT be removed!
NoSuchPartException - if no ContentPart with the parsed uri exists
java.lang.IllegalArgumentException - it the parsed uri is null
java.lang.IllegalStateException - if the parsed uri is equals to
getPartUri(0). This uri refers to
the main content part. This part can NOT be removed by this method
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||