Class FFDCRESTClientBase
java.lang.Object
org.odpi.openmetadata.commonservices.ffdc.rest.FFDCRESTClientBase
- Direct Known Subclasses:
FFDCRESTClient
RESTClient is responsible for issuing calls to the OMAS REST APIs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuditLogprotected final RESTExceptionHandlerprotected Stringprotected String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFFDCRESTClientBase(String serverName, String serverPlatformURLRoot, String secretsStoreProvider, String secretsStoreLocation, String secretsStoreCollection, AuditLog auditLog) Constructor for no authentication with audit log.FFDCRESTClientBase(String serverName, String serverPlatformURLRoot, Map<String, SecretsStoreConnector> secretsStoreConnectorMap, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> TcallDeleteRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params) Issue a Delete REST call that returns a response object.protected <T> TcallDeleteRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object... params) Issue a Delete REST call that returns a response object.protected <T> TcallGetRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object... params) Issue a GET REST call that returns a response object.protected <T> TcallGetRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object... params) Issue a GET REST call that returns a response object.protected <T> TcallGetRESTCallNoParams(String methodName, Class<T> returnClass, String urlTemplate) Issue a GET REST call that returns a response object.protected <T> TcallPostRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params) Issue a POST REST call that returns a response object.protected <T> TcallPostRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object requestBody, Object... params) Issue a POST REST call that returns a response object.<T> TcallPostRESTCallNoParams(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody) Issue a POST REST call that returns a response object.protected <T> TcallPutRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params) Issue a PUT REST call that returns a response object.protected <T> TcallPutRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object requestBody, Object... params) Issue a PUT REST call that returns a response object.
-
Field Details
-
serverName
-
serverPlatformURLRoot
-
auditLog
-
exceptionHandler
-
-
Constructor Details
-
FFDCRESTClientBase
protected FFDCRESTClientBase(String serverName, String serverPlatformURLRoot, String secretsStoreProvider, String secretsStoreLocation, String secretsStoreCollection, AuditLog auditLog) throws InvalidParameterException Constructor for no authentication with audit log.- Parameters:
serverName- name of the OMAG Server to callserverPlatformURLRoot- URL root of the server platform where the OMAG Server is running.secretsStoreProvider- secrets store connector for bearer tokensecretsStoreLocation- secrets store location for bearer tokensecretsStoreCollection- secrets store collection for bearer tokenauditLog- destination for log messages.- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
FFDCRESTClientBase
public FFDCRESTClientBase(String serverName, String serverPlatformURLRoot, Map<String, SecretsStoreConnector> secretsStoreConnectorMap, AuditLog auditLog) throws InvalidParameterExceptionCreate a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the OMAG Server to callserverPlatformURLRoot- URL root of the server platform where the OMAG Server is runningsecretsStoreConnectorMap- connectors to secrets storesauditLog- destination for log messages- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Details
-
callGetRESTCallNoParams
protected <T> T callGetRESTCallNoParams(String methodName, Class<T> returnClass, String urlTemplate) throws PropertyServerException Issue a GET REST call that returns a response object.- Type Parameters:
T- return type- Parameters:
methodName- name of the method being called.returnClass- class of the response object.urlTemplate- template of the URL for the REST API call with place-holders for the parameters.- Returns:
- response object
- Throws:
PropertyServerException- something went wrong with the REST call stack.
-
callGetRESTCall
protected <T> T callGetRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object... params) throws PropertyServerException Issue a GET REST call that returns a response object.- Type Parameters:
T- return type- Parameters:
methodName- name of the method being called.returnClass- class of the response object.urlTemplate- template of the URL for the REST API call with place-holders for the parameters.params- a list of parameters that are slotted into the url template.- Returns:
- response object
- Throws:
PropertyServerException- something went wrong with the REST call stack.
-
callGetRESTCall
protected <T> T callGetRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object... params) throws PropertyServerException Issue a GET REST call that returns a response object. It's working only withSpringRESTClientConnector- Type Parameters:
T- return type- Parameters:
methodName- name of the method being called.responseType- class of the response object.urlTemplate- template of the URL for the REST API call with place-holders for the parameters.params- a list of parameters that are slotted into the url template.- Returns:
- response object
- Throws:
PropertyServerException- something went wrong with the REST call stack.
-
callPostRESTCallNoParams
public <T> T callPostRESTCallNoParams(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody) throws PropertyServerException 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- Parameters:
methodName- name of the method being called.returnClass- class of the response object.urlTemplate- template of the URL for the REST API call with place-holders for the parameters.requestBody- request body for the request.- Returns:
- response object
- Throws:
PropertyServerException- something went wrong with the REST call stack.
-
callPostRESTCall
protected <T> T callPostRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params) throws PropertyServerException 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- Parameters:
methodName- name of the method being called.returnClass- class of the response object.urlTemplate- template of the URL for the REST API call with place-holders for the parameters.requestBody- request body for the request.params- a list of parameters that are slotted into the url template.- Returns:
- response object
- Throws:
PropertyServerException- something went wrong with the REST call stack.
-
callPostRESTCall
protected <T> T callPostRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object requestBody, Object... params) throws PropertyServerException Issue a POST REST call that returns a response object. This is typically a create, update, or find with complex parameters. It's working only withSpringRESTClientConnector- Type Parameters:
T- return type- Parameters:
methodName- name of the method being called.responseType- class of the response for generic object.urlTemplate- template of the URL for the REST API call with place-holders for the parameters.requestBody- request body for the request.params- a list of parameters that are slotted into the url template.- Returns:
- response object
- Throws:
PropertyServerException- something went wrong with the REST call stack.
-
callPutRESTCall
protected <T> T callPutRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params) throws PropertyServerException Issue a PUT REST call that returns a response object. This is typically an update.- Type Parameters:
T- return type- Parameters:
methodName- name of the method being called.returnClass- class of the response object.urlTemplate- template of the URL for the REST API call with place-holders for the parameters.requestBody- request body for the request.params- a list of parameters that are slotted into the url template.- Returns:
- response object
- Throws:
PropertyServerException- something went wrong with the REST call stack.
-
callPutRESTCall
protected <T> T callPutRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object requestBody, Object... params) throws PropertyServerException Issue a PUT REST call that returns a response object. This is typically an update. It's working only withSpringRESTClientConnector- Type Parameters:
T- return type- Parameters:
methodName- name of the method being called.responseType- class of the response for generic object.urlTemplate- template of the URL for the REST API call with place-holders for the parameters.requestBody- request body for the request.params- a list of parameters that are slotted into the url template.- Returns:
- response object
- Throws:
PropertyServerException- something went wrong with the REST call stack.
-
callDeleteRESTCall
protected <T> T callDeleteRESTCall(String methodName, Class<T> returnClass, String urlTemplate, Object requestBody, Object... params) throws PropertyServerException Issue a Delete REST call that returns a response object.- Type Parameters:
T- return type- Parameters:
methodName- name of the method being called.returnClass- class of the response object.urlTemplate- template of the URL for the REST API call with place-holders for the parameters.requestBody- body of requestparams- a list of parameters that are slotted into the url template.- Returns:
- response object
- Throws:
PropertyServerException- something went wrong with the REST call stack.
-
callDeleteRESTCall
protected <T> T callDeleteRESTCall(String methodName, org.springframework.core.ParameterizedTypeReference<T> responseType, String urlTemplate, Object... params) throws PropertyServerException Issue a Delete REST call that returns a response object.- Type Parameters:
T- return type- Parameters:
methodName- name of the method being called.responseType- class of the response for generic object.urlTemplate- template of the URL for the REST API call with place-holders for the parameters.params- a list of parameters that are slotted into the url template.- Returns:
- response object
- Throws:
PropertyServerException- something went wrong with the REST call stack.
-