|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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.
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.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,
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. |
boolean |
existsReferencesTo(NodeId targetId)
Checks whether references of the identified target node exist. |
Iterable<NodeId> |
getAllNodeIds(NodeId bigger,
int maxCount)
Get all node ids. |
String |
getBlobFSBlockSize()
Returns the configured block size of the blob cqfs |
protected BLOBStore |
getBlobStore()
Returns the BLOB store used by this persistence manager. |
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.bundle.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 PersistenceManager
init
in class AbstractBundlePersistenceManager
context
- persistence manager context
Exception
- if the persistence manager initialization failedprotected BLOBStore getBlobStore()
getBlobStore
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 resources.
close
in interface PersistenceManager
close
in class AbstractBundlePersistenceManager
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 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, NodeId 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 loadReferencesTo(NodeId targetId) throws NoSuchItemStateException, ItemStateException
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 existsReferencesTo(NodeId targetId) throws ItemStateException
targetId
- target node id
true
if the references exist,
false
otherwise
ItemStateException
- on persistence manager errorsprotected 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 |