|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.persistence.pool.AbstractBundlePersistenceManager
org.apache.jackrabbit.core.persistence.pool.BundleFsPersistenceManager
public class BundleFsPersistenceManager
This is a generic persistence manager that stores the NodePropBundles
in a filesystem.
blobFSBlockSize" value="0"/>
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 boolean |
initialized
flag indicating if this manager was initialized |
| Fields inherited from class org.apache.jackrabbit.core.persistence.pool.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,
NodeId 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. |
void |
destroy(NodeReferences refs)
Deletes the node references from the underlying system. |
protected void |
destroyBundle(NodePropBundle bundle)
Deletes the bundle from the underlying system. |
protected boolean |
existsBundle(NodeId id)
Checks if a bundle exists in the underlying system. |
boolean |
existsReferencesTo(NodeId targetId)
Checks whether references of the identified target node exist. |
Iterable<NodeId> |
getAllNodeIds(NodeId bigger,
int maxCount)
Get all node ids. |
protected BundleBinding |
getBinding()
Returns the bundle binding that is used for serializing the bundles. |
String |
getBlobFSBlockSize()
Returns the configured block size of the blob cqfs |
String |
getErrorHandling()
Returns the error handling configuration of this manager |
protected NodeId |
getIdFromFileName(String fileName)
|
String |
getMinBlobSize()
Returns the mininum blob size. |
void |
init(PMContext context)
Initializes the persistence manager. |
protected NodePropBundle |
loadBundle(NodeId id)
Loads a bundle from the underlying system. |
NodeReferences |
loadReferencesTo(NodeId targetId)
Load the persisted references to the node with the given identifier. |
protected void |
logException(String message,
SQLException se)
logs an sql exception |
void |
setBlobFSBlockSize(String size)
Sets the block size of the blob fs and controls how blobs are handled. |
void |
setErrorHandling(String errorHandling)
Sets the error handling behaviour of this manager. |
void |
setMinBlobSize(String minBlobSize)
Sets the minimum 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 |
useLocalFsBlobStore()
Returns true if the blobs are stored in the local fs. |
| Methods inherited from class org.apache.jackrabbit.core.persistence.pool.AbstractBundlePersistenceManager |
|---|
buildBlobFilePath, buildNodeFolderPath, buildPropFilePath, checkConsistency, createNew, createNew, evictBundle, 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 BundleFsPersistenceManager.CloseableBLOBStore blobStore
protected ErrorHandling errorHandling
protected BundleBinding binding
| Constructor Detail |
|---|
public BundleFsPersistenceManager()
| Method Detail |
|---|
public String getBlobFSBlockSize()
public void setBlobFSBlockSize(String size)
getMinBlobSize().
size - the block sizepublic boolean useLocalFsBlobStore()
true if the blobs are stored in the local fs.
true if the blobs are stored in the local fs.public String 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 PersistenceManagerinit in class AbstractBundlePersistenceManagercontext - persistence manager context
Exception - if the persistence manager initialization failedprotected BundleBinding getBinding()
getBinding in class AbstractBundlePersistenceManager
public 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. Closes the persistence manager, release acquired resourecs.
close in interface PersistenceManagerclose in class AbstractBundlePersistenceManagerException - if the persistence manager failed to close properly
protected NodePropBundle loadBundle(NodeId id)
throws ItemStateException
loadBundle in class AbstractBundlePersistenceManagerid - 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 AbstractBundlePersistenceManagerid - 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 AbstractBundlePersistenceManagerbuf - buffer to append to or nullid - the id of the node
protected StringBuffer buildNodeReferencesFilePath(StringBuffer buf,
NodeId id)
buildNodeReferencesFilePath in class AbstractBundlePersistenceManagerbuf - buffer to append to or nullid - the id of the node
protected void storeBundle(NodePropBundle bundle)
throws ItemStateException
storeBundle in class AbstractBundlePersistenceManagerbundle - the bundle to store
ItemStateException - if an error while storing occurs.
protected void destroyBundle(NodePropBundle bundle)
throws ItemStateException
destroyBundle in class AbstractBundlePersistenceManagerbundle - the bundle to destroy
ItemStateException - if an error while destroying occurs.
public NodeReferences loadReferencesTo(NodeId targetId)
throws NoSuchItemStateException,
ItemStateException
targetId - reference target node id
NoSuchItemStateException - if the target node does not exist
ItemStateException - if another error occurs
public void store(NodeReferences refs)
throws ItemStateException
store in class AbstractBundlePersistenceManagerrefs - the node references to store.
ItemStateException - if an error while storing occurs.
public void destroy(NodeReferences refs)
throws ItemStateException
destroy in class AbstractBundlePersistenceManagerrefs - the node references to destroy.
ItemStateException - if an error while destroying occurs.
public boolean existsReferencesTo(NodeId targetId)
throws ItemStateException
targetId - target node id
true if the references exist,
false otherwise
ItemStateException - on persistence manager errors
protected void logException(String message,
SQLException se)
message - se - public String toString()
toString in class Object
public Iterable<NodeId> getAllNodeIds(NodeId bigger,
int maxCount)
throws ItemStateException
bigger - the lower limit, or null for no limit.maxCount - the maximum number of node ids to return, or 0 for no limit.
ItemStateException - if an error while loading occurs.protected NodeId getIdFromFileName(String fileName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||