Class CommunityResource
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.communityprofile.server.spring.CommunityResource
-
@RestController @RequestMapping("/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}") public class CommunityResource extends ObjectThe CommunityResource provides a Spring based server-side REST API that supports the CommunityManagementInterface. It delegates each request to the CommunityRESTServices. This provides the server-side implementation of the Community Profile Open Metadata Assess Service (OMAS) which is used to manage information about people, roles and organizations.
-
-
Constructor Summary
Constructors Constructor Description CommunityResource()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VoidResponseclearCommunityRole(String serverName, String userId, String communityGUID, String communityRoleGUID, ExternalSourceRequestBody requestBody)Remove a relationship between a community and a person role.GUIDResponsecreateCommunity(String serverName, String userId, ReferenceableRequestBody requestBody)Create a new metadata element to represent a community.GUIDResponsecreateCommunityFromTemplate(String serverName, String userId, String templateGUID, TemplateRequestBody requestBody)Create a new metadata element to represent a community using an existing metadata element as a template.CommunityListResponsefindCommunities(String serverName, String userId, SearchStringRequestBody requestBody, int startFrom, int pageSize)Retrieve the list of community metadata elements that contain the search string.CommunityListResponsegetCommunitiesByName(String serverName, String userId, int startFrom, int pageSize)Retrieve the list of community metadata elements.CommunityListResponsegetCommunitiesByName(String serverName, String userId, NameRequestBody requestBody, int startFrom, int pageSize)Retrieve the list of community metadata elements with a matching qualified or display name.CommunityResponsegetCommunityByGUID(String serverName, String userId, String guid)Retrieve the community metadata element with the supplied unique identifier.PersonRoleListResponsegetRolesForCommunity(String serverName, String userId, String communityGUID, int startFrom, int pageSize)Return information about a person role connected to the named community.VoidResponseremoveCommunity(String serverName, String userId, String communityGUID, ExternalSourceRequestBody requestBody)Remove the metadata element representing a community.VoidResponsesetupCommunityRole(String serverName, String userId, String communityGUID, String communityRoleGUID, RelationshipRequestBody requestBody)Create a relationship between a community and a person role.VoidResponseupdateCommunity(String serverName, String userId, String communityGUID, boolean isMergeUpdate, ReferenceableRequestBody requestBody)Update the metadata element representing a community.
-
-
-
Method Detail
-
createCommunity
@PostMapping(path="/communities") public GUIDResponse createCommunity(@PathVariable String serverName, @PathVariable String userId, @RequestBody ReferenceableRequestBody requestBody)
Create a new metadata element to represent a community.- Parameters:
serverName- name of the service to route the request to.userId- calling userrequestBody- properties to store- Returns:
- unique identifier of the new metadata element or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
-
createCommunityFromTemplate
@PostMapping(path="/communities/from-template/{templateGUID}") public GUIDResponse createCommunityFromTemplate(@PathVariable String serverName, @PathVariable String userId, @PathVariable String templateGUID, @RequestBody TemplateRequestBody requestBody)Create a new metadata element to represent a community using an existing metadata element as a template.- Parameters:
serverName- name of the service to route the request to.userId- calling usertemplateGUID- unique identifier of the metadata element to copyrequestBody- properties that override the template- Returns:
- unique identifier of the new metadata element or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
-
updateCommunity
@PostMapping(path="/communities/{communityGUID}") public VoidResponse updateCommunity(@PathVariable String serverName, @PathVariable String userId, @PathVariable String communityGUID, @RequestParam boolean isMergeUpdate, @RequestBody ReferenceableRequestBody requestBody)Update the metadata element representing a community.- Parameters:
serverName- name of the service to route the request to.userId- calling usercommunityGUID- unique identifier of the metadata element to updateisMergeUpdate- should the new properties be merged with the existing properties of overlay them?requestBody- new properties for this element- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
-
setupCommunityRole
@PostMapping(path="/communities/{communityGUID}/community-roles/{communityRoleGUID}") public VoidResponse setupCommunityRole(@PathVariable String serverName, @PathVariable String userId, @PathVariable String communityGUID, @PathVariable String communityRoleGUID, @RequestBody RelationshipRequestBody requestBody)Create a relationship between a community and a person role.- Parameters:
serverName- name of the service to route the request to.userId- calling usercommunityGUID- unique identifier of the community in the external data managercommunityRoleGUID- unique identifier of the person role in the external data managerrequestBody- data manager identifiers- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
-
clearCommunityRole
@PostMapping(path="/communities/{communityGUID}/community-roles/{communityRoleGUID}/delete") public VoidResponse clearCommunityRole(@PathVariable String serverName, @PathVariable String userId, @PathVariable String communityGUID, @PathVariable String communityRoleGUID, @RequestBody ExternalSourceRequestBody requestBody)Remove a relationship between a community and a person role.- Parameters:
serverName- name of the service to route the request to.userId- calling usercommunityGUID- unique identifier of the community in the external data managercommunityRoleGUID- unique identifier of the person role in the external data managerrequestBody- data manager identifiers- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
-
removeCommunity
@PostMapping(path="/communities/{communityGUID}/delete") public VoidResponse removeCommunity(@PathVariable String serverName, @PathVariable String userId, @PathVariable String communityGUID, @RequestBody ExternalSourceRequestBody requestBody)Remove the metadata element representing a community.- Parameters:
serverName- name of the service to route the request to.userId- calling usercommunityGUID- unique identifier of the metadata element to removerequestBody- external source identifiers- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
-
findCommunities
@PostMapping(path="/communities/by-search-string") public CommunityListResponse findCommunities(@PathVariable String serverName, @PathVariable String userId, @RequestBody SearchStringRequestBody requestBody, @RequestParam int startFrom, @RequestParam int pageSize)
Retrieve the list of community metadata elements that contain the search string. The search string is treated as a regular expression.- Parameters:
serverName- name of the service to route the request to.userId- calling userrequestBody- string to find in the propertiesstartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
-
getCommunitiesByName
@PostMapping(path="/communities/by-name") public CommunityListResponse getCommunitiesByName(@PathVariable String serverName, @PathVariable String userId, @RequestBody NameRequestBody requestBody, @RequestParam int startFrom, @RequestParam int pageSize)
Retrieve the list of community metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Parameters:
serverName- name of the service to route the request to.userId- calling userrequestBody- name to search forstartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
-
getRolesForCommunity
@GetMapping(path="/person-roles/by-community/{communityGUID}") public PersonRoleListResponse getRolesForCommunity(@PathVariable String serverName, @PathVariable String userId, @PathVariable String communityGUID, @RequestParam int startFrom, @RequestParam int pageSize)Return information about a person role connected to the named community.- Parameters:
serverName- called serveruserId- 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 person roles InvalidParameterException name or userId is null PropertyServerException problem accessing property server UserNotAuthorizedException security access problem
-
getCommunitiesByName
@GetMapping(path="/communities") public CommunityListResponse getCommunitiesByName(@PathVariable String serverName, @PathVariable String userId, @RequestParam int startFrom, @RequestParam int pageSize)
Retrieve the list of community metadata elements.- Parameters:
serverName- name of the service to route the request to.userId- calling userstartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
-
getCommunityByGUID
@GetMapping(path="/communities/{guid}") public CommunityResponse getCommunityByGUID(@PathVariable String serverName, @PathVariable String userId, @PathVariable String guid)Retrieve the community metadata element with the supplied unique identifier.- Parameters:
serverName- name of the service to route the request to.userId- calling userguid- unique identifier of the requested metadata element- Returns:
- matching metadata element or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
-
-