Class BundleDbPersistenceManager
- java.lang.Object
-
- org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager
-
- org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager
-
- All Implemented Interfaces:
CacheAccessListener
,CachingPersistenceManager
,ConsistencyChecker
,IterablePersistenceManager
,PersistenceManager
,DatabaseAware
- Direct Known Subclasses:
DerbyPersistenceManager
,H2PersistenceManager
,MSSqlPersistenceManager
,MySqlPersistenceManager
,OraclePersistenceManager
,PostgreSQLPersistenceManager
public class BundleDbPersistenceManager extends AbstractBundlePersistenceManager implements DatabaseAware
This is a generic persistence manager that stores theNodePropBundle
s in a database.Configuration:
- <param name="
bundleCacheSize
" value="8"/> - <param name="
consistencyCheck
" value="false"/> - <param name="
consistencyFix
" value="false"/> - <param name="
minBlobSize
" value="4096"/> - <param name="
driver
" value=""/> - <param name="
url
" value=""/> - <param name="
user
" value=""/> - <param name="
password
" value=""/> - <param name="
databaseType
" value=""/> - <param name="
schemaObjectPrefix
" value=""/> - <param name="
errorHandling
" value=""/> - <param name="
blockOnConnectionLoss
" value="false"/> - <param name="
schemaCheckEnabled
" value="true"/>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
BundleDbPersistenceManager.CloseableBLOBStore
Helper interface for closeable storesprotected class
BundleDbPersistenceManager.DbBlobStore
Implementation of a blob store that stores the data inside the databaseprotected class
BundleDbPersistenceManager.FSBlobStore
own implementation of the filesystem blob store that uses a different blob-id scheme.
-
Field Summary
Fields Modifier and Type Field Description protected BundleBinding
binding
the bundle bindingprotected BundleDbPersistenceManager.CloseableBLOBStore
blobStore
file system where BLOB data is storedprotected boolean
blockOnConnectionLoss
indicates whether to block if the database connection is lostprotected String
bundleDeleteSQL
protected String
bundleInsertSQL
protected String
bundleSelectAllBundlesFromSQL
protected String
bundleSelectAllBundlesSQL
protected String
bundleSelectAllIdsFromSQL
protected String
bundleSelectAllIdsSQL
protected String
bundleSelectSQL
protected String
bundleUpdateSQL
protected ConnectionHelper
conHelper
theConnectionHelper
set in theinit(PMContext)
methodprotected boolean
consistencyCheck
flag indicating if a consistency check should be issued during startupprotected boolean
consistencyFix
flag indicating if the consistency check should attempt to fix issuesprotected String
databaseType
the database typeprotected String
dataSourceName
the logical name of the data source to useprotected String
driver
the jdbc driver nameprotected ErrorHandling
errorHandling
flag for error handlingprotected boolean
externalBLOBs
indicates if uses (filesystem) blob storeprotected static int
INITIAL_BUFFER_SIZE
initial size of buffer used to serialize objectsprotected boolean
initialized
flag indicating if this manager was initializedprotected String
nodeReferenceDeleteSQL
protected String
nodeReferenceInsertSQL
protected String
nodeReferenceSelectSQL
protected String
nodeReferenceUpdateSQL
protected String
password
the jdbc passwordprotected String
schemaObjectPrefix
the prefix for the database objectsstatic int
SM_BINARY_KEYS
storage model modifier: binary keysstatic int
SM_LONGLONG_KEYS
storage model modifier: longlong keysprotected String
url
the jdbc url stringprotected String
user
the jdbc user-
Fields inherited from class org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager
context, NODEFILENAME, NODEREFSFILENAME, RES_NAME_INDEX, RES_NS_INDEX
-
Fields inherited from interface org.apache.jackrabbit.core.cache.CacheAccessListener
ACCESS_INTERVAL
-
-
Constructor Summary
Constructors Constructor Description BundleDbPersistenceManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
buildSQLStatements()
Initializes the SQL strings.void
close()
Closes the persistence manager.protected BundleDbPersistenceManager.CloseableBLOBStore
createBlobStore()
Creates a suitable blobstoreprotected CheckSchemaOperation
createCheckSchemaOperation()
This method is called frominit(PMContext)
after thecreateConnectionHelper(DataSource)
method, and returns a defaultCheckSchemaOperation
.protected ConnectionHelper
createConnectionHelper(DataSource dataSrc)
This method is called from theinit(PMContext)
method of this class and returns aConnectionHelper
instance which is assigned to theconHelper
field.protected BundleDbPersistenceManager.CloseableBLOBStore
createDBBlobStore(PMContext context)
Creates a blob store that uses the database.protected DbNameIndex
createDbNameIndex()
Returns a new instance of a DbNameIndex.protected BundleDbPersistenceManager.CloseableBLOBStore
createLocalFSBlobStore(PMContext context)
Creates a blob store that is based on a local fs.protected Object[]
createParams(NodeId id, Object p, boolean before)
Creates a parameter array for an SQL statement that needs (i) a node identifier, and (2) another parameter.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.List<NodeId>
getAllNodeIds(NodeId bigger, int maxCount)
Get all node ids.Map<NodeId,NodeInfo>
getAllNodeInfos(NodeId bigger, int maxCount)
Get allNodeInfo
s.protected BLOBStore
getBlobStore()
Returns the BLOB store used by this persistence manager.String
getBlockOnConnectionLoss()
String
getConsistencyCheck()
Checks if consistency check is enabled.String
getConsistencyFix()
Checks if consistency fix is enabled.String
getDatabaseType()
Returns the configured database type name.String
getDataSourceName()
String
getDriver()
Returns the class name of the JDBC driver.String
getErrorHandling()
Returns the error handling configuration of this managerprotected Object[]
getKey(NodeId id)
Constructs a parameter list for a PreparedStatement for the given node identifier.String
getMinBlobSize()
Returns the minimum blob size in bytes.StringIndex
getNameIndex()
Returns the local name indexString
getPassword()
Returns the configured password that is used to establish JDBC connections.String
getSchema()
Deprecated.This method is deprecated;getDatabaseType()
should be used instead.String
getSchemaObjectPrefix()
Returns the configured schema object prefix.int
getStorageModel()
returns the storage modelString
getUrl()
Returns the configured JDBC connection url.String
getUser()
Returns the configured user that is used to establish JDBC connections.void
init(PMContext context)
Initializes the persistence manager.boolean
isExternalBLOBs()
Returns if uses external (filesystem) blob store.boolean
isSchemaCheckEnabled()
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.void
setBlockOnConnectionLoss(String block)
void
setConnectionFactory(ConnectionFactory connectionFactory)
void
setConsistencyCheck(String consistencyCheck)
Defines if a consistency check is to be performed on initialization.void
setConsistencyFix(String consistencyFix)
Defines if the consistency check should attempt to fix issues that it finds.void
setDatabaseType(String databaseType)
Sets the database type.void
setDataSourceName(String dataSourceName)
void
setDriver(String driver)
Sets the class name of the JDBC driver.void
setErrorHandling(String errorHandling)
Sets the error handling behaviour of this manager.void
setExternalBLOBs(boolean externalBLOBs)
Sets the flag for external (filesystem) blob store usage.void
setMinBlobSize(String minBlobSize)
Sets the minimum blob size.void
setPassword(String password)
Sets the password that will be used to establish JDBC connections.void
setSchema(String databaseType)
Deprecated.This method is deprecated;setDatabaseType(java.lang.String)
should be used instead.void
setSchemaCheckEnabled(boolean enabled)
void
setSchemaObjectPrefix(String schemaObjectPrefix)
Sets the schema object prefix.void
setUrl(String url)
Sets the JDBC connection URL.void
setUser(String user)
Sets the user name that will be used to establish JDBC connections.void
store(ChangeLog changeLog)
Right now, this iterates over all items in the changelog and calls the individual methods that handle single item states or node references objects.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
useDbBlobStore()
Returnstrue
if the blobs are stored in the DB.boolean
useLocalFsBlobStore()
Returnstrue
if the blobs are stored in the local fs.-
Methods inherited from class org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager
buildBlobFilePath, buildNodeFilePath, buildNodeFolderPath, buildNodeReferencesFilePath, buildPropFilePath, cacheAccessed, check, checkConsistency, createNew, createNew, disposeCache, evictBundle, exists, exists, getBundleCacheSize, getNsIndex, load, load, onExternalUpdate, setBundleCacheSize, setEventChannel
-
-
-
-
Field Detail
-
SM_BINARY_KEYS
public static final int SM_BINARY_KEYS
storage model modifier: binary keys- See Also:
- Constant Field Values
-
SM_LONGLONG_KEYS
public static final int SM_LONGLONG_KEYS
storage model modifier: longlong keys- See Also:
- Constant Field Values
-
initialized
protected boolean initialized
flag indicating if this manager was initialized
-
driver
protected String driver
the jdbc driver name
-
url
protected String url
the jdbc url string
-
user
protected String user
the jdbc user
-
password
protected String password
the jdbc password
-
databaseType
protected String databaseType
the database type
-
dataSourceName
protected String dataSourceName
the logical name of the data source to use
-
conHelper
protected ConnectionHelper conHelper
theConnectionHelper
set in theinit(PMContext)
method
-
schemaObjectPrefix
protected String schemaObjectPrefix
the prefix for the database objects
-
consistencyCheck
protected boolean consistencyCheck
flag indicating if a consistency check should be issued during startup
-
consistencyFix
protected boolean consistencyFix
flag indicating if the consistency check should attempt to fix issues
-
INITIAL_BUFFER_SIZE
protected static final int INITIAL_BUFFER_SIZE
initial size of buffer used to serialize objects- See Also:
- Constant Field Values
-
externalBLOBs
protected boolean externalBLOBs
indicates if uses (filesystem) blob store
-
blockOnConnectionLoss
protected boolean blockOnConnectionLoss
indicates whether to block if the database connection is lost
-
bundleInsertSQL
protected String bundleInsertSQL
-
bundleUpdateSQL
protected String bundleUpdateSQL
-
bundleSelectSQL
protected String bundleSelectSQL
-
bundleDeleteSQL
protected String bundleDeleteSQL
-
bundleSelectAllIdsFromSQL
protected String bundleSelectAllIdsFromSQL
-
bundleSelectAllIdsSQL
protected String bundleSelectAllIdsSQL
-
bundleSelectAllBundlesFromSQL
protected String bundleSelectAllBundlesFromSQL
-
bundleSelectAllBundlesSQL
protected String bundleSelectAllBundlesSQL
-
nodeReferenceInsertSQL
protected String nodeReferenceInsertSQL
-
nodeReferenceUpdateSQL
protected String nodeReferenceUpdateSQL
-
nodeReferenceSelectSQL
protected String nodeReferenceSelectSQL
-
nodeReferenceDeleteSQL
protected String nodeReferenceDeleteSQL
-
blobStore
protected BundleDbPersistenceManager.CloseableBLOBStore blobStore
file system where BLOB data is stored
-
errorHandling
protected ErrorHandling errorHandling
flag for error handling
-
binding
protected BundleBinding binding
the bundle binding
-
-
Method Detail
-
setConnectionFactory
public void setConnectionFactory(ConnectionFactory connectionFactory)
- Specified by:
setConnectionFactory
in interfaceDatabaseAware
-
getUrl
public String getUrl()
Returns the configured JDBC connection url.- Returns:
- the configured JDBC connection url.
-
setUrl
public void setUrl(String url)
Sets the JDBC connection URL. The connection can be created using a JNDI Data Source as well. To do that, the driver class name must reference a javax.naming.Context class (for example javax.naming.InitialContext), and the URL must be the JNDI URL (for example java:comp/env/jdbc/Test).- Parameters:
url
- the url to set.
-
getUser
public String getUser()
Returns the configured user that is used to establish JDBC connections.- Returns:
- the JDBC user.
-
setUser
public void setUser(String user)
Sets the user name that will be used to establish JDBC connections.- Parameters:
user
- the user name.
-
getPassword
public String getPassword()
Returns the configured password that is used to establish JDBC connections.- Returns:
- the password.
-
setPassword
public void setPassword(String password)
Sets the password that will be used to establish JDBC connections.- Parameters:
password
- the password for the connection
-
getDriver
public String getDriver()
Returns the class name of the JDBC driver.- Returns:
- the class name of the JDBC driver.
-
setDriver
public void setDriver(String driver)
Sets the class name of the JDBC driver. The driver class will be loaded duringinit
in order to assure the existence. If no driver is specified, the default driver for the database is used.- Parameters:
driver
- the class name of the driver
-
getSchemaObjectPrefix
public String getSchemaObjectPrefix()
Returns the configured schema object prefix.- Returns:
- the configured schema object prefix.
-
setSchemaObjectPrefix
public void setSchemaObjectPrefix(String schemaObjectPrefix)
Sets the schema object prefix. This string is used to prefix all schema objects, like tables and indexes. this is useful, if several persistence managers use the same database.- Parameters:
schemaObjectPrefix
- the prefix for schema objects.
-
getSchema
@Deprecated public String getSchema()
Deprecated.This method is deprecated;getDatabaseType()
should be used instead.Returns the configured database type name.- Returns:
- the database type name.
-
getDatabaseType
public String getDatabaseType()
Returns the configured database type name.- Returns:
- the database type name.
-
setSchema
@Deprecated public void setSchema(String databaseType)
Deprecated.This method is deprecated;setDatabaseType(java.lang.String)
should be used instead.Sets the database type. This identifier is used to load and execute the respective .ddl resource in order to create the required schema objects.- Parameters:
databaseType
- database type name
-
setDatabaseType
public void setDatabaseType(String databaseType)
Sets the database type. This identifier is used to load and execute the respective .ddl resource in order to create the required schema objects.- Parameters:
databaseType
- database type name
-
getDataSourceName
public String getDataSourceName()
-
setDataSourceName
public void setDataSourceName(String dataSourceName)
-
isExternalBLOBs
public boolean isExternalBLOBs()
Returns if uses external (filesystem) blob store.- Returns:
- if uses external (filesystem) blob store.
-
setExternalBLOBs
public void setExternalBLOBs(boolean externalBLOBs)
Sets the flag for external (filesystem) blob store usage.- Parameters:
externalBLOBs
- a value of "true" indicates that an external blob store is to be used.
-
getConsistencyCheck
public String getConsistencyCheck()
Checks if consistency check is enabled.- Returns:
true
if consistency check is enabled.
-
setConsistencyCheck
public void setConsistencyCheck(String consistencyCheck)
Defines if a consistency check is to be performed on initialization.- Parameters:
consistencyCheck
- the consistency check flag.
-
getConsistencyFix
public String getConsistencyFix()
Checks if consistency fix is enabled.- Returns:
true
if consistency fix is enabled.
-
setConsistencyFix
public void setConsistencyFix(String consistencyFix)
Defines if the consistency check should attempt to fix issues that it finds.- Parameters:
consistencyFix
- the consistency fix flag.
-
getMinBlobSize
public String getMinBlobSize()
Returns the minimum blob size in bytes.- Returns:
- the minimum blob size in bytes.
-
setMinBlobSize
public void setMinBlobSize(String minBlobSize)
Sets the minimum blob size. This size defines the threshold of which size a property is included in the bundle or is stored in the blob store.- Parameters:
minBlobSize
- the minimum blob size in bytes.
-
setErrorHandling
public void setErrorHandling(String errorHandling)
Sets the error handling behaviour of this manager. SeeErrorHandling
for details about the flags.- Parameters:
errorHandling
- the error handling flags
-
getErrorHandling
public String getErrorHandling()
Returns the error handling configuration of this manager- Returns:
- the error handling configuration of this manager
-
setBlockOnConnectionLoss
public void setBlockOnConnectionLoss(String block)
-
getBlockOnConnectionLoss
public String getBlockOnConnectionLoss()
-
useDbBlobStore
public boolean useDbBlobStore()
Returnstrue
if the blobs are stored in the DB.- Returns:
true
if the blobs are stored in the DB.
-
useLocalFsBlobStore
public boolean useLocalFsBlobStore()
Returnstrue
if the blobs are stored in the local fs.- Returns:
true
if the blobs are stored in the local fs.
-
isSchemaCheckEnabled
public final boolean isSchemaCheckEnabled()
- Returns:
- whether the schema check is enabled
-
setSchemaCheckEnabled
public final void setSchemaCheckEnabled(boolean enabled)
- Parameters:
enabled
- set whether the schema check is enabled
-
store
public void store(ChangeLog changeLog) throws ItemStateException
Right now, this iterates over all items in the changelog and calls the individual methods that handle single item states or node references objects. Properly implemented, this method should ensure that changes are either written completely to the underlying persistence layer, or not at all. Atomically saves the given set of changes. Basically wraps a JDBC transaction around super.store(). FIXME: the retry logic is almost a duplicate ofConnectionHelper.RetryManager
.- Specified by:
store
in interfacePersistenceManager
- Overrides:
store
in classAbstractBundlePersistenceManager
- Parameters:
changeLog
- change log containing states that were changed- Throws:
ItemStateException
- if the changes could not be saved
-
init
public void init(PMContext context) throws Exception
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.
- Specified by:
init
in interfacePersistenceManager
- Overrides:
init
in classAbstractBundlePersistenceManager
- Parameters:
context
- persistence manager context- Throws:
Exception
- if the persistence manager initialization failed
-
createConnectionHelper
protected ConnectionHelper createConnectionHelper(DataSource dataSrc) throws Exception
This method is called from theinit(PMContext)
method of this class and returns aConnectionHelper
instance which is assigned to theconHelper
field. Subclasses may override it to return a specialized connection helper.- Parameters:
dataSrc
- theDataSource
of this persistence manager- Returns:
- a
ConnectionHelper
- Throws:
Exception
- on error
-
createCheckSchemaOperation
protected CheckSchemaOperation createCheckSchemaOperation()
This method is called frominit(PMContext)
after thecreateConnectionHelper(DataSource)
method, and returns a defaultCheckSchemaOperation
. Subclasses can overrride this implementation to get a customized implementation.- Returns:
- a new
CheckSchemaOperation
instance
-
getBlobStore
protected BLOBStore getBlobStore()
Returns the BLOB store used by this persistence manager.- Specified by:
getBlobStore
in classAbstractBundlePersistenceManager
- Returns:
- BLOB store
-
createBlobStore
protected BundleDbPersistenceManager.CloseableBLOBStore createBlobStore() throws Exception
Creates a suitable blobstore- Returns:
- a blobstore
- Throws:
Exception
- if an unspecified error occurs
-
getNameIndex
public StringIndex getNameIndex()
Returns the local name index- Overrides:
getNameIndex
in classAbstractBundlePersistenceManager
- Returns:
- the local name index
- Throws:
IllegalStateException
- if an error occurs.
-
createDbNameIndex
protected DbNameIndex createDbNameIndex() throws SQLException
Returns a new instance of a DbNameIndex.- Returns:
- a new instance of a DbNameIndex.
- Throws:
SQLException
- if an SQL error occurs.
-
getStorageModel
public int getStorageModel()
returns the storage model- Returns:
- the storage model
-
createLocalFSBlobStore
protected BundleDbPersistenceManager.CloseableBLOBStore createLocalFSBlobStore(PMContext context) throws Exception
Creates a blob store that is based on a local fs. This is called by init ifuseLocalFsBlobStore()
returnstrue
.- Parameters:
context
- the persistence manager context- Returns:
- a blob store
- Throws:
Exception
- if an error occurs.
-
createDBBlobStore
protected BundleDbPersistenceManager.CloseableBLOBStore createDBBlobStore(PMContext context) throws Exception
Creates a blob store that uses the database. This is called by init ifuseDbBlobStore()
returnstrue
.- Parameters:
context
- the persistence manager context- Returns:
- a blob store
- Throws:
Exception
- if an error occurs.
-
close
public void close() throws Exception
Closes the persistence manager. The consistency of the persistent storage is guaranteed and all acquired resources are released. It is an error to invoke any methods on a closed persistence manager, and implementations are free to enforce this constraint by throwing IllegalStateExceptions in such cases.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.
- Specified by:
close
in interfacePersistenceManager
- Overrides:
close
in classAbstractBundlePersistenceManager
- Throws:
Exception
- if the persistence manager failed to close properly
-
getKey
protected Object[] getKey(NodeId id)
Constructs a parameter list for a PreparedStatement for the given node identifier.- Parameters:
id
- the node id- Returns:
- a list of Objects
-
createParams
protected Object[] createParams(NodeId id, Object p, boolean before)
Creates a parameter array for an SQL statement that needs (i) a node identifier, and (2) another parameter.- Parameters:
id
- the node idp
- the other parameterbefore
- whether the other parameter should be before the uuid parameter- Returns:
- an Object array that represents the parameters
-
getAllNodeIds
public List<NodeId> getAllNodeIds(NodeId bigger, int maxCount) throws ItemStateException, RepositoryException
Get all node ids. A typical application will call this method multiple times, where 'after' is the last row read previously. The maxCount parameter defines the maximum number of node ids returned, 0 meaning no limit. The order of the node ids is specific for the given persistent manager. Items that are added concurrently may not be included.- Specified by:
getAllNodeIds
in interfaceIterablePersistenceManager
- Parameters:
bigger
- the lower limit, or null for no limit.maxCount
- the maximum number of node ids to return, or 0 for no limit.- Returns:
- a list of all node ids.
- Throws:
ItemStateException
- if an error while loading occurs.RepositoryException
- if a repository exception occurs.
-
getAllNodeInfos
public Map<NodeId,NodeInfo> getAllNodeInfos(NodeId bigger, int maxCount) throws ItemStateException
Get allNodeInfo
s. A typical application will call this method multiple time, where 'after' is the last row read previously. The maxCount parameter defines the maximum number of node ids returned, 0 meaning no limit. The order of the node ids is specific for the given persistence manager. Items that are added concurrently may not be included.- Specified by:
getAllNodeInfos
in interfaceIterablePersistenceManager
- Overrides:
getAllNodeInfos
in classAbstractBundlePersistenceManager
- Parameters:
bigger
- the lower limit, or null for no limit.maxCount
- the maximum number of node infos to return, or 0 for no limit.- Returns:
- a list of all node infos.
- Throws:
ItemStateException
- if an error while loading occurs.
-
loadBundle
protected NodePropBundle loadBundle(NodeId id) throws ItemStateException
Loads a bundle from the underlying system.- Specified by:
loadBundle
in classAbstractBundlePersistenceManager
- Parameters:
id
- the node id of the bundle- Returns:
- the loaded bundle or
null
if the bundle does not exist. - Throws:
ItemStateException
- if an error while loading occurs.
-
storeBundle
protected void storeBundle(NodePropBundle bundle) throws ItemStateException
Stores a bundle to the underlying system.- Specified by:
storeBundle
in classAbstractBundlePersistenceManager
- Parameters:
bundle
- the bundle to store- Throws:
ItemStateException
- if an error while storing occurs.
-
destroyBundle
protected void destroyBundle(NodePropBundle bundle) throws ItemStateException
Deletes the bundle from the underlying system.- Specified by:
destroyBundle
in classAbstractBundlePersistenceManager
- Parameters:
bundle
- the bundle to destroy- Throws:
ItemStateException
- if an error while destroying occurs.
-
loadReferencesTo
public NodeReferences loadReferencesTo(NodeId targetId) throws NoSuchItemStateException, ItemStateException
Load the persisted references to the node with the given identifier.- Specified by:
loadReferencesTo
in interfacePersistenceManager
- Parameters:
targetId
- reference target node id- Throws:
NoSuchItemStateException
- if the target node does not existItemStateException
- if another error occurs
-
store
public void store(NodeReferences refs) throws ItemStateException
Stores a node references to the underlying system. This method uses sharedPreparedStatements
, which must be used strictly sequentially. Because this method synchronizes on the persistence manager instance, there is no need to synchronize on the shared statement. If the method would not be synchronized, the shared statement must be synchronized.- Specified by:
store
in classAbstractBundlePersistenceManager
- Parameters:
refs
- the node references to store.- Throws:
ItemStateException
- if an error while storing occurs.
-
destroy
public void destroy(NodeReferences refs) throws ItemStateException
Deletes the node references from the underlying system.- Specified by:
destroy
in classAbstractBundlePersistenceManager
- Parameters:
refs
- the node references to destroy.- Throws:
ItemStateException
- if an error while destroying occurs.
-
existsReferencesTo
public boolean existsReferencesTo(NodeId targetId) throws ItemStateException
Checks whether references of the identified target node exist.- Specified by:
existsReferencesTo
in interfacePersistenceManager
- Parameters:
targetId
- target node id- Returns:
true
if the references exist,false
otherwise- Throws:
ItemStateException
- on persistence manager errors
-
buildSQLStatements
protected void buildSQLStatements()
Initializes the SQL strings.
-
-