Package org.datanucleus.api.jdo
Class JDOReplicationManager
java.lang.Object
org.datanucleus.api.jdo.JDOReplicationManager
Manager to control the replication of objects from one datastore to another.
Allow replication of specified objects, or all objects of particular types.
Supports a series of properties defining the replication behaviour.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final javax.jdo.PersistenceManagerFactory
PMF for the source datastore.(package private) final javax.jdo.PersistenceManagerFactory
PMF for the target datastore.protected Properties
Properties defining the replication process. -
Constructor Summary
ConstructorsConstructorDescriptionJDOReplicationManager
(javax.jdo.PersistenceManagerFactory pmf1, javax.jdo.PersistenceManagerFactory pmf2) Constructor for replicating between source and target PMF. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
getBooleanProperty
(String key) Accessor for the replication properties.void
Method to perform the replication for all objects of the specified types.void
Method to perform the replication of the objects defined by the supplied identities.void
Method to perform the replication for all objects of the specified class names.protected void
replicateInTarget
(Object... detachedObjects) Method to replicate the provided detached objects in the target datastore.void
Method to perform the replication for all objects registered in the pmf source.void
setProperty
(String key, String value) Method to set a property for replication.
-
Field Details
-
pmfSource
final javax.jdo.PersistenceManagerFactory pmfSourcePMF for the source datastore. -
pmfTarget
final javax.jdo.PersistenceManagerFactory pmfTargetPMF for the target datastore. -
properties
Properties defining the replication process.
-
-
Constructor Details
-
JDOReplicationManager
public JDOReplicationManager(javax.jdo.PersistenceManagerFactory pmf1, javax.jdo.PersistenceManagerFactory pmf2) Constructor for replicating between source and target PMF.- Parameters:
pmf1
- PMF sourcepmf2
- PMF target
-
-
Method Details
-
setProperty
Method to set a property for replication.- Parameters:
key
- Property keyvalue
- Property value
-
getProperties
Accessor for the replication properties. Supported properties include- datanucleus.replicateObjectGraph - whether we replicate the object graph from an object. if this is set we attempt to replicate the graph from this object. Otherwise just the object and its near neighbours.
- Returns:
- Replication properties
-
getBooleanProperty
-
replicate
Method to perform the replication for all objects of the specified types.- Parameters:
types
- Classes to replicate
-
replicate
Method to perform the replication for all objects of the specified class names.- Parameters:
classNames
- Classes to replicate
-
replicate
Method to perform the replication of the objects defined by the supplied identities.- Parameters:
oids
- Identities of the objects to replicate
-
replicateRegisteredClasses
public void replicateRegisteredClasses()Method to perform the replication for all objects registered in the pmf source. -
replicateInTarget
Method to replicate the provided detached objects in the target datastore.- Parameters:
detachedObjects
- The detached objects (from the source datastore)
-