|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager
org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager
public class BundleFsPersistenceManager
This is a generic persistence manager that stores the NodePropBundle
s
in a filesystem.
bundleCacheSize
" value="8"/>
blobFSBlockSize
" value="0"/>
blobFSInitialCacheSize
" value="100"/>
blobFSMaximumCacheSize
" value="4000"/>
blobFSBlockSize
" value="0"/>
blobFSInitialCacheSize
" value="100"/>
blobFSMaximumCacheSize
" value="4000"/>
minBlobSize
" value="4096"/>
errorHandling
" value=""/>
Nested Class Summary | |
---|---|
protected static interface |
BundleFsPersistenceManager.CloseableBLOBStore
Helper interface for closeable stores |
Field Summary | |
---|---|
protected BundleBinding |
binding
the bundle binding |
protected BundleFsPersistenceManager.CloseableBLOBStore |
blobStore
file system where BLOB data is stored |
protected ErrorHandling |
errorHandling
flag for error handling |
protected static int |
INITIAL_BUFFER_SIZE
initial size of buffer used to serialize objects |
protected boolean |
initialized
flag indicating if this manager was initialized |
Fields inherited from class org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager |
---|
context, NODEFILENAME, NODEREFSFILENAME, RES_NAME_INDEX, RES_NS_INDEX |
Constructor Summary | |
---|---|
BundleFsPersistenceManager()
|
Method Summary | |
---|---|
protected StringBuffer |
buildNodeFilePath(StringBuffer buf,
NodeId id)
Creates the file path for the given node id that is suitable for storing node states in a filesystem. |
protected StringBuffer |
buildNodeReferencesFilePath(StringBuffer buf,
NodeReferencesId id)
Creates the file path for the given references id that is suitable for storing reference states in a filesystem. |
void |
close()
Closes the persistence manager. |
protected void |
closeStream(InputStream ins)
closes the input stream |
void |
destroy(NodeReferences refs)
Deletes the node references from the undelying system. |
protected void |
destroyBundle(NodePropBundle bundle)
Deletes the bundle from the underlying system. |
boolean |
exists(NodeReferencesId targetId)
Checks whether references of the identified target node exist. |
protected boolean |
existsBundle(NodeId id)
Checks if a bundle exists in the underlying system. |
String |
getBlobFSBlockSize()
Returns the configured block size of the blob cqfs |
String |
getBlobFSInitialCacheSize()
Returns the configured inital cache size of the blobfs. |
String |
getBlobFSMaximumCacheSize()
Returns the configured maximal size of the blobfs. |
String |
getErrorHandling()
Returns the error handling configuration of this manager |
String |
getItemFSBlockSize()
Returns the configured block size of the item cqfs |
String |
getItemFSInitialCacheSize()
Returns the configured inital cache size of the itemfs. |
String |
getItemFSMaximumCacheSize()
Returns the configured maximal size of the itemfs. |
int |
getMinBlobSize()
Returns the miminum blob size. |
void |
init(PMContext context)
Initializes the persistence manager. The persistence manager is permanently bound to the given context, and any required external resources are acquired. An appropriate exception is thrown if the persistence manager initialization fails for whatever reason. In this case the state of the persistence manager is undefined and the instance should be discarded. Initializes the internal structures of this abstract persistence manager. |
NodeReferences |
load(NodeReferencesId targetId)
Load the persistent members of a node references object. |
protected NodePropBundle |
loadBundle(NodeId id)
Loads a bundle from the underlying system. |
protected void |
logException(String message,
SQLException se)
logs an sql exception |
void |
setBlobFSBlockSize(String size)
Sets the block size of the blob fs and controlls how blobs are handled. |
void |
setBlobFSInitialCacheSize(String size)
Sets the initial cache size of the blob fs. |
void |
setBlobFSMaximumCacheSize(String size)
Sets the maximal cache size of the blob fs. |
void |
setErrorHandling(String errorHandling)
Sets the error handling behaviour of this manager. |
void |
setItemFSBlockSize(String size)
Sets the block size of the item fs. |
void |
setItemFSInitialCacheSize(String size)
Sets the initial cache size of the item fs. |
void |
setItemFSMaximumCacheSize(String size)
Sets the maximal cache size of the item fs. |
void |
setMinBlobSize(String minBlobSize)
Sets the minumum blob size. |
void |
store(NodeReferences refs)
Stores a node references to the underlying system. |
protected void |
storeBundle(NodePropBundle bundle)
Stores a bundle to the underlying system. |
String |
toString()
|
boolean |
useCqFsBlobStore()
Returns true if the blobs are stored in the cqfs. |
boolean |
useItemBlobStore()
Returns true if the blobs are stored in the DB. |
boolean |
useLocalFsBlobStore()
Returns true if the blobs are stored in the local fs. |
Methods inherited from class org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager |
---|
buildBlobFilePath, buildNodeFolderPath, buildPropFilePath, createNew, createNew, exists, exists, getBundleCacheSize, getNameIndex, getNsIndex, load, load, onExternalUpdate, setBundleCacheSize, store |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean initialized
protected static final int INITIAL_BUFFER_SIZE
protected BundleFsPersistenceManager.CloseableBLOBStore blobStore
protected ErrorHandling errorHandling
protected BundleBinding binding
Constructor Detail |
---|
public BundleFsPersistenceManager()
Method Detail |
---|
public String getBlobFSBlockSize()
public void setBlobFSBlockSize(String size)
useCqFsBlobStore()
will return true
.
useLocalFsBlobStore()
will return true
.
useItemBlobStore()
will return true
.
getMinBlobSize()
.
size
- the block sizepublic boolean useItemBlobStore()
true
if the blobs are stored in the DB.
true
if the blobs are stored in the DB.public boolean useLocalFsBlobStore()
true
if the blobs are stored in the local fs.
true
if the blobs are stored in the local fs.public boolean useCqFsBlobStore()
true
if the blobs are stored in the cqfs.
true
if the blobs are stored in the cqfs.public String getBlobFSInitialCacheSize()
public void setBlobFSInitialCacheSize(String size)
useCqFsBlobStore()
returns
true
.
size
- the initial sizepublic String getBlobFSMaximumCacheSize()
public void setBlobFSMaximumCacheSize(String size)
useCqFsBlobStore()
returns
true
.
size
- the maximal sizepublic String getItemFSBlockSize()
public void setItemFSBlockSize(String size)
size
- the block sizepublic String getItemFSInitialCacheSize()
public void setItemFSInitialCacheSize(String size)
size
- the initial sizepublic String getItemFSMaximumCacheSize()
public void setItemFSMaximumCacheSize(String size)
size
- the maximal sizepublic int getMinBlobSize()
public void setMinBlobSize(String minBlobSize)
minBlobSize
- public void setErrorHandling(String errorHandling)
ErrorHandling
for details about the flags.
errorHandling
- public String getErrorHandling()
public void init(PMContext context) throws Exception
An appropriate exception is thrown if the persistence manager initialization fails for whatever reason. In this case the state of the persistence manager is undefined and the instance should be discarded. Initializes the internal structures of this abstract persistence manager.
init
in interface PersistenceManager
init
in class AbstractBundlePersistenceManager
context
- persistence manager context
Exception
- if the persistence manager intialization failedpublic void close() throws Exception
An appropriate exception is thrown if the persistence manager could not be closed properly. In this case the state of the persistence manager is undefined and the instance should be discarded.
Exception
- if the persistence manager failed to close properlyprotected NodePropBundle loadBundle(NodeId id) throws ItemStateException
loadBundle
in class AbstractBundlePersistenceManager
id
- the node id of the bundle
null
if the bundle does not
exist.
ItemStateException
- if an error while loading occurs.protected boolean existsBundle(NodeId id) throws ItemStateException
existsBundle
in class AbstractBundlePersistenceManager
id
- the node id of the bundle
true
if the bundle exists;
false
otherwise.
ItemStateException
- if an error while checking occurs.protected StringBuffer buildNodeFilePath(StringBuffer buf, NodeId id)
buildNodeFilePath
in class AbstractBundlePersistenceManager
buf
- buffer to append to or null
id
- the id of the node
protected StringBuffer buildNodeReferencesFilePath(StringBuffer buf, NodeReferencesId id)
buildNodeReferencesFilePath
in class AbstractBundlePersistenceManager
buf
- buffer to append to or null
id
- the id of the node
protected void storeBundle(NodePropBundle bundle) throws ItemStateException
storeBundle
in class AbstractBundlePersistenceManager
bundle
- the bundle to store
ItemStateException
- if an error while storing occurs.protected void destroyBundle(NodePropBundle bundle) throws ItemStateException
destroyBundle
in class AbstractBundlePersistenceManager
bundle
- the bundle to destroy
ItemStateException
- if an error while destroying occurs.public NodeReferences load(NodeReferencesId targetId) throws NoSuchItemStateException, ItemStateException
load
in interface PersistenceManager
load
in class AbstractBundlePersistenceManager
targetId
- reference target node id
NoSuchItemStateException
- if the target node does not exist
ItemStateException
- if another error occurspublic void store(NodeReferences refs) throws ItemStateException
store
in class AbstractBundlePersistenceManager
refs
- the node references to store.
ItemStateException
- if an error while storing occurs.public void destroy(NodeReferences refs) throws ItemStateException
destroy
in class AbstractBundlePersistenceManager
refs
- the node references to destroy.
ItemStateException
- if an error while destroying occurs.public boolean exists(NodeReferencesId targetId) throws ItemStateException
targetId
- target node id
true
if the references exist,
false
otherwise
ItemStateException
- on persistence manager errorsprotected void closeStream(InputStream ins)
ins
- protected void logException(String message, SQLException se)
message
- se
- public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |