Package org.bonitasoft.connectors.rest
Class RESTConnector
java.lang.Object
org.bonitasoft.engine.connector.AbstractConnector
org.bonitasoft.connectors.rest.AbstractRESTConnectorImpl
org.bonitasoft.connectors.rest.RESTConnector
- All Implemented Interfaces:
org.bonitasoft.engine.connector.Connector
- Direct Known Subclasses:
DeleteConnectorImpl,GetConnectorImpl,HeadConnectorImpl,PatchConnectorImpl,PostConnectorImpl,PutConnectorImpl
This main class of the REST Connector implementation
-
Field Summary
Fields inherited from class org.bonitasoft.connectors.rest.AbstractRESTConnectorImpl
ADD_BONITA_CONTEXT_HEADERS_INPUT_PARAMETER, AUTH_HOST_INPUT_PARAMETER, AUTH_PASSWORD_INPUT_PARAMETER, AUTH_PORT_INPUT_PARAMETER, AUTH_PREEMPTIVE_INPUT_PARAMETER, AUTH_REALM_INPUT_PARAMETER, AUTH_TYPE_PARAMETER, AUTH_USERNAME_INPUT_PARAMETER, AUTOMATIC_PROXY_RESOLUTION_PARAMETER, BODY_AS_OBJECT_OUTPUT_PARAMETER, BODY_AS_STRING_OUTPUT_PARAMETER, BODY_INPUT_PARAMETER, BONITA_ACTIVITY_INSTANCE_ID_HEADER_INPUT_PARAMETER, BONITA_PROCESS_DEFINITION_ID_HEADER_INPUT_PARAMETER, BONITA_PROCESS_INSTANCE_ID_HEADER_INPUT_PARAMETER, BONITA_ROOT_PROCESS_INSTANCE_ID_HEADER_INPUT_PARAMETER, BONITA_TASK_ASSIGNEE_ID_HEADER_INPUT_PARAMETER, CHARSET_INPUT_PARAMETER, CONNECTION_TIMEOUT_MS_DEFAULT_VALUE, CONNECTION_TIMEOUT_MS_PARAMETER, CONTENTTYPE_INPUT_PARAMETER, DO_NOT_FOLLOW_REDIRECT_INPUT_PARAMETER, DOCUMENT_BODY_INPUT_PARAMETER, FAIL_ON_HTTP_4XX_INPUT_PARAMETER, FAIL_ON_HTTP_5XX_INPUT_PARAMETER, FAILURE_EXCEPTIONS_HTTP_CODES_INPUT_PARAMETER, HEADERS_OUTPUT_PARAMETER, HOSTNAME_VERIFIER_INPUT_PARAMETER, IGNORE_BODY_INPUT_PARAMETER, KEY_STORE_FILE_INPUT_PARAMETER, KEY_STORE_PASSWORD_INPUT_PARAMETER, MAXIMUM_BODY_CONTENT_PRINTED_LOGS_PARAMETER, METHOD_INPUT_PARAMETER, PROXY_HOST_INPUT_PARAMETER, PROXY_PASSWORD_INPUT_PARAMETER, PROXY_PORT_INPUT_PARAMETER, PROXY_PROTOCOL_INPUT_PARAMETER, PROXY_USERNAME_INPUT_PARAMETER, RETRY_ADDITIONAL_HTTP_CODES_INPUT_PARAMETER, RETRY_ON_HTTP_5XX_INPUT_PARAMETER, SENSITIVE_HEADERS_PRINTED_LOGS_PARAMETER, SOCKET_TIMEOUT_MS_DEFAULT_VALUE, SOCKET_TIMEOUT_MS_PARAMETER, STATUS_CODE_OUTPUT_PARAMETER, STATUS_MESSAGE_OUTPUT_PARAMETER, TLS_INPUT_PARAMETER, TRUST_CERTIFICATE_STRATEGY_INPUT_PARAMETER, TRUST_STORE_FILE_INPUT_PARAMETER, TRUST_STORE_PASSWORD_INPUT_PARAMETER, URL_INPUT_PARAMETER, URLCOOKIES_INPUT_PARAMETER, URLHEADERS_INPUT_PARAMETERFields inherited from class org.bonitasoft.engine.connector.AbstractConnector
apiAccessor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidexecute(Request request, Consumer<org.apache.http.HttpResponse> consumer, Consumer<org.apache.http.HttpResponse> retryConsumer, Consumer<org.apache.http.HttpResponse> failureConsumer) Execute a given requestprotected voidbooleanhasBody()voidMethods inherited from class org.bonitasoft.connectors.rest.AbstractRESTConnectorImpl
getAddBonitaContextHeaders, getAuthHost, getAuthPassword, getAuthPort, getAuthPreemptive, getAuthRealm, getAuthType, getAuthUsername, getAutomaticProxyResolution, getBody, getBonitaActivityInstanceIdHeader, getBonitaProcessDefinitionIdHeader, getBonitaProcessInstanceIdHeader, getBonitaRootProcessInstanceIdHeader, getBonitaTaskAssigneeIdHeader, getCharset, getConnectionTimeoutMs, getContentType, getDocumentBody, getDoNotFollowRedirect, getFailExceptionHttpCodes, getFailOnHttp4xx, getFailOnHttp5xx, getHostnameVerifier, getIgnoreBody, getKeyStoreFile, getKeyStorePassword, getMaximumBodyContentPrintedLogs, getMethod, getProxyHost, getProxyPassword, getProxyPort, getProxyProtocol, getProxyUsername, getRetryAdditionalHttpCodes, getRetryOnHttp5xx, getShowSensitiveHeadersInLogs, getSocketTimeoutMs, getTLS, getTrustCertificateStrategy, getTrustStoreFile, getTrustStorePassword, getUrl, getUrlCookies, getUrlHeaders, setBody, setBody, setHeaders, setStatusCode, setStatusMessageMethods inherited from class org.bonitasoft.engine.connector.AbstractConnector
connect, disconnect, execute, getAPIAccessor, getExecutionContext, getInputParameter, getInputParameter, getOutputParameters, setAPIAccessor, setExecutionContext, setInputParameters, setOutputParameter
-
Constructor Details
-
RESTConnector
protected RESTConnector(boolean hasBody)
-
-
Method Details
-
validateInputParameters
public void validateInputParameters() throws org.bonitasoft.engine.connector.ConnectorValidationException- Specified by:
validateInputParametersin interfaceorg.bonitasoft.engine.connector.Connector- Overrides:
validateInputParametersin classAbstractRESTConnectorImpl- Throws:
org.bonitasoft.engine.connector.ConnectorValidationException
-
executeBusinessLogic
protected void executeBusinessLogic() throws org.bonitasoft.engine.connector.ConnectorException- Specified by:
executeBusinessLogicin classorg.bonitasoft.engine.connector.AbstractConnector- Throws:
org.bonitasoft.engine.connector.ConnectorException
-
execute
public void execute(Request request, Consumer<org.apache.http.HttpResponse> consumer, Consumer<org.apache.http.HttpResponse> retryConsumer, Consumer<org.apache.http.HttpResponse> failureConsumer) throws Exception Execute a given request- Parameters:
request- The request to execute- Throws:
Exception- any exception that might occur
-
execute
- Throws:
Exception
-
hasBody
public boolean hasBody()- Specified by:
hasBodyin classAbstractRESTConnectorImpl
-