ModeShape Distribution 3.0.0.Alpha6

org.modeshape.jcr.value.binary
Class AbstractBinaryStore

java.lang.Object
  extended by org.modeshape.jcr.value.binary.AbstractBinaryStore
All Implemented Interfaces:
BinaryStore
Direct Known Subclasses:
DatabaseBinaryStore, FileSystemBinaryStore, InfinispanBinaryStore

@ThreadSafe
public abstract class AbstractBinaryStore
extends Object
implements BinaryStore

An abstract class for a BinaryStore, with common functionality needed by implementation classes.


Field Summary
protected static int MEDIUM_BUFFER_SIZE
           
 
Fields inherited from interface org.modeshape.jcr.value.binary.BinaryStore
DEFAULT_MINIMUM_BINARY_SIZE_IN_BYTES
 
Constructor Summary
AbstractBinaryStore()
           
 
Method Summary
static int bestBufferSize(long fileSize)
           
protected  MimeTypeDetector detector()
          Get the MIME type detector that can be used to find the MIME type for binary content
protected  TextExtractor extractor()
          Get the text extractor that can be used to extract text by this store.
 long getMinimumBinarySizeInBytes()
          Get the minimum number of bytes that a binary value must contain before it can be stored in the binary store.
 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 setTextExtractor(TextExtractor textExtractor)
          Set the text extractor that can be used for extracting text from binary content.
 void shutdown()
           
 void start()
          Initialize the store and get ready for use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.modeshape.jcr.value.binary.BinaryStore
getInputStream, getMimeType, getText, markAsUnused, removeValuesUnusedLongerThan, storeValue
 

Field Detail

MEDIUM_BUFFER_SIZE

protected static final int MEDIUM_BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

AbstractBinaryStore

public AbstractBinaryStore()
Method Detail

bestBufferSize

public static int bestBufferSize(long fileSize)

getMinimumBinarySizeInBytes

public long getMinimumBinarySizeInBytes()
Description copied from interface: BinaryStore
Get the minimum number of bytes that a binary value must contain before it can be stored in the binary store.

Specified by:
getMinimumBinarySizeInBytes in interface BinaryStore
Returns:
the minimum number of bytes for a stored binary value; never negative

setMinimumBinarySizeInBytes

public void setMinimumBinarySizeInBytes(long minSizeInBytes)
Description copied from interface: BinaryStore
Set the minimum number of bytes that a binary value must contain before it can be stored in the binary store.

Specified by:
setMinimumBinarySizeInBytes in interface BinaryStore
Parameters:
minSizeInBytes - the minimum number of bytes for a stored binary value; may not be negative

setTextExtractor

public void setTextExtractor(TextExtractor textExtractor)
Description copied from interface: BinaryStore
Set the text extractor that can be used for extracting text from binary content.

Specified by:
setTextExtractor in interface BinaryStore
Parameters:
textExtractor - the text extractor

setMimeTypeDetector

public void setMimeTypeDetector(MimeTypeDetector mimeTypeDetector)
Description copied from interface: BinaryStore
Set the MIME type detector that can be used for determining the MIME type for binary content.

Specified by:
setMimeTypeDetector in interface BinaryStore
Parameters:
mimeTypeDetector - the detector

extractor

protected final TextExtractor extractor()
Get the text extractor that can be used to extract text by this store.

Returns:
the text extractor; never null

detector

protected final MimeTypeDetector detector()
Get the MIME type detector that can be used to find the MIME type for binary content

Returns:
the detector; never null

start

public void start()
Initialize the store and get ready for use.


shutdown

public void shutdown()

ModeShape Distribution 3.0.0.Alpha6

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.