java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.txnfn.AbstractTransactionFunction
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.txnfn.ReHomeInstance
Direct Known Subclasses:
ReHomeEntity, ReHomeRelationship

public abstract class ReHomeInstance extends AbstractTransactionFunction
Base transaction function for updating an instance's home metadata repository.
  • Constructor Details

    • ReHomeInstance

      public ReHomeInstance()
  • Method Details

    • reHomeInstance

      protected static clojure.lang.IPersistentMap reHomeInstance(String userId, clojure.lang.IPersistentMap existing, String newHomeMetadataCollectionId, String newHomeMetadataCollectionName)
      Makes the necessary changes to update a metadata instance's home metadata repository.
      Parameters:
      userId - doing the update
      existing - metadata instance
      newHomeMetadataCollectionId - unique identifier of the instance's new home
      newHomeMetadataCollectionName - name of the instance's new home
      Returns:
      IPersistentMap giving the updated instance representation
    • validate

      protected static void validate(clojure.lang.IPersistentMap existing, String metadataCollectionId, String className, String methodName) throws InvalidParameterException
      Validate the re-home. The instance must originate in the liocal cohort and NOT be locally homed already, or the entity must have an instanceProvenanceType set to external and a replicatedBy that is NOT the local metadataCollectionId. Any other combination indicates a non-reference copy, and therefore cannot be re-homed.
      Parameters:
      existing - metadata instance
      metadataCollectionId - of the metadata instance
      className - calling class
      methodName - calling method
      Throws:
      InvalidParameterException - if the instance cannot be re-homed