org.apache.jackrabbit.core.persistence.bundle
Class BundleDbPersistenceManager.DbBlobStore

java.lang.Object
  extended by org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.DbBlobStore
All Implemented Interfaces:
BundleDbPersistenceManager.CloseableBLOBStore, BLOBStore
Enclosing class:
BundleDbPersistenceManager

protected class BundleDbPersistenceManager.DbBlobStore
extends java.lang.Object
implements BundleDbPersistenceManager.CloseableBLOBStore

Implementation of a blob store that stores the data inside the database


Field Summary
protected  java.lang.String blobDeleteSQL
           
protected  java.lang.String blobInsertSQL
           
protected  java.lang.String blobSelectExistSQL
           
protected  java.lang.String blobSelectSQL
           
protected  java.lang.String blobUpdateSQL
           
 
Constructor Summary
BundleDbPersistenceManager.DbBlobStore()
           
 
Method Summary
 void close()
           
 java.lang.String createId(PropertyId id, int index)
          Creates a unique identifier for the BLOB data associated with the given property id and value subscript.
 java.io.InputStream get(java.lang.String blobId)
          Retrieves the BLOB data with the specified id as a binary stream.
 void put(java.lang.String blobId, java.io.InputStream in, long size)
          Stores the BLOB data and returns a unique identifier.
 boolean remove(java.lang.String blobId)
          Removes the BLOB data with the specified id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blobInsertSQL

protected java.lang.String blobInsertSQL

blobUpdateSQL

protected java.lang.String blobUpdateSQL

blobSelectSQL

protected java.lang.String blobSelectSQL

blobSelectExistSQL

protected java.lang.String blobSelectExistSQL

blobDeleteSQL

protected java.lang.String blobDeleteSQL
Constructor Detail

BundleDbPersistenceManager.DbBlobStore

public BundleDbPersistenceManager.DbBlobStore()
                                       throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

createId

public java.lang.String createId(PropertyId id,
                                 int index)
Creates a unique identifier for the BLOB data associated with the given property id and value subscript.

Specified by:
createId in interface BLOBStore
Parameters:
id - id of the property associated with the BLOB data
index - subscript of the value holding the BLOB data
Returns:
a string identifying the BLOB data

get

public java.io.InputStream get(java.lang.String blobId)
                        throws java.lang.Exception
Retrieves the BLOB data with the specified id as a binary stream.

Specified by:
get in interface BLOBStore
Parameters:
blobId - identifier of the BLOB data as returned by BLOBStore.createId(PropertyId, int)
Returns:
an input stream that delivers the BLOB data
Throws:
java.lang.Exception - if an error occured

put

public void put(java.lang.String blobId,
                java.io.InputStream in,
                long size)
         throws java.lang.Exception
Stores the BLOB data and returns a unique identifier.

Specified by:
put in interface BLOBStore
Parameters:
blobId - identifier of the BLOB data as returned by BLOBStore.createId(PropertyId, int)
in - stream containing the BLOB data
size - size of the BLOB data
Throws:
java.lang.Exception - if an error occured

remove

public boolean remove(java.lang.String blobId)
               throws java.lang.Exception
Removes the BLOB data with the specified id.

Specified by:
remove in interface BLOBStore
Parameters:
blobId - identifier of the BLOB data as returned by BLOBStore.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:
java.lang.Exception - if an error occured

close

public void close()
Specified by:
close in interface BundleDbPersistenceManager.CloseableBLOBStore


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.