Record Class ConnectorResponse
java.lang.Object
java.lang.Record
com.bonitasoft.processbuilder.execution.ConnectorResponse
- Record Components:
success- Whether the execution was successful (HTTP 2xx)statusCode- The HTTP status code (-1 if connection error)responseBody- The response body as stringresponseHeaders- The response headerserrorMessage- Error description (null if successful)executionTimeMs- Time taken in millisecondsrequestUrl- The final URL that was calledmappedData- Optional transformed data from fieldMapping (null if no mapping)
public record ConnectorResponse(boolean success, int statusCode, String responseBody, Map<String,String> responseHeaders, String errorMessage, long executionTimeMs, String requestUrl, String mappedData)
extends Record
Output response from the ConnectorExecutionEngine.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static ConnectorResponseerror(int statusCode, String responseBody, String errorMessage, long executionTimeMs, String requestUrl) static ConnectorResponseReturns the value of theerrorMessagerecord component.longReturns the value of theexecutionTimeMsrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of themappedDatarecord component.Returns the value of therequestUrlrecord component.Returns the value of theresponseBodyrecord component.Returns the value of theresponseHeadersrecord component.intReturns the value of thestatusCoderecord component.booleansuccess()Returns the value of thesuccessrecord component.static ConnectorResponsesuccess(int statusCode, String responseBody, Map<String, String> responseHeaders, long executionTimeMs, String requestUrl) static ConnectorResponsesuccess(int statusCode, String responseBody, Map<String, String> responseHeaders, long executionTimeMs, String requestUrl, String mappedData) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConnectorResponse
public ConnectorResponse(boolean success, int statusCode, String responseBody, Map<String, String> responseHeaders, String errorMessage, long executionTimeMs, String requestUrl, String mappedData) Creates an instance of aConnectorResponserecord class.- Parameters:
success- the value for thesuccessrecord componentstatusCode- the value for thestatusCoderecord componentresponseBody- the value for theresponseBodyrecord componentresponseHeaders- the value for theresponseHeadersrecord componenterrorMessage- the value for theerrorMessagerecord componentexecutionTimeMs- the value for theexecutionTimeMsrecord componentrequestUrl- the value for therequestUrlrecord componentmappedData- the value for themappedDatarecord component
-
-
Method Details
-
success
-
success
-
error
-
error
public static ConnectorResponse error(int statusCode, String responseBody, String errorMessage, long executionTimeMs, String requestUrl) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
statusCode
public int statusCode()Returns the value of thestatusCoderecord component.- Returns:
- the value of the
statusCoderecord component
-
responseBody
Returns the value of theresponseBodyrecord component.- Returns:
- the value of the
responseBodyrecord component
-
responseHeaders
Returns the value of theresponseHeadersrecord component.- Returns:
- the value of the
responseHeadersrecord component
-
errorMessage
Returns the value of theerrorMessagerecord component.- Returns:
- the value of the
errorMessagerecord component
-
executionTimeMs
public long executionTimeMs()Returns the value of theexecutionTimeMsrecord component.- Returns:
- the value of the
executionTimeMsrecord component
-
requestUrl
Returns the value of therequestUrlrecord component.- Returns:
- the value of the
requestUrlrecord component
-
mappedData
Returns the value of themappedDatarecord component.- Returns:
- the value of the
mappedDatarecord component
-