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 string
responseHeaders - The response headers
errorMessage - Error description (null if successful)
executionTimeMs - Time taken in milliseconds
requestUrl - The final URL that was called
mappedData - 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 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 a ConnectorResponse record class.
      Parameters:
      success - the value for the success record component
      statusCode - the value for the statusCode record component
      responseBody - the value for the responseBody record component
      responseHeaders - the value for the responseHeaders record component
      errorMessage - the value for the errorMessage record component
      executionTimeMs - the value for the executionTimeMs record component
      requestUrl - the value for the requestUrl record component
      mappedData - the value for the mappedData record component
  • Method Details

    • success

      public static ConnectorResponse success(int statusCode, String responseBody, Map<String,String> responseHeaders, long executionTimeMs, String requestUrl)
    • success

      public static ConnectorResponse success(int statusCode, String responseBody, Map<String,String> responseHeaders, long executionTimeMs, String requestUrl, String mappedData)
    • error

      public static ConnectorResponse error(String errorMessage, long executionTimeMs, String requestUrl)
    • error

      public static ConnectorResponse error(int statusCode, String responseBody, String errorMessage, long executionTimeMs, String requestUrl)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • success

      public boolean success()
      Returns the value of the success record component.
      Returns:
      the value of the success record component
    • statusCode

      public int statusCode()
      Returns the value of the statusCode record component.
      Returns:
      the value of the statusCode record component
    • responseBody

      public String responseBody()
      Returns the value of the responseBody record component.
      Returns:
      the value of the responseBody record component
    • responseHeaders

      public Map<String,String> responseHeaders()
      Returns the value of the responseHeaders record component.
      Returns:
      the value of the responseHeaders record component
    • errorMessage

      public String errorMessage()
      Returns the value of the errorMessage record component.
      Returns:
      the value of the errorMessage record component
    • executionTimeMs

      public long executionTimeMs()
      Returns the value of the executionTimeMs record component.
      Returns:
      the value of the executionTimeMs record component
    • requestUrl

      public String requestUrl()
      Returns the value of the requestUrl record component.
      Returns:
      the value of the requestUrl record component
    • mappedData

      public String mappedData()
      Returns the value of the mappedData record component.
      Returns:
      the value of the mappedData record component