Class CommunityManagement
java.lang.Object
org.odpi.openmetadata.accessservices.communityprofile.client.CommunityProfileBaseClient
org.odpi.openmetadata.accessservices.communityprofile.client.CommunityManagement
- All Implemented Interfaces:
CommunityManagementInterface
,RelatedElementsManagementInterface
public class CommunityManagement
extends CommunityProfileBaseClient
implements CommunityManagementInterface
CommunityManagerClient supports the APIs to maintain communities and their related objects.
It issues REST API calls to the Open Metadata Server running Community Profile OMAS that have a URL that begins:
serverPlatformURLRoot/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities
-
Field Summary
Fields inherited from class org.odpi.openmetadata.accessservices.communityprofile.client.CommunityProfileBaseClient
baseURLTemplatePrefix, openMetadataStoreClient, propertyHelper
-
Constructor Summary
ConstructorDescriptionCommunityManagement
(String serverName, String serverPlatformURLRoot, int maxPageSize) Create a new client with no authentication embedded in the HTTP request.CommunityManagement
(String serverName, String serverPlatformURLRoot, String userId, String password, int maxPageSize) Create a new client that passes userId and password in each HTTP request.CommunityManagement
(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog, int maxPageSize) Create a new client that passes userId and password in each HTTP request.CommunityManagement
(String serverName, String serverPlatformURLRoot, CommunityProfileRESTClient restClient, int maxPageSize) Create a new client that is going to be used in an OMAG Server.CommunityManagement
(String serverName, String serverPlatformURLRoot, AuditLog auditLog, int maxPageSize) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearCommunityRole
(String userId, String externalSourceGUID, String externalSourceName, String communityGUID, String personRoleGUID) Remove a membership relationship between a community and a person role.createCommunity
(String userId, String externalSourceGUID, String externalSourceName, CommunityProperties communityProperties) Create a new metadata element to represent a community.createCommunityFromTemplate
(String userId, String externalSourceGUID, String externalSourceName, String templateGUID, TemplateProperties templateProperties) Create a new metadata element to represent a community using an existing metadata element as a template.findCommunities
(String userId, String searchString, int startFrom, int pageSize) Retrieve the list of metadata elements that contain the search string.getCommunities
(String userId, int startFrom, int pageSize) Retrieve the list of all communities defined in open metadata.getCommunitiesByName
(String userId, String name, int startFrom, int pageSize) Retrieve the list of metadata elements with a matching qualified or display name.getCommunityByGUID
(String userId, String communityGUID) Retrieve the metadata element with the supplied unique identifier.getRolesForCommunity
(String userId, String communityGUID, int startFrom, int pageSize) Return information about the person roles linked to a community.void
removeCommunity
(String userId, String externalSourceGUID, String externalSourceName, String communityGUID) Remove the metadata element representing a community.void
setupCommunityRole
(String userId, String externalSourceGUID, String externalSourceName, String communityGUID, CommunityMembershipProperties membershipProperties, String personRoleGUID) Create a membership relationship between a community and a person role to show that anyone appointed to the role is a member of the community.void
updateCommunity
(String userId, String externalSourceGUID, String externalSourceName, String communityGUID, boolean isMergeUpdate, CommunityProperties communityProperties) Update the metadata element representing a community.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
-
CommunityManagement
public CommunityManagement(String serverName, String serverPlatformURLRoot, AuditLog auditLog, int maxPageSize) 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 servicesauditLog
- logging destinationmaxPageSize
- maximum value allowed for page size- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
CommunityManagement
public CommunityManagement(String serverName, String serverPlatformURLRoot, int maxPageSize) 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 servicesmaxPageSize
- maximum value allowed for page size- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
CommunityManagement
public CommunityManagement(String serverName, String serverPlatformURLRoot, String userId, String password, int maxPageSize) 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 servicesuserId
- caller's userId embedded in all HTTP requestspassword
- caller's userId embedded in all HTTP requestsmaxPageSize
- maximum value allowed for page size- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
CommunityManagement
public CommunityManagement(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog, int maxPageSize) 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 servicesuserId
- caller's userId embedded in all HTTP requestspassword
- caller's userId embedded in all HTTP requestsauditLog
- logging destinationmaxPageSize
- maximum value allowed for page size- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
CommunityManagement
public CommunityManagement(String serverName, String serverPlatformURLRoot, CommunityProfileRESTClient restClient, int maxPageSize) throws 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:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Details
-
createCommunity
public String createCommunity(String userId, String externalSourceGUID, String externalSourceName, CommunityProperties communityProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a new metadata element to represent a community.- Specified by:
createCommunity
in interfaceCommunityManagementInterface
- Parameters:
userId
- calling userexternalSourceGUID
- unique identifier of software capability representing the callerexternalSourceName
- unique name of software capability representing the callercommunityProperties
- properties about the community to store. The qualifiedName property must be supplied and must be unique.- Returns:
- unique identifier of the new community
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
createCommunityFromTemplate
public String createCommunityFromTemplate(String userId, String externalSourceGUID, String externalSourceName, String templateGUID, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a new metadata element to represent a community using an existing metadata element as a template.- Specified by:
createCommunityFromTemplate
in interfaceCommunityManagementInterface
- Parameters:
userId
- calling userexternalSourceGUID
- unique identifier of software capability representing the callerexternalSourceName
- unique name of software capability representing the callertemplateGUID
- unique identifier of the metadata element to copytemplateProperties
- properties that override the template- Returns:
- unique identifier of the new community
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
updateCommunity
public void updateCommunity(String userId, String externalSourceGUID, String externalSourceName, String communityGUID, boolean isMergeUpdate, CommunityProperties communityProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the metadata element representing a community.- Specified by:
updateCommunity
in interfaceCommunityManagementInterface
- Parameters:
userId
- calling userexternalSourceGUID
- unique identifier of software capability representing the callerexternalSourceName
- unique name of software capability representing the callercommunityGUID
- unique identifier of the metadata element to updateisMergeUpdate
- should the new properties be merged with existing properties (true) or completely replace them (false)?communityProperties
- new properties for the metadata element- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
setupCommunityRole
public void setupCommunityRole(String userId, String externalSourceGUID, String externalSourceName, String communityGUID, CommunityMembershipProperties membershipProperties, String personRoleGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a membership relationship between a community and a person role to show that anyone appointed to the role is a member of the community.- Specified by:
setupCommunityRole
in interfaceCommunityManagementInterface
- Parameters:
userId
- calling userexternalSourceGUID
- unique identifier of software capability representing the callerexternalSourceName
- unique name of software capability representing the callercommunityGUID
- unique identifier of the communitymembershipProperties
- describes the permissions that the role has in the communitypersonRoleGUID
- unique identifier of the person role- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
clearCommunityRole
public void clearCommunityRole(String userId, String externalSourceGUID, String externalSourceName, String communityGUID, String personRoleGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove a membership relationship between a community and a person role.- Specified by:
clearCommunityRole
in interfaceCommunityManagementInterface
- Parameters:
userId
- calling userexternalSourceGUID
- unique identifier of software capability representing the callerexternalSourceName
- unique name of software capability representing the callercommunityGUID
- unique identifier of the communitypersonRoleGUID
- unique identifier of the person role- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
removeCommunity
public void removeCommunity(String userId, String externalSourceGUID, String externalSourceName, String communityGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the metadata element representing a community.- Specified by:
removeCommunity
in interfaceCommunityManagementInterface
- Parameters:
userId
- calling userexternalSourceGUID
- unique identifier of software capability representing the callerexternalSourceName
- unique name of software capability representing the callercommunityGUID
- unique identifier of the metadata element to remove- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
findCommunities
public List<CommunityElement> findCommunities(String userId, String searchString, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of metadata elements that contain the search string. The search string is treated as a regular expression.- Specified by:
findCommunities
in interfaceCommunityManagementInterface
- 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:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getCommunitiesByName
public List<CommunityElement> getCommunitiesByName(String userId, String name, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Specified by:
getCommunitiesByName
in interfaceCommunityManagementInterface
- Parameters:
userId
- calling username
- name to search forstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getCommunities
public List<CommunityElement> getCommunities(String userId, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of all communities defined in open metadata.- Specified by:
getCommunities
in interfaceCommunityManagementInterface
- Parameters:
userId
- calling userstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getRolesForCommunity
public List<PersonRoleElement> getRolesForCommunity(String userId, String communityGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return information about the person roles linked to a community.- Specified by:
getRolesForCommunity
in interfaceCommunityManagementInterface
- Parameters:
userId
- calling usercommunityGUID
- unique identifier for the communitystartFrom
- 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:
InvalidParameterException
- name or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getCommunityByGUID
public CommunityElement getCommunityByGUID(String userId, String communityGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the metadata element with the supplied unique identifier.- Specified by:
getCommunityByGUID
in interfaceCommunityManagementInterface
- Parameters:
userId
- calling usercommunityGUID
- unique identifier of the requested metadata element- Returns:
- requested metadata element
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-