Class CollectionManagement
java.lang.Object
org.odpi.openmetadata.accessservices.communityprofile.client.CommunityProfileBaseClient
org.odpi.openmetadata.accessservices.communityprofile.client.CollectionManagement
- All Implemented Interfaces:
org.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface,org.odpi.openmetadata.accessservices.communityprofile.api.RelatedElementsManagementInterface
public class CollectionManagement
extends CommunityProfileBaseClient
implements org.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface
CollectionManagerClient supports the APIs to maintain collections and their related objects.
It issues REST API calls to the Open Metadata Server running Collection Profile OMAS that have a URL that begins:
serverPlatformURLRoot/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/collections.
-
Constructor Summary
ConstructorsConstructorDescriptionCollectionManagement(String serverName, String serverPlatformURLRoot) Create a new client with no authentication embedded in the HTTP request.CollectionManagement(String serverName, String serverPlatformURLRoot, String userId, String password) Create a new client that passes userId and password in each HTTP request.CollectionManagement(String serverName, String serverPlatformURLRoot, String userId, String password, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) Create a new client that passes userId and password in each HTTP request.CollectionManagement(String serverName, String serverPlatformURLRoot, CommunityProfileRESTClient restClient, int maxPageSize) Create a new client that is going to be used in an OMAG Server.CollectionManagement(String serverName, String serverPlatformURLRoot, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptioncreateCollection(String userId, String externalSourceGUID, String externalSourceName, org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionProperties collectionProperties) Create a new metadata element to represent a collection.createFolderCollection(String userId, String externalSourceGUID, String externalSourceName, org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionFolderProperties properties) Create a collection that acts like a folder with an order.List<org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement>findCollections(String userId, String searchString, int startFrom, int pageSize) Retrieve the list of metadata elements that contain the search string.org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElementgetCollection(String userId, String collectionGUID) Retrieve the metadata element with the supplied unique identifier.org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionMembergetCollectionMember(String userId, String collectionGUID, String memberGUID) Return details of the membership between a collection and a specific member of the collection.List<org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionMember>getCollectionMembers(String userId, String collectionGUID, int startFrom, int pageSize) Return information about the elements linked to a collection.List<org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement>getCollections(String userId, String parentGUID, int startFrom, int pageSize) Retrieve the list of all collections defined in open metadata.List<org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement>getCollectionsByName(String userId, String name, int startFrom, int pageSize) Retrieve the list of metadata elements with a matching qualified or display name.List<org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement>getElementsCollections(String userId, String elementGUID, int startFrom, int pageSize) Return information about the elements linked to a collection.voidremoveCollection(String userId, String externalSourceGUID, String externalSourceName, String collectionGUID) Remove the metadata element representing a collection.voidremoveFromCollection(String userId, String externalSourceGUID, String externalSourceName, String collectionGUID, String elementGUID) Remove a membership relationship between a collection and a person role.voidupdateCollection(String userId, String externalSourceGUID, String externalSourceName, String collectionGUID, boolean isMergeUpdate, org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionProperties collectionProperties) Update the metadata element representing a collection.voidupdateCollectionMembership(String userId, String externalSourceGUID, String externalSourceName, String collectionGUID, org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionMembershipProperties membershipProperties, boolean isMergeUpdate, String elementGUID) Create a membership relationship between a collection and a person role to show that anyone appointed to the role is a member of the collection.Methods inherited from class org.odpi.openmetadata.accessservices.communityprofile.client.CommunityProfileBaseClient
clearAssignmentScope, clearMoreInformation, clearResource, clearStakeholder, getAssignedActors, getAssignedScopes, getDescriptiveElements, getMoreInformation, getResourceList, getStakeholderCommissionedElements, getStakeholders, getSupportedByResource, removeReferenceable, setupAssignmentScope, setupMoreInformation, setupResource, setupStakeholder, updateRelationship
-
Constructor Details
-
CollectionManagement
public CollectionManagement(String serverName, String serverPlatformURLRoot, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) throws org.odpi.openmetadata.frameworks.connectors.ffdc.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 servicesauditLog- logging destination- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
CollectionManagement
public CollectionManagement(String serverName, String serverPlatformURLRoot) throws org.odpi.openmetadata.frameworks.connectors.ffdc.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 services- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
CollectionManagement
public CollectionManagement(String serverName, String serverPlatformURLRoot, String userId, String password) throws org.odpi.openmetadata.frameworks.connectors.ffdc.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 servicesuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requests- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
CollectionManagement
public CollectionManagement(String serverName, String serverPlatformURLRoot, String userId, String password, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) throws org.odpi.openmetadata.frameworks.connectors.ffdc.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 servicesuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requestsauditLog- logging destination- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
CollectionManagement
public CollectionManagement(String serverName, String serverPlatformURLRoot, CommunityProfileRESTClient restClient, int maxPageSize) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException Create a new client that is going to be used in an OMAG Server.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST servicesrestClient- client that issues the REST API callsmaxPageSize- maximum number of results supported by this server- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Details
-
createCollection
public String createCollection(String userId, String externalSourceGUID, String externalSourceName, org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionProperties collectionProperties) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException Create a new metadata element to represent a collection.- Specified by:
createCollectionin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- calling userexternalSourceGUID- unique identifier of software capability representing the callerexternalSourceName- unique name of software capability representing the callercollectionProperties- properties about the collection to store. The qualifiedName property must be supplied and must be unique.- Returns:
- unique identifier of the new collection
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is invalidorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the user is not authorized to issue this requestorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem reported in the open metadata server(s)
-
createFolderCollection
public String createFolderCollection(String userId, String externalSourceGUID, String externalSourceName, org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionFolderProperties properties) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Create a collection that acts like a folder with an order.- Specified by:
createFolderCollectionin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- userId of user making request.externalSourceGUID- unique identifier of software capability representing the callerexternalSourceName- unique name of software capability representing the callerproperties- description of the collection.- Returns:
- unique identifier of the newly created Collection
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is invalid.org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem retrieving information from the property server(s).org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
updateCollection
public void updateCollection(String userId, String externalSourceGUID, String externalSourceName, String collectionGUID, boolean isMergeUpdate, org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionProperties collectionProperties) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException Update the metadata element representing a collection.- Specified by:
updateCollectionin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- calling userexternalSourceGUID- unique identifier of software capability representing the callerexternalSourceName- unique name of software capability representing the callercollectionGUID- unique identifier of the metadata element to updateisMergeUpdate- should the new properties be merged with existing properties (true) or completely replace them (false)?collectionProperties- new properties for the metadata element- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is invalidorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the user is not authorized to issue this requestorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem reported in the open metadata server(s)
-
updateCollectionMembership
public void updateCollectionMembership(String userId, String externalSourceGUID, String externalSourceName, String collectionGUID, org.odpi.openmetadata.accessservices.communityprofile.properties.CollectionMembershipProperties membershipProperties, boolean isMergeUpdate, String elementGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException Create a membership relationship between a collection and a person role to show that anyone appointed to the role is a member of the collection.- Specified by:
updateCollectionMembershipin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- calling userexternalSourceGUID- unique identifier of software capability representing the callerexternalSourceName- unique name of software capability representing the callercollectionGUID- unique identifier of the collectionmembershipProperties- describes the permissions that the role has in the collectionisMergeUpdate- should the new properties be merged with existing properties (true) or completely replace them (false)?elementGUID- unique identifier of the person role- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is invalidorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the user is not authorized to issue this requestorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem reported in the open metadata server(s)
-
removeFromCollection
public void removeFromCollection(String userId, String externalSourceGUID, String externalSourceName, String collectionGUID, String elementGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException Remove a membership relationship between a collection and a person role.- Specified by:
removeFromCollectionin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- calling userexternalSourceGUID- unique identifier of software capability representing the callerexternalSourceName- unique name of software capability representing the callercollectionGUID- unique identifier of the collectionelementGUID- unique identifier of the person role- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is invalidorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the user is not authorized to issue this requestorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem reported in the open metadata server(s)
-
removeCollection
public void removeCollection(String userId, String externalSourceGUID, String externalSourceName, String collectionGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException Remove the metadata element representing a collection.- Specified by:
removeCollectionin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- calling userexternalSourceGUID- unique identifier of software capability representing the callerexternalSourceName- unique name of software capability representing the callercollectionGUID- unique identifier of the metadata element to remove- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is invalidorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the user is not authorized to issue this requestorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem reported in the open metadata server(s)
-
findCollections
public List<org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement> findCollections(String userId, String searchString, int startFrom, int pageSize) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException Retrieve the list of metadata elements that contain the search string. The search string is treated as a regular expression.- Specified by:
findCollectionsin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- calling usersearchString- string to find in the propertiesstartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is invalidorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the user is not authorized to issue this requestorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem reported in the open metadata server(s)
-
getCollectionsByName
public List<org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement> getCollectionsByName(String userId, String name, int startFrom, int pageSize) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException Retrieve the list of metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Specified by:
getCollectionsByNamein interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- calling username- name to search forstartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is invalidorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the user is not authorized to issue this requestorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem reported in the open metadata server(s)
-
getCollections
public List<org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement> getCollections(String userId, String parentGUID, int startFrom, int pageSize) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException Retrieve the list of all collections defined in open metadata.- Specified by:
getCollectionsin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- calling userparentGUID- unique identifier of referenceable object (typically a personal profile, project or community) that the collections hang off of.startFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is invalidorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the user is not authorized to issue this requestorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem reported in the open metadata server(s)
-
getCollectionMembers
public List<org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionMember> getCollectionMembers(String userId, String collectionGUID, int startFrom, int pageSize) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException Return information about the elements linked to a collection.- Specified by:
getCollectionMembersin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- calling usercollectionGUID- unique identifier for the collectionstartFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- Returns:
- list of matching actor profiles (hopefully only one)
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- name or userId is nullorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- problem accessing property serverorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- security access problem
-
getCollectionMember
public org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionMember getCollectionMember(String userId, String collectionGUID, String memberGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Return details of the membership between a collection and a specific member of the collection.- Specified by:
getCollectionMemberin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- userId of user making request.collectionGUID- unique identifier of the collection.memberGUID- unique identifier of the element who is a member of the collection.- Returns:
- list of asset details
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is invalid.org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem retrieving information from the property server(s).org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
getElementsCollections
public List<org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement> getElementsCollections(String userId, String elementGUID, int startFrom, int pageSize) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException Return information about the elements linked to a collection.- Specified by:
getElementsCollectionsin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- calling userelementGUID- unique identifier for the collectionstartFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- Returns:
- list of matching actor profiles (hopefully only one)
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- name or userId is nullorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- problem accessing property serverorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- security access problem
-
getCollection
public org.odpi.openmetadata.accessservices.communityprofile.metadataelements.CollectionElement getCollection(String userId, String collectionGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException Retrieve the metadata element with the supplied unique identifier.- Specified by:
getCollectionin interfaceorg.odpi.openmetadata.accessservices.communityprofile.api.CollectionManagementInterface- Parameters:
userId- calling usercollectionGUID- unique identifier of the requested metadata element- Returns:
- requested metadata element
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is invalidorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the user is not authorized to issue this requestorg.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- there is a problem reported in the open metadata server(s)
-