Class ExternalReferenceManager
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceProgramBaseClient
-
- org.odpi.openmetadata.accessservices.governanceprogram.client.ExternalReferenceManager
-
- All Implemented Interfaces:
ExternalReferencesInterface,RelatedElementsManagementInterface
public class ExternalReferenceManager extends GovernanceProgramBaseClient implements ExternalReferencesInterface
ExternalReferenceManager is the java client for managing external references and their links to all types of governance definitions.
-
-
Field Summary
-
Fields inherited from class org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceProgramBaseClient
nullRequestBody
-
-
Constructor Summary
Constructors Constructor Description ExternalReferenceManager(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.ExternalReferenceManager(String serverName, String serverPlatformURLRoot, int maxPageSize, AuditLog auditLog)Create a new client with no authentication embedded in the HTTP request.ExternalReferenceManager(String serverName, String serverPlatformURLRoot, String userId, String password)Create a new client that passes userId and password in each HTTP request.ExternalReferenceManager(String serverName, String serverPlatformURLRoot, String userId, String password, int maxPageSize, AuditLog auditLog)Create a new client that passes userId and password in each HTTP request.ExternalReferenceManager(String serverName, String serverPlatformURLRoot, GovernanceProgramRESTClient restClient, int maxPageSize)Create a new client that uses the supplied rest client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateExternalReference(String userId, String anchorGUID, ExternalReferenceProperties properties)Create a definition of an external reference.voiddeleteExternalReference(String userId, String externalReferenceGUID)Remove the definition of an external reference.List<ExternalReferenceElement>findExternalReferencesById(String userId, String resourceId, int startFrom, int pageSize)Retrieve the list of external references for this resourceId.List<RelatedElement>getElementsForExternalReference(String userId, String externalReferenceGUID, int startFrom, int pageSize)Return information about the elements linked to a externalReference.ExternalReferenceElementgetExternalReferenceByGUID(String userId, String externalReferenceGUID)Return information about a specific external reference.List<ExternalReferenceElement>getExternalReferencesByURL(String userId, String url, int startFrom, int pageSize)Retrieve the list of external references for this URL.voidlinkExternalReferenceToElement(String userId, String attachedToGUID, String externalReferenceGUID, ExternalReferenceLinkProperties linkProperties)Link an external reference to an object.List<ExternalReferenceElement>retrieveAttachedExternalReferences(String userId, String attachedToGUID, int startFrom, int pageSize)Retrieve the list of external references attached to the supplied object.voidunlinkExternalReferenceFromElement(String userId, String attachedToGUID, String externalReferenceGUID)Remove the link between an external reference and an element.voidupdateExternalReference(String userId, String externalReferenceGUID, boolean isMergeUpdate, ExternalReferenceProperties properties)Update the definition of an external reference.-
Methods inherited from class org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceProgramBaseClient
clearAssignmentScope, clearGovernanceDefinitionScope, clearGovernanceResponsibilityAssignment, clearGovernedBy, clearMoreInformation, clearResource, clearStakeholder, getAssignedActors, getAssignedScopes, getDescriptiveElements, getGovernanceDefinitionScopes, getGovernanceDefinitionsForElement, getGovernedElements, getMoreInformation, getResourceList, getResponsibleRoles, getRoleResponsibilities, getScopedGovernanceDefinitions, getStakeholderCommissionedElements, getStakeholders, getSupportedByResource, removeReferenceable, setupAssignmentScope, setupGovernanceDefinitionScope, setupGovernanceResponsibilityAssignment, setupGovernedBy, setupMoreInformation, setupResource, setupStakeholder, updateGovernanceDefinitionStatus, updateRelationship
-
-
-
-
Constructor Detail
-
ExternalReferenceManager
public ExternalReferenceManager(String serverName, String serverPlatformURLRoot) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST servers- Throws:
InvalidParameterException- bad input parameters
-
ExternalReferenceManager
public ExternalReferenceManager(String serverName, String serverPlatformURLRoot, String userId, String password) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requests- Throws:
InvalidParameterException- bad input parameters
-
ExternalReferenceManager
public ExternalReferenceManager(String serverName, String serverPlatformURLRoot, int maxPageSize, AuditLog auditLog) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversmaxPageSize- pre-initialized parameter limitauditLog- logging destination- Throws:
InvalidParameterException- bad input parameters
-
ExternalReferenceManager
public ExternalReferenceManager(String serverName, String serverPlatformURLRoot, String userId, String password, int maxPageSize, AuditLog auditLog) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requestsmaxPageSize- pre-initialized parameter limitauditLog- logging destination- Throws:
InvalidParameterException- bad input parameters
-
ExternalReferenceManager
public ExternalReferenceManager(String serverName, String serverPlatformURLRoot, GovernanceProgramRESTClient restClient, int maxPageSize) throws InvalidParameterException
Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversrestClient- internal client for rest callsmaxPageSize- pre-initialized parameter limit- Throws:
InvalidParameterException- bad input parameters
-
-
Method Detail
-
createExternalReference
public String createExternalReference(String userId, String anchorGUID, ExternalReferenceProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a definition of an external reference.- Specified by:
createExternalReferencein interfaceExternalReferencesInterface- Parameters:
userId- calling useranchorGUID- optional element to link the external reference to that will act as an anchor - that is, this external reference will be deleted when the element is deleted (once the external reference is linked to the anchor).properties- properties for a external reference- Returns:
- unique identifier of the external reference
- Throws:
InvalidParameterException- qualifiedName or userId is null; qualifiedName is not uniquePropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
updateExternalReference
public void updateExternalReference(String userId, String externalReferenceGUID, boolean isMergeUpdate, ExternalReferenceProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the definition of an external reference.- Specified by:
updateExternalReferencein interfaceExternalReferencesInterface- Parameters:
userId- calling userexternalReferenceGUID- unique identifier of external referenceisMergeUpdate- are unspecified properties unchanged (true) or replaced with null?properties- properties to change- Throws:
InvalidParameterException- guid, qualifiedName or userId is null; qualifiedName is not unique; guid is not knownPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
deleteExternalReference
public void deleteExternalReference(String userId, String externalReferenceGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the definition of an external reference.- Specified by:
deleteExternalReferencein interfaceExternalReferencesInterface- Parameters:
userId- calling userexternalReferenceGUID- unique identifier of external reference- Throws:
InvalidParameterException- guid or userId is null; guid is not knownPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
linkExternalReferenceToElement
public void linkExternalReferenceToElement(String userId, String attachedToGUID, String externalReferenceGUID, ExternalReferenceLinkProperties linkProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Link an external reference to an object.- Specified by:
linkExternalReferenceToElementin interfaceExternalReferencesInterface- Parameters:
userId- the name of the calling user.attachedToGUID- object linked to external references.externalReferenceGUID- unique identifier (guid) of the external reference details.linkProperties- description for the reference from the perspective of the object that the reference is being attached to.- Throws:
InvalidParameterException- problem with the GUID or the external references are not correctly specified, or are null.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
unlinkExternalReferenceFromElement
public void unlinkExternalReferenceFromElement(String userId, String attachedToGUID, String externalReferenceGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Remove the link between an external reference and an element. If the element is its anchor, the external reference is removed.- Specified by:
unlinkExternalReferenceFromElementin interfaceExternalReferencesInterface- Parameters:
userId- the name of the calling user.attachedToGUID- object linked to external references.externalReferenceGUID- identifier of the external reference.- Throws:
InvalidParameterException- problem with the GUID or the external references are not correctly specified, or are null.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
getExternalReferenceByGUID
public ExternalReferenceElement getExternalReferenceByGUID(String userId, String externalReferenceGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Return information about a specific external reference.- Specified by:
getExternalReferenceByGUIDin interfaceExternalReferencesInterface- Parameters:
userId- calling userexternalReferenceGUID- unique identifier for the external reference- Returns:
- properties of the external reference
- Throws:
InvalidParameterException- externalReferenceGUID or userId is nullPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
findExternalReferencesById
public List<ExternalReferenceElement> findExternalReferencesById(String userId, String resourceId, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve the list of external references for this resourceId.- Specified by:
findExternalReferencesByIdin interfaceExternalReferencesInterface- Parameters:
userId- the name of the calling user.resourceId- unique reference id assigned by the resource owner (supports wildcards). This is the qualified name of the entitystartFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- Returns:
- links to addition information.
- Throws:
InvalidParameterException- guid invalid or the external references are not correctly specified, or are null.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
getExternalReferencesByURL
public List<ExternalReferenceElement> getExternalReferencesByURL(String userId, String url, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve the list of external references for this URL.- Specified by:
getExternalReferencesByURLin interfaceExternalReferencesInterface- Parameters:
userId- the name of the calling user.url- URL of the external resource.startFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- Returns:
- links to addition information.
- Throws:
InvalidParameterException- guid invalid or the external references are not correctly specified, or are null.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
retrieveAttachedExternalReferences
public List<ExternalReferenceElement> retrieveAttachedExternalReferences(String userId, String attachedToGUID, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve the list of external references attached to the supplied object.- Specified by:
retrieveAttachedExternalReferencesin interfaceExternalReferencesInterface- Parameters:
userId- the name of the calling user.attachedToGUID- object linked to external reference.startFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- Returns:
- links to addition information.
- Throws:
InvalidParameterException- guid invalid or the external references are not correctly specified, or are null.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
getElementsForExternalReference
public List<RelatedElement> getElementsForExternalReference(String userId, String externalReferenceGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Return information about the elements linked to a externalReference.- Specified by:
getElementsForExternalReferencein interfaceExternalReferencesInterface- Parameters:
userId- calling userexternalReferenceGUID- unique identifier for the externalReferencestartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- properties of the related elements
- Throws:
InvalidParameterException- qualifiedName or userId is nullPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
-