Class BundleDbPersistenceManager.DbBlobStore
- java.lang.Object
-
- org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.DbBlobStore
-
- All Implemented Interfaces:
BundleDbPersistenceManager.CloseableBLOBStore
,BLOBStore
- Enclosing class:
- BundleDbPersistenceManager
protected class BundleDbPersistenceManager.DbBlobStore extends Object implements BundleDbPersistenceManager.CloseableBLOBStore
Implementation of a blob store that stores the data inside the database
-
-
Field Summary
Fields Modifier and Type Field Description protected String
blobDeleteSQL
protected String
blobInsertSQL
protected String
blobSelectExistSQL
protected String
blobSelectSQL
protected String
blobUpdateSQL
-
Constructor Summary
Constructors Constructor Description DbBlobStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
String
createId(PropertyId id, int index)
Creates a unique identifier for the BLOB data associated with the given property id and value subscript.InputStream
get(String blobId)
Retrieves the BLOB data with the specified id as a binary stream.void
put(String blobId, InputStream in, long size)
Stores the BLOB data and returns a unique identifier.boolean
remove(String blobId)
Removes the BLOB data with the specified id.
-
-
-
Constructor Detail
-
DbBlobStore
public DbBlobStore() throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
createId
public String createId(PropertyId id, int index)
Creates a unique identifier for the BLOB data associated with the given property id and value subscript.
-
get
public InputStream get(String blobId) throws Exception
Retrieves the BLOB data with the specified id as a binary stream.- Specified by:
get
in interfaceBLOBStore
- Parameters:
blobId
- identifier of the BLOB data as returned byBLOBStore.createId(PropertyId, int)
- Returns:
- an input stream that delivers the BLOB data
- Throws:
Exception
- if an error occured
-
put
public void put(String blobId, InputStream in, long size) throws Exception
Stores the BLOB data and returns a unique identifier.- Specified by:
put
in interfaceBLOBStore
- Parameters:
blobId
- identifier of the BLOB data as returned byBLOBStore.createId(PropertyId, int)
in
- stream containing the BLOB datasize
- size of the BLOB data- Throws:
Exception
- if an error occured
-
remove
public boolean remove(String blobId) throws Exception
Removes the BLOB data with the specified id.- Specified by:
remove
in interfaceBLOBStore
- Parameters:
blobId
- identifier of the BLOB data as returned byBLOBStore.createId(PropertyId, int)
- Returns:
true
if BLOB data with the given id exists and has been successfully removed,false
if there's no BLOB data with the given id.- Throws:
Exception
- if an error occured
-
close
public void close()
- Specified by:
close
in interfaceBundleDbPersistenceManager.CloseableBLOBStore
-
-