Package org.datanucleus.api.jakarta
Class JakartaReplicationManager
- java.lang.Object
-
- org.datanucleus.api.jakarta.JakartaReplicationManager
-
public class JakartaReplicationManager extends Object
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
Fields Modifier and Type Field Description protected Properties
properties
Properties defining the replication process.
-
Constructor Summary
Constructors Constructor Description JakartaReplicationManager(jakarta.persistence.EntityManagerFactory emf1, jakarta.persistence.EntityManagerFactory emf2)
Constructor for replicating between source and target EMF.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
getBooleanProperty(String key)
Properties
getProperties()
Accessor for the replication properties.void
replicate(Class... types)
Method to perform the replication for all objects of the specified types.void
replicate(Object... oids)
Method to perform the replication of the objects defined by the supplied identities.void
replicate(String... classNames)
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
setProperty(String key, String value)
Method to set a property for replication.
-
-
-
Field Detail
-
properties
protected Properties properties
Properties defining the replication process.
-
-
Method Detail
-
setProperty
public void setProperty(String key, String value)
Method to set a property for replication.- Parameters:
key
- Property keyvalue
- Property value
-
getProperties
public Properties 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
protected boolean getBooleanProperty(String key)
-
replicate
public void replicate(Class... types)
Method to perform the replication for all objects of the specified types.- Parameters:
types
- Classes to replicate
-
replicate
public void replicate(String... classNames)
Method to perform the replication for all objects of the specified class names.- Parameters:
classNames
- Classes to replicate
-
replicate
public void replicate(Object... oids)
Method to perform the replication of the objects defined by the supplied identities.- Parameters:
oids
- Identities of the objects to replicate
-
replicateInTarget
protected void replicateInTarget(Object... detachedObjects)
Method to replicate the provided detached objects in the target datastore.- Parameters:
detachedObjects
- The detached objects (from the source datastore)
-
-