public class SQLBinaryManager extends CachingBinaryManager
The BLOBs are cached locally on first access for efficiency.
Because the BLOB length can be accessed independently of the binary stream, it is also cached in a simple text file if accessed before the stream.
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
SQLBinaryManager.SQLBinaryGarbageCollector  | 
class  | 
SQLBinaryManager.SQLFileStorage  | 
| Modifier and Type | Field and Description | 
|---|---|
static String | 
CACHE_SIZE_PREFIX  | 
static String | 
CACHE_SIZE_PROP  | 
protected String | 
checkSql  | 
static String | 
COL_BIN  | 
static String | 
COL_ID  | 
static String | 
COL_MARK  | 
protected String | 
dataSourceName  | 
static String | 
DEFAULT_CACHE_SIZE  | 
protected static boolean | 
disableCheckExisting  | 
static String | 
DS_PREFIX  | 
static String | 
DS_PROP  | 
protected String | 
gcMarkSql  | 
protected String | 
gcStartSql  | 
protected String | 
gcStatsSql  | 
protected String | 
gcSweepSql  | 
protected String | 
getSql  | 
protected String | 
putSql  | 
protected static boolean | 
resetCache  | 
static String | 
TABLE_PREFIX  | 
static String | 
TABLE_PROP  | 
cachedir, fileCache, fileStorageblobProviderId, DEFAULT_DEPTH, DEFAULT_DIGEST, descriptor, DIGESTS_BY_LENGTH, garbageCollector, MAX_BUF_SIZE, MD5_DIGEST, MD5_DIGEST_LENGTH, MIN_BUF_SIZE, SHA1_DIGEST, SHA1_DIGEST_LENGTH, SHA256_DIGEST, SHA256_DIGEST_LENGTHPROP_KEY, PROP_PATH| Constructor and Description | 
|---|
SQLBinaryManager()  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
createGarbageCollector()  | 
protected void | 
createSql(String tableName)  | 
Binary | 
getBinary(InputStream in)
Creates a binary value from the given input stream. 
 | 
Binary | 
getBinary(String digest)
Returns a  
Binary corresponding to the given digest. | 
protected Connection | 
getConnection()  | 
protected Dialect | 
getDialect()  | 
void | 
initialize(String blobProviderId,
          Map<String,String> properties)
Initializes the binary manager. 
 | 
protected static boolean | 
isDuplicateKeyException(SQLException e)  | 
protected static String | 
loggedValue(Serializable value)  | 
protected static void | 
logSQL(String sql,
      Serializable... values)  | 
close, getFile, initializeCache, initializeCache, initializeCachegetBinary, getDefaultDigestAlgorithm, getDescriptor, getDigestAlgorithm, getGarbageCollector, removeBinaries, storeAndDigest, toHexStringpublic static final String DS_PROP
public static final String DS_PREFIX
public static final String TABLE_PROP
public static final String TABLE_PREFIX
public static final String CACHE_SIZE_PROP
public static final String CACHE_SIZE_PREFIX
public static final String DEFAULT_CACHE_SIZE
public static final String COL_ID
public static final String COL_BIN
public static final String COL_MARK
protected String dataSourceName
protected String gcStartSql
protected String gcStatsSql
protected String gcSweepSql
protected static boolean disableCheckExisting
protected static boolean resetCache
public SQLBinaryManager()
public void initialize(String blobProviderId, Map<String,String> properties) throws IOException
BinaryManagerinitialize in interface BinaryManagerinitialize in class CachingBinaryManagerblobProviderId - the blob provider id for this binary managerproperties - initialization propertiesIOExceptionprotected void createGarbageCollector()
protected void createSql(String tableName) throws IOException
IOExceptionprotected Dialect getDialect() throws IOException
IOExceptionprotected Connection getConnection() throws SQLException
SQLExceptionprotected static void logSQL(String sql, Serializable... values)
protected static String loggedValue(Serializable value)
protected static boolean isDuplicateKeyException(SQLException e)
public Binary getBinary(String digest)
BinaryManagerBinary corresponding to the given digest.
 
 A null is returned if the digest could not be found.
getBinary in interface BinaryManagergetBinary in class CachingBinaryManagerdigest - the digest, or nullpublic Binary getBinary(InputStream in) throws IOException
AbstractBinaryManagergetBinary in class CachingBinaryManagerIOExceptionCopyright © 2019 Nuxeo. All rights reserved.