com.ibm.broker.rest

Interface Operation



  • public interface Operation
    An interface that describes an operation in an API. A operation has a name, an HTTP method (such as POST or DELETE), and an optional set of parameters.
    Since:
    IBM Integration Bus v10
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void addListener(java.beans.PropertyChangeListener listener)
      Add an event listener.
      Parameter addParameter(java.lang.String name, ParameterType parameterType, DataType dataType)
      Add a new parameter with the specified name and type.
      Response addResponse(int statusCode, java.lang.String description)
      Add a new response with the given HTTP status code to this operation.
      Operation addResponse(Response response)
      Add a new response.
      Request createRequest()
      Create and set a minimal request definition (blank schema) for this operation.
      Operation deleteParameter(java.lang.String name)
      Delete an existing parameter with the specified name.
      Operation deleteRequest()
      Delete the request definition for this operation.
      Operation deleteResponse(int statusCode)
      Delete an existing response with the given HTTP status code from this operation.
      java.util.List<java.lang.String> getConsumesMIMETypes()
      Get a list of MIME types (for example application/json) that this operation can consume.
      java.lang.String getDescription()
      Get a description of this operation.
      Method getMethod()
      Get the HTTP method of this operation, for example "GET".
      java.lang.String getName()
      Get the name of this operation, for example "getPetById".
      java.lang.String getName(boolean allowGenerated)
      Get the name of this operation, for example "getPet", specifying whether to allow generated names to be returned.
      Parameter getParameter(java.lang.String name)
      Get the parameter with the specified name.
      java.util.List<Parameter> getParameters()
      Get the list of parameters supported by this operation.
      java.util.List<java.lang.String> getProducesMIMETypes()
      Get a list of MIME types (for example application/json) that this operation can produce.
      Request getRequest()
      Get the request definition for this operation.
      Resource getResource()
      Get the resource that this operation belongs to.
      Response getResponse(int statusCode)
      Get the response with the given HTTP status code for this operation.
      java.util.List<Response> getResponses()
      Get a list of possible responses for this operation.
      java.util.List<java.util.List<SecurityRequirement>> getSecurityRequirements()
      Get a list of security requirements for this operation.
      java.lang.String getSummary()
      Get a summary of this operation.
      void removeListener(java.beans.PropertyChangeListener listener)
      Remove an event listener.
      Operation setConsumesMIMETypes(java.util.List<java.lang.String> consumes)
      Set the list of MIME types (for example application/json) that this operation can consume.
      Operation setDescription(java.lang.String description)
      Set the description of this operation.
      Operation setMethod(Method method)
      Set the HTTP method of this operation, for example "GET".
      Operation setName(java.lang.String name)
      Set the name of this operation, for example "getPetById".
      Operation setProducesMIMETypes(java.util.List<java.lang.String> produces)
      Set the list of MIME types (for example application/json) that this operation can produce.
      Operation setRequest(Request request)
      Set the request definition for this operation.
      Operation setRequest(java.lang.String description, boolean required, com.ibm.broker.rest.schema.SchemaType schemaType, java.lang.String schema)
      Set the request definition for this operation.
      Operation setSummary(java.lang.String summary)
      Set the summary of this operation.
    • Method Detail

      • addListener

        void addListener(java.beans.PropertyChangeListener listener)
        Add an event listener.
        Parameters:
        listener -
      • removeListener

        void removeListener(java.beans.PropertyChangeListener listener)
        Remove an event listener.
        Parameters:
        listener -
      • getResource

        Resource getResource()
        Get the resource that this operation belongs to.
        Returns:
        the resource that this operation belongs to.
      • getName

        java.lang.String getName()
        Get the name of this operation, for example "getPetById".
        Returns:
        the name of this operation.
      • getName

        java.lang.String getName(boolean allowGenerated)
        Get the name of this operation, for example "getPet", specifying whether to allow generated names to be returned. Generated names differ from the operationId only if the operationId is missing or invalid in some way (e.g. " "). A non-generated name will correspond to the operationId.
        Parameters:
        allowGenerated - used to specify whether we want to allow retrieving a generated name or just what is specified in the swagger.
        Returns:
        the name of this operation.
      • setName

        Operation setName(java.lang.String name)
                   throws ApiException
        Set the name of this operation, for example "getPetById".
        Parameters:
        name - the new name of this operation.
        Returns:
        this operation.
        Throws:
        ApiException - if the name could not be changed.
      • getMethod

        Method getMethod()
        Get the HTTP method of this operation, for example "GET".
        Returns:
        the HTTP method of this operation.
      • setMethod

        Operation setMethod(Method method)
                     throws ApiException
        Set the HTTP method of this operation, for example "GET".
        Parameters:
        method - the new HTTP method of this operation.
        Returns:
        this operation.
        Throws:
        ApiException - if the HTTP method could not be changed.
      • getParameters

        java.util.List<Parameter> getParameters()
        Get the list of parameters supported by this operation.
        Returns:
        the list of parameters supported by this operation.
      • getParameter

        Parameter getParameter(java.lang.String name)
                        throws ApiException
        Get the parameter with the specified name.
        Parameters:
        name - the name of the parameter.
        Returns:
        the parameter.
        Throws:
        ApiException - if no parameter with the specified name exists.
      • addParameter

        Parameter addParameter(java.lang.String name,
                               ParameterType parameterType,
                               DataType dataType)
                        throws ApiException
        Add a new parameter with the specified name and type.
        Parameters:
        name - the name of the parameter.
        parameterType - the type of the parameter.
        dataType - the data type of the parameter.
        Returns:
        the new parameter.
        Throws:
        ApiException - if the new parameter could not be added.
      • deleteParameter

        Operation deleteParameter(java.lang.String name)
                           throws ApiException
        Delete an existing parameter with the specified name.
        Parameters:
        name - the name of the parameter.
        Returns:
        this operation.
        Throws:
        ApiException - if the existing parameter could not be deleted.
      • getDescription

        java.lang.String getDescription()
        Get a description of this operation. The description is optional.
        Returns:
        the description of this operation, null if no description is specified.
      • setDescription

        Operation setDescription(java.lang.String description)
                          throws ApiException
        Set the description of this operation. The description is optional.
        Parameters:
        description - the new description of this operation.
        Returns:
        this operation.
        Throws:
        ApiException - if the description could not be changed.
      • getSummary

        java.lang.String getSummary()
        Get a summary of this operation. The summary is optional.
        Returns:
        the summary of this operation, null if no summary is specified.
      • setSummary

        Operation setSummary(java.lang.String summary)
                      throws ApiException
        Set the summary of this operation. The summary is optional.
        Parameters:
        summary - the new summary of this operation.
        Returns:
        this operation.
        Throws:
        ApiException - if the summary could not be changed.
      • getRequest

        Request getRequest()
        Get the request definition for this operation. The request definition is optional.
        Returns:
        the request definition for this operation if one exists, otherwise returns null.
      • createRequest

        Request createRequest()
                       throws ApiException
        Create and set a minimal request definition (blank schema) for this operation. The request definition is optional.
        Returns:
        the Operation.
        Throws:
        ApiException
      • setRequest

        Operation setRequest(Request request)
                      throws ApiException
        Set the request definition for this operation. The request definition is optional.
        Parameters:
        request - the desired request definition.
        Returns:
        the current instance of the operation class.
        Throws:
        ApiException
      • setRequest

        Operation setRequest(java.lang.String description,
                             boolean required,
                             com.ibm.broker.rest.schema.SchemaType schemaType,
                             java.lang.String schema)
                      throws ApiException,
                             com.fasterxml.jackson.core.JsonParseException,
                             com.fasterxml.jackson.databind.JsonMappingException,
                             java.io.IOException
        Set the request definition for this operation. The request definition is optional.
        Returns:
        the operation.
        Throws:
        java.io.IOException
        com.fasterxml.jackson.databind.JsonMappingException
        com.fasterxml.jackson.core.JsonParseException
        ApiException
      • deleteRequest

        Operation deleteRequest()
                         throws ApiException
        Delete the request definition for this operation. The request definition is optional.
        Returns:
        the operation
        Throws:
        ApiException
      • getResponses

        java.util.List<Response> getResponses()
        Get a list of possible responses for this operation.
        Returns:
        the list of possible responses for this operation.
      • getResponse

        Response getResponse(int statusCode)
                      throws ApiException
        Get the response with the given HTTP status code for this operation.
        Parameters:
        statusCode - the HTTP status code of the response.
        Returns:
        the response.
        Throws:
        ApiException - if no response with the specified HTTP status code exists.
      • addResponse

        Response addResponse(int statusCode,
                             java.lang.String description)
                      throws ApiException
        Add a new response with the given HTTP status code to this operation.
        Parameters:
        statusCode - the HTTP status code of the response.
        description - the description of the response.
        Returns:
        the new response.
        Throws:
        ApiException - if the new response could not be added.
      • addResponse

        Operation addResponse(Response response)
                       throws ApiException
        Add a new response.
        Parameters:
        response - the response object to add
        Returns:
        the current instance of the Operation class.
        Throws:
        ApiException
      • deleteResponse

        Operation deleteResponse(int statusCode)
                          throws ApiException
        Delete an existing response with the given HTTP status code from this operation.
        Parameters:
        statusCode - the HTTP status code of the response.
        Returns:
        this operation.
        Throws:
        ApiException - if the existing response could not be deleted.
      • getConsumesMIMETypes

        java.util.List<java.lang.String> getConsumesMIMETypes()
        Get a list of MIME types (for example application/json) that this operation can consume.
        Returns:
        a list of MIME types that that this operation can consume, or null if not specified.
      • setConsumesMIMETypes

        Operation setConsumesMIMETypes(java.util.List<java.lang.String> consumes)
                                throws ApiException
        Set the list of MIME types (for example application/json) that this operation can consume.
        Parameters:
        consumes - the list of MIME types that this operation can consume, or null to clear the list.
        Returns:
        this operation.
        Throws:
        ApiException - if the list could not be set.
      • getProducesMIMETypes

        java.util.List<java.lang.String> getProducesMIMETypes()
        Get a list of MIME types (for example application/json) that this operation can produce.
        Returns:
        a list of MIME types that that this operation can consume, or null if not specified.
      • setProducesMIMETypes

        Operation setProducesMIMETypes(java.util.List<java.lang.String> produces)
                                throws ApiException
        Set the list of MIME types (for example application/json) that this operation can produce.
        Parameters:
        produces - the list of MIME types that this operation can produce, or null to clear the list.
        Returns:
        this operation.
        Throws:
        ApiException - if the list could not be set.
      • getSecurityRequirements

        java.util.List<java.util.List<SecurityRequirement>> getSecurityRequirements()
        Get a list of security requirements for this operation. The returned object is a list containing a set of alternative security requirement options. You only need to satisfy the security requirements for one security requirement option in that set. Each security requirement option is itself a list, containing a set of security requirements that must all be satisfied in order to satisfy the security requirement option.
        Returns:
        a list of security requirements for this API.