|
ModeShape Distribution 3.0.0.Beta3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@ThreadSafe public interface BinaryStore
The basic interface for a store for Binary value objects. All binary values that are of a
minimum threshold size are stored in the store; smaller binary values are kept in-memory
and are stored within the nodes.
| Field Summary | |
|---|---|
static long |
DEFAULT_MINIMUM_BINARY_SIZE_IN_BYTES
The default minimum size (in bytes) of binary values that are persisted in the binary store is 4096 bytes, or 4KB. |
| Method Summary | |
|---|---|
Iterable<BinaryKey> |
getAllBinaryKeys()
Obtain an iterable implementation containing all of the store's binary keys. |
String |
getExtractedText(BinaryValue source)
Returns the extracted text of a binary value, or null if such text hasn't been stored previously or if the binary
value cannot be found in this store. |
InputStream |
getInputStream(BinaryKey key)
Get an InputStream to the binary content with the supplied key. |
String |
getMimeType(BinaryValue binary,
String name)
Get the MIME type for this binary value or null if the mime-type cannot be determined. |
long |
getMinimumBinarySizeInBytes()
Get the minimum number of bytes that a binary value must contain before it can be stored in the binary store. |
String |
getText(BinaryValue binary)
Get the text that can be extracted from this binary content. |
void |
markAsUnused(Iterable<BinaryKey> keys)
Mark the supplied binary keys as unused, but key them in quarantine until needed again (at which point they're removed from quarantine) or until removeValuesUnusedLongerThan(long, TimeUnit) is called. |
void |
removeValuesUnusedLongerThan(long minimumAge,
TimeUnit unit)
Remove binary values that have been unused for at least the specified amount of time. |
void |
setMimeTypeDetector(MimeTypeDetector mimeTypeDetector)
Set the MIME type detector that can be used for determining the MIME type for binary content. |
void |
setMinimumBinarySizeInBytes(long minSizeInBytes)
Set the minimum number of bytes that a binary value must contain before it can be stored in the binary store. |
void |
setTextExtractors(TextExtractors textExtractors)
Set the text extractor that can be used for extracting text from binary content. |
void |
storeExtractedText(BinaryValue source,
String extractedText)
Stores the extracted text of a binary value into this store. |
BinaryValue |
storeValue(InputStream stream)
Store the binary value and return the JCR representation. |
| Field Detail |
|---|
static final long DEFAULT_MINIMUM_BINARY_SIZE_IN_BYTES
| Method Detail |
|---|
long getMinimumBinarySizeInBytes()
void setMinimumBinarySizeInBytes(long minSizeInBytes)
minSizeInBytes - the minimum number of bytes for a stored binary value; may not be negativevoid setTextExtractors(TextExtractors textExtractors)
textExtractors - a non-null TextExtractors instancevoid setMimeTypeDetector(MimeTypeDetector mimeTypeDetector)
mimeTypeDetector - the detector
BinaryValue storeValue(InputStream stream)
throws BinaryStoreException
stream - the stream containing the binary content to be stored; may not be null
BinaryStoreException
InputStream getInputStream(BinaryKey key)
throws BinaryStoreException
InputStream to the binary content with the supplied key.
key - the key to the binary content; never null
never null
BinaryStoreException - if there is a problem reading the content from the store or if a valid, non-null
InputStream cannot be returned for the given key.
void markAsUnused(Iterable<BinaryKey> keys)
throws BinaryStoreException
removeValuesUnusedLongerThan(long, TimeUnit) is called. This method ignores any keys for
values not stored within this store.
keys - the keys for the binary values that are no longer needed
BinaryStoreException - if there is a problem marking any of the supplied binary values as unused
void removeValuesUnusedLongerThan(long minimumAge,
TimeUnit unit)
throws BinaryStoreException
unused for at least the specified amount of time.
minimumAge - the minimum time that a binary value has been unused before it can be
removed; must be non-negativeunit - the time unit for the minimum age; may not be null
BinaryStoreException - if there is a problem removing the unused values
String getText(BinaryValue binary)
throws BinaryStoreException
null
If extraction is enabled, this method may block until a text extractor has finished extracting the text.
If there are any problems either with the binary value or during the extraction process, the exception will be logged and
null is returned
AbstractBinaryStore should be enough and any custom BinaryStore
implementations aren't expected to implement this.
binary - the binary content; may not be null
BinaryStoreException - if the binary content could not be accessed
String getMimeType(BinaryValue binary,
String name)
throws IOException,
RepositoryException
null if the mime-type cannot be determined.
binary - the binary content; may not be nullname - the name of the content, useful for determining the MIME type; may be null if not known
IOException - if there is a problem reading the binary content
RepositoryException - if any other error occurs.
void storeExtractedText(BinaryValue source,
String extractedText)
throws BinaryStoreException
source - a non-null BinaryValue instance from which the text was extractedextractedText - a non-null and non-blank string representing the extracted text
BinaryStoreException - if the operation fails or if the extracted text cannot be stored for the given binary value
(regardless of the reason)
String getExtractedText(BinaryValue source)
throws BinaryStoreException
null if such text hasn't been stored previously or if the binary
value cannot be found in this store.
source - a non-null BinaryValue instance from which the text was extracted
String representing the extracted text, or null if such text hasn't been stored in this store
previously.
BinaryStoreException - if anything unexpected happens.
Iterable<BinaryKey> getAllBinaryKeys()
throws BinaryStoreException
BinaryKeys only as the iterator is used.
BinaryStoreException - if anything unexpected happens.
|
ModeShape Distribution 3.0.0.Beta3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||