Class PostConnectorRestart

java.lang.Object
org.sourcelab.kafka.connect.apiclient.request.post.PostConnectorRestart
All Implemented Interfaces:
PostRequest<Boolean>, Request<Boolean>

public final class PostConnectorRestart extends Object implements PostRequest<Boolean>
Defines a request to restart a connector.
  • Constructor Details

    • PostConnectorRestart

      public PostConnectorRestart(String connectorName)
      Constructor.
      Parameters:
      connectorName - Name of connector to restart
  • Method Details

    • withIncludeTasks

      public PostConnectorRestart withIncludeTasks(boolean includeTasks)
      Only available from Kafka Connect version 3.0.0 and up.
      Parameters:
      includeTasks - Specifies whether to restart the connector instance and task instances (includeTasks=true`) or just the connector instance (includeTasks=false).
      Returns:
      self reference for method chaining.
    • withOnlyFailed

      public PostConnectorRestart withOnlyFailed(boolean onlyFailed)
      Only available from Kafka Connect version 3.0.0 and up.
      Parameters:
      onlyFailed - specifies whether to restart just the instances with a FAILED status (onlyFailed=true) or all instances (onlyFailed=false).
      Returns:
      self reference for method chaining.
    • getApiEndpoint

      public String getApiEndpoint()
      Description copied from interface: Request
      The name of the API end point to issue a request against. This is appended to the API Hostname.
      Specified by:
      getApiEndpoint in interface Request<Boolean>
      Returns:
      The name of the end point this request uses.
    • getRequestBody

      public Object getRequestBody()
      Description copied from interface: Request
      Object to be submitted as the body of the request. It will be serialized to JSON using Jackson.
      Specified by:
      getRequestBody in interface Request<Boolean>
      Returns:
      Object representing request body content.
    • parseResponse

      public Boolean parseResponse(String responseStr) throws IOException
      Description copied from interface: Request
      Parse the rest service's response into a concrete object.
      Specified by:
      parseResponse in interface Request<Boolean>
      Parameters:
      responseStr - The servers response in string format.
      Returns:
      A concrete object representing the result.
      Throws:
      IOException - on parsing errors.