Class AddRelationshipExecutor
java.lang.Object
org.odpi.openmetadata.repositoryservices.enterprise.repositoryconnector.executors.RepositoryExecutorBase
org.odpi.openmetadata.repositoryservices.enterprise.repositoryconnector.executors.AddRelationshipExecutor
- All Implemented Interfaces:
RepositoryExecutor
AddRelationshipExecutor provides the executor for the addEntity and addExternalEntity methods.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.repositoryservices.enterprise.repositoryconnector.executors.RepositoryExecutorBase
methodName, userId
-
Constructor Summary
ConstructorDescriptionAddRelationshipExecutor
(String userId, String relationshipTypeGUID, String externalSourceGUID, String externalSourceName, InstanceProperties initialProperties, EntityProxy entityOneProxy, EntityProxy entityTwoProxy, InstanceStatus initialStatus, AuditLog auditLog, String methodName) Constructor takes the parameters for the request.AddRelationshipExecutor
(String userId, String relationshipTypeGUID, InstanceProperties initialProperties, EntityProxy entityOneProxy, EntityProxy entityTwoProxy, InstanceStatus initialStatus, AuditLog auditLog, String methodName) Constructor takes the parameters for the request. -
Method Summary
Modifier and TypeMethodDescriptionReturn the result of the execution.boolean
issueRequestToRepository
(String metadataCollectionId, OMRSMetadataCollection metadataCollection) Perform the required action for the supplied repository.Methods inherited from class org.odpi.openmetadata.repositoryservices.enterprise.repositoryconnector.executors.RepositoryExecutorBase
getMethodName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.odpi.openmetadata.repositoryservices.enterprise.repositoryconnector.executors.RepositoryExecutor
augmentResultFromRepository, getResultsForAugmentation
-
Constructor Details
-
AddRelationshipExecutor
public AddRelationshipExecutor(String userId, String relationshipTypeGUID, InstanceProperties initialProperties, EntityProxy entityOneProxy, EntityProxy entityTwoProxy, InstanceStatus initialStatus, AuditLog auditLog, String methodName) Constructor takes the parameters for the request.- Parameters:
userId
- unique identifier for requesting userrelationshipTypeGUID
- unique identifier (guid) for the new entity's typeinitialProperties
- initial list of properties for the new relationship - null means no propertiesentityOneProxy
- the unique identifier of one of the entities that the relationship is connecting togetherentityTwoProxy
- the unique identifier of the other entity that the relationship is connecting togetherinitialStatus
- initial status typically DRAFT, PREPARED or ACTIVEauditLog
- logging destinationmethodName
- calling method
-
AddRelationshipExecutor
public AddRelationshipExecutor(String userId, String relationshipTypeGUID, String externalSourceGUID, String externalSourceName, InstanceProperties initialProperties, EntityProxy entityOneProxy, EntityProxy entityTwoProxy, InstanceStatus initialStatus, AuditLog auditLog, String methodName) Constructor takes the parameters for the request.- Parameters:
userId
- unique identifier for requesting user.relationshipTypeGUID
- unique identifier (guid) for the new entity's type.externalSourceGUID
- unique identifier (guid) for the external source.externalSourceName
- unique name for the external source.initialProperties
- initial list of properties for the new entity null means no properties.entityOneProxy
- the unique identifier of one of the entities that the relationship is connecting together.entityTwoProxy
- the unique identifier of the other entity that the relationship is connecting together.initialStatus
- initial status typically DRAFT, PREPARED or ACTIVE.auditLog
- logging destinationmethodName
- calling method
-
-
Method Details
-
issueRequestToRepository
public boolean issueRequestToRepository(String metadataCollectionId, OMRSMetadataCollection metadataCollection) Perform the required action for the supplied repository. Create requests occur in the first repository that accepts the call. Some repositories may produce exceptions. These exceptions are saved and will be returned if there are no positive results from any repository.- Specified by:
issueRequestToRepository
in interfaceRepositoryExecutor
- Specified by:
issueRequestToRepository
in classRepositoryExecutorBase
- Parameters:
metadataCollectionId
- unique identifier for the metadata collection for the repositorymetadataCollection
- metadata collection object for the repository- Returns:
- boolean true means that the required results have been achieved
-
getNewRelationship
public Relationship getNewRelationship() throws InvalidParameterException, RepositoryErrorException, TypeErrorException, PropertyErrorException, EntityNotKnownException, StatusNotSupportedException, FunctionNotSupportedException, UserNotAuthorizedExceptionReturn the result of the execution. Hopefully this is a result - but may be an exception- Returns:
- Relationship structure with the new header, requested entities and properties.
- Throws:
InvalidParameterException
- one of the parameters is invalid or null.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.TypeErrorException
- the requested type is not known, or not supported in the metadata repository hosting the metadata collection.PropertyErrorException
- one or more of the requested properties are not defined, or have different characteristics in the TypeDef for this relationship's type.EntityNotKnownException
- one of the requested entities is not known in the metadata collection.StatusNotSupportedException
- the metadata repository hosting the metadata collection does not support the requested status.FunctionNotSupportedException
- the repository does not support maintenance of metadata.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-