Class SubjectAreaRestClient
java.lang.Object
org.odpi.openmetadata.commonservices.ffdc.rest.FFDCRESTClientBase
org.odpi.openmetadata.commonservices.ffdc.rest.FFDCRESTClient
org.odpi.openmetadata.accessservices.subjectarea.client.SubjectAreaRestClient
public class SubjectAreaRestClient
extends org.odpi.openmetadata.commonservices.ffdc.rest.FFDCRESTClient
RESTClient is responsible for issuing calls to the Subject Area OMAS REST APIs.
In this class with methods there is a parameter "urnTemplate" below is an example for a better understanding.
For example "/servers/%s/open-metadata/access-services/subject-area/users/%s/categories/%s"
where first %s - serverName, second %s - userId and third %s - guid
This URN will be a continuation of serverPlatformURLRoot, which was set when creating the object
-
Constructor Summary
ConstructorsConstructorDescriptionSubjectAreaRestClient(String serverName, String serverPlatformURLRoot) SubjectAreaRestClient(String serverName, String serverPlatformURLRoot, String userId, String password) -
Method Summary
Modifier and TypeMethodDescriptioncreateFindQuery(String methodName, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest) Method for constructing a query (https://en.wikipedia.org/wiki/Query_string) using the information described in the findRequest page size and startingFrom need to set by the caller.createFindQuery(String methodName, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, QueryParams queryParams) Method for constructing a query (https://en.wikipedia.org/wiki/Query_string) using the information described in the findRequest page size and startingFrom need to set by the caller.<T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>deleteRESTCall(String userId, String guid, String methodName, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, String urnTemplate) Issue a Delete REST call<T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>findRESTCall(String userId, String guid, String methodName, String urnTemplate, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, Integer maximumPageSizeOnRestCall) Issue a GET REST call that returns a response found objects using the information described in findRequest<T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>findRESTCall(String userId, String methodName, String urnTemplate, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, QueryParams queryParams) Issue a GET REST call that returns a response found objects using the information described in findRequest, specifying the maximum amount that the downstream server supports.<T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>findRESTCall(String userId, String methodName, String urnTemplate, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, QueryParams queryParams, Integer maximumPageSizeOnRestCall) Issue a GET REST call that returns a response found objects using the information described in findRequest, specifying the maximum amount that the downstream server supports.<T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>getByIdRESTCall(String userId, String guid, String methodName, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, String urnTemplate) Issue a GET REST call that returns a response object by guid.<T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>getByIdRESTCall(String userId, String guid, String methodName, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, String urnTemplate, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest) Issue a GET REST call that returns a response object by guid.<T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>getByIdRESTCall(String userId, String guid, String methodName, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, String urnTemplate, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, Integer maximumPageSizeOnRestCall, QueryParams queryParams) Issue a GET REST call that returns a response object by guid.<T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>postRESTCall(String userId, String methodName, String urnTemplate, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, T requestBody) Issue a POST REST call that returns a response object.<T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>putRESTCall(String userId, String guid, String methodName, String urnTemplate, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, T requestBody) Issue a PUT REST call that returns a response object.<T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>restoreRESTCall(String userId, String guid, String methodName, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, String urnTemplate) Issue a restore objectMethods inherited from class org.odpi.openmetadata.commonservices.ffdc.rest.FFDCRESTClient
callBooleanGetRESTCall, callCountGetRESTCall, callGUIDGetRESTCall, callGUIDListGetRESTCall, callGUIDListPostRESTCall, callGUIDPostRESTCall, callNameListGetRESTCall, callOCFConnectorReportGetRESTCall, callStringMapGetRESTCall, callVoidGetRESTCall, callVoidPostRESTCallMethods inherited from class org.odpi.openmetadata.commonservices.ffdc.rest.FFDCRESTClientBase
callPostRESTCallNoParams
-
Constructor Details
-
SubjectAreaRestClient
public SubjectAreaRestClient(String serverName, String serverPlatformURLRoot) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
-
SubjectAreaRestClient
public SubjectAreaRestClient(String serverName, String serverPlatformURLRoot, String userId, String password) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
-
-
Method Details
-
postRESTCall
public <T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T> postRESTCall(String userId, String methodName, String urnTemplate, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, T requestBody) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException Issue a POST REST call that returns a response object. This is typically a create, update, or find with complex parameters.- Type Parameters:
T- return type for results inGenericResponse- Parameters:
userId- unique identifier for requesting user, under which the request is performedmethodName- name of the method being called.type- class of the response for generic object. Descried usingParameterizedTypeReferenceAn example can be seen hereResponseParameterization.getParameterizedType()urnTemplate- template of the URN for the REST API call with place-holders for the parameters.requestBody- request body for the request.- Returns:
- GenericResponse with T result
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
putRESTCall
public <T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T> putRESTCall(String userId, String guid, String methodName, String urnTemplate, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, T requestBody) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Issue a PUT REST call that returns a response object. This is typically an update.- Type Parameters:
T- return type for results inGenericResponse- Parameters:
userId- unique identifier for requesting user, under which the request is performedguid- unique identifier of the update objectmethodName- name of the method being called.type- class of the response for generic object. Descried usingParameterizedTypeReferenceAn example can be seen hereResponseParameterization.getParameterizedType()urnTemplate- template of the URN for the REST API call with place-holders for the parameters.requestBody- request body for the request.- Returns:
- GenericResponse with T result
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
getByIdRESTCall
public <T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T> getByIdRESTCall(String userId, String guid, String methodName, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, String urnTemplate) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Issue a GET REST call that returns a response object by guid. This is a get for a single object.- Type Parameters:
T- return type for results inGenericResponse- Parameters:
userId- unique identifier for requesting user, under which the request is performedguid- unique identifier of the received objectmethodName- name of the method being called.type- class of the response for generic object. Descried usingParameterizedTypeReferenceAn example can be seen hereResponseParameterization.getParameterizedType()urnTemplate- template of the URN for the REST API call with place-holders for the parameters.- Returns:
- GenericResponse with T result
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
getByIdRESTCall
public <T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T> getByIdRESTCall(String userId, String guid, String methodName, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, String urnTemplate, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Issue a GET REST call that returns a response object by guid.- Type Parameters:
T- return type for results inGenericResponse- Parameters:
userId- unique identifier for requesting user, under which the request is performedguid- unique identifier of the received objectmethodName- name of the method being called.type- class of the response for generic object. Descried usingParameterizedTypeReferenceAn example can be seen hereResponseParameterization.getParameterizedType()urnTemplate- template of the URN for the REST API call with place-holders for the parameters.findRequest- search specification- Returns:
- GenericResponse with T result
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
getByIdRESTCall
public <T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T> getByIdRESTCall(String userId, String guid, String methodName, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, String urnTemplate, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, Integer maximumPageSizeOnRestCall, QueryParams queryParams) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Issue a GET REST call that returns a response object by guid.- Type Parameters:
T- return type for results inGenericResponse- Parameters:
userId- unique identifier for requesting user, under which the request is performedguid- unique identifier of the received objectmethodName- name of the method being called.type- class of the response for generic object. Descried usingParameterizedTypeReferenceAn example can be seen hereResponseParameterization.getParameterizedType()urnTemplate- template of the URN for the REST API call with place-holders for the parameters.maximumPageSizeOnRestCall- maximum page size that can be used on rest calls, null and 0 mean no limit set.findRequest- search specificationqueryParams-QueryParams- Returns:
- GenericResponse with T result
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
findRESTCall
public <T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T> findRESTCall(String userId, String methodName, String urnTemplate, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, QueryParams queryParams) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Issue a GET REST call that returns a response found objects using the information described in findRequest, specifying the maximum amount that the downstream server supports.- Type Parameters:
T- return type for results inGenericResponse- Parameters:
userId- unique identifier for requesting user, under which the request is performedmethodName- name of the method being called.urnTemplate- template of the URN for the REST API call with place-holders for the parameters.type- class of the response for generic object. Descried usingParameterizedTypeReferenceAn example can be seen hereResponseParameterization.getParameterizedType()findRequest-FindRequestqueryParams-QueryParams- Returns:
- GenericResponse with T results
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
findRESTCall
public <T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T> findRESTCall(String userId, String methodName, String urnTemplate, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, QueryParams queryParams, Integer maximumPageSizeOnRestCall) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Issue a GET REST call that returns a response found objects using the information described in findRequest, specifying the maximum amount that the downstream server supports.- Type Parameters:
T- return type for results inGenericResponse- Parameters:
userId- unique identifier for requesting user, under which the request is performedmethodName- name of the method being called.urnTemplate- template of the URN for the REST API call with place-holders for the parameters.type- class of the response for generic object. Descried usingParameterizedTypeReferenceAn example can be seen hereResponseParameterization.getParameterizedType()findRequest-FindRequestmaximumPageSizeOnRestCall- maximum page size that can be used on rest calls, null and 0 mean no limit set.queryParams-QueryParams- Returns:
- GenericResponse with T results
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
findRESTCall
public <T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T> findRESTCall(String userId, String guid, String methodName, String urnTemplate, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, Integer maximumPageSizeOnRestCall) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Issue a GET REST call that returns a response found objects using the information described in findRequest- Type Parameters:
T- return type for results inGenericResponse- Parameters:
userId- unique identifier for requesting user, under which the request is performedguid- unique identifier of the object to which the found objects should relatemethodName- name of the method being called.urnTemplate- template of the URN for the REST API call with place-holders for the parameters.type- class of the response for generic object. Descried usingParameterizedTypeReferenceAn example can be seen hereResponseParameterization.getParameterizedType()findRequest-FindRequestmaximumPageSizeOnRestCall- maximum number of results- Returns:
- GenericResponse with T results
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
deleteRESTCall
public <T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T> deleteRESTCall(String userId, String guid, String methodName, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, String urnTemplate) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException Issue a Delete REST call- Type Parameters:
T- return type for results inGenericResponse- Parameters:
userId- unique identifier for requesting user, under which the request is performedguid- unique identifier of the delete objectmethodName- name of the method being called.type- class of the response for generic object. Descried usingParameterizedTypeReferenceAn example can be seen hereResponseParameterization.getParameterizedType()urnTemplate- template of the URN for the REST API call with place-holders for the parameters.- Returns:
- GenericResponse with T result
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
restoreRESTCall
public <T> org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T> restoreRESTCall(String userId, String guid, String methodName, org.springframework.core.ParameterizedTypeReference<org.odpi.openmetadata.commonservices.ffdc.rest.GenericResponse<T>> type, String urnTemplate) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException Issue a restore object- Type Parameters:
T- return type for results inGenericResponse- Parameters:
userId- unique identifier for requesting user, under which the request is performedguid- unique identifier of the restore objectmethodName- name of the method being called.type- class of the response for generic object. Descried usingParameterizedTypeReferenceAn example can be seen hereResponseParameterization.getParameterizedType()urnTemplate- template of the URN for the REST API call with place-holders for the parameters.- Returns:
- GenericResponse with T result
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- something went wrong with the REST call stack.org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the requesting user is not authorized to issue this request.org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
createFindQuery
public QueryBuilder createFindQuery(String methodName, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException Method for constructing a query (https://en.wikipedia.org/wiki/Query_string) using the information described in the findRequest page size and startingFrom need to set by the caller.- Parameters:
methodName- name of the method being called.findRequest-FindRequest- Returns:
- query
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
createFindQuery
public QueryBuilder createFindQuery(String methodName, org.odpi.openmetadata.accessservices.subjectarea.properties.objects.common.FindRequest findRequest, QueryParams queryParams) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException Method for constructing a query (https://en.wikipedia.org/wiki/Query_string) using the information described in the findRequest page size and startingFrom need to set by the caller.- Parameters:
methodName- name of the method being called.findRequest-FindRequestqueryParams-QueryParams- Returns:
- query
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- one of the parameters is null or invalid
-
getServerName
-
getServerPlatformURLRoot
-