com.ibm.broker.rest

Interface Resource



  • public interface Resource
    An interface that describes a resource in an API. A resource has a path, and a set of operations that can be invoked on that resource.
    Since:
    IBM Integration Bus v10
    • Method Detail

      • getApi

        Api getApi()
        Get the API that this resource belongs to.
        Returns:
        the API that this resource belongs to.
      • getPath

        java.lang.String getPath()
        Get the path that this resource is served from, for example "/customers/{id}/details".
        Returns:
        the path that this resource is served from.
      • setPath

        Resource setPath(java.lang.String path)
                  throws ApiException
        Set the path that this resource is served from, for example "/customers/{id}/details".
        Parameters:
        path - the new path of this resource.
        Returns:
        this resource.
        Throws:
        ApiException - if the path could not be changed.
      • getOperations

        java.util.List<Operation> getOperations()
        Get the list of operations that are served from this resource.
        Returns:
        the list of operations that are served from this resource.
      • getOperation

        Operation getOperation(java.lang.String name)
                        throws ApiException
        Get the operation with the specified name.
        Parameters:
        name - the name of the operation.
        Returns:
        the operation with the specified name.
        Throws:
        ApiException - if no operation with the specified name exists.
      • getOperation

        Operation getOperation(Method method)
                        throws ApiException
        Get the operation with the specified HTTP method.
        Parameters:
        method - the HTTP method of the operation.
        Returns:
        the operation with the specified HTTP method.
        Throws:
        ApiException - if no operation with the specified HTTP method exists.
      • addOperation

        Operation addOperation(java.lang.String name,
                               Method method)
                        throws ApiException
        Add a new operation with the specified name and HTTP method.
        Parameters:
        name - the name of the operation.
        method - the HTTP method of the operation.
        Returns:
        the new operation.
        Throws:
        ApiException - if the new operation could not be added.
      • addOperation

        Operation addOperation(Operation operation)
                        throws ApiException
        Add an operation object to the resource
        Parameters:
        operation - the operation object.
        Returns:
        the operation.
        Throws:
        ApiException - if the new operation could not be added.
      • deleteOperation

        Resource deleteOperation(java.lang.String name)
                          throws ApiException
        Delete an existing operation from this resource.
        Parameters:
        name - the name of the operation.
        Returns:
        this API.
        Throws:
        ApiException - if the existing operation could not be deleted.
      • getDescription

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

        Resource setDescription(java.lang.String description)
                         throws ApiException
        Set the description of this resource.
        Parameters:
        description - the new description of this resource.
        Returns:
        this resource.
        Throws:
        ApiException - if the description could not be changed.