Class JDOReplicationManager


  • public class JDOReplicationManager
    extends java.lang.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
      (package private) javax.jdo.PersistenceManagerFactory pmfSource
      PMF for the source datastore.
      (package private) javax.jdo.PersistenceManagerFactory pmfTarget
      PMF for the target datastore.
      protected java.util.Properties properties
      Properties defining the replication process.
    • Constructor Summary

      Constructors 
      Constructor Description
      JDOReplicationManager​(javax.jdo.PersistenceManagerFactory pmf1, javax.jdo.PersistenceManagerFactory pmf2)
      Constructor for replicating between source and target PMF.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean getBooleanProperty​(java.lang.String key)  
      java.util.Properties getProperties()
      Accessor for the replication properties.
      void replicate​(java.lang.Class... types)
      Method to perform the replication for all objects of the specified types.
      void replicate​(java.lang.Object... oids)
      Method to perform the replication of the objects defined by the supplied identities.
      void replicate​(java.lang.String... classNames)
      Method to perform the replication for all objects of the specified class names.
      protected void replicateInTarget​(java.lang.Object... detachedObjects)
      Method to replicate the provided detached objects in the target datastore.
      void replicateRegisteredClasses()
      Method to perform the replication for all objects registered in the pmf source.
      void setProperty​(java.lang.String key, java.lang.String value)
      Method to set a property for replication.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pmfSource

        final javax.jdo.PersistenceManagerFactory pmfSource
        PMF for the source datastore.
      • pmfTarget

        final javax.jdo.PersistenceManagerFactory pmfTarget
        PMF for the target datastore.
      • properties

        protected java.util.Properties properties
        Properties defining the replication process.
    • Constructor Detail

      • JDOReplicationManager

        public JDOReplicationManager​(javax.jdo.PersistenceManagerFactory pmf1,
                                     javax.jdo.PersistenceManagerFactory pmf2)
        Constructor for replicating between source and target PMF.
        Parameters:
        pmf1 - PMF source
        pmf2 - PMF target
    • Method Detail

      • setProperty

        public void setProperty​(java.lang.String key,
                                java.lang.String value)
        Method to set a property for replication.
        Parameters:
        key - Property key
        value - Property value
      • getProperties

        public java.util.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​(java.lang.String key)
      • replicate

        public void replicate​(java.lang.Class... types)
        Method to perform the replication for all objects of the specified types.
        Parameters:
        types - Classes to replicate
      • replicate

        public void replicate​(java.lang.String... classNames)
        Method to perform the replication for all objects of the specified class names.
        Parameters:
        classNames - Classes to replicate
      • replicate

        public void replicate​(java.lang.Object... oids)
        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

        protected void replicateInTarget​(java.lang.Object... detachedObjects)
        Method to replicate the provided detached objects in the target datastore.
        Parameters:
        detachedObjects - The detached objects (from the source datastore)