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

public final class PostConnector extends Object implements PostRequest<ConnectorDefinition>
Defines request to deploy a new connector.
  • Constructor Details

    • PostConnector

      public PostConnector(NewConnectorDefinition connectorDefinition)
      Constructor.
      Parameters:
      connectorDefinition - Defines the new connector to be deployed.
  • Method Details

    • 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<ConnectorDefinition>
      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<ConnectorDefinition>
      Returns:
      Object representing request body content.
    • parseResponse

      public ConnectorDefinition 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<ConnectorDefinition>
      Parameters:
      responseStr - The servers response in string format.
      Returns:
      A concrete object representing the result.
      Throws:
      IOException - on parsing errors.