Class ReHomeInstance
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
Base transaction function for updating an instance's home metadata repository.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.protected static void
validate
(clojure.lang.IPersistentMap existing, String metadataCollectionId, String className, String methodName) Validate the re-home.Methods inherited from class org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.txnfn.AbstractTransactionFunction
createTransactionFunction, getGUID, getInstanceProvenanceType, getMetadataCollectionId, getTxnTimeCalculation, getTypeDefForInstance, getTypeDefGUID, incrementVersion, incrementVersion
-
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 updateexisting
- metadata instancenewHomeMetadataCollectionId
- unique identifier of the instance's new homenewHomeMetadataCollectionName
- 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 instancemetadataCollectionId
- of the metadata instanceclassName
- calling classmethodName
- calling method- Throws:
InvalidParameterException
- if the instance cannot be re-homed
-