com.ibm.broker.rest

Interface ApiProvider



  • public interface ApiProvider
    An implementation of this interface provides methods for loading and saving the definitions of an API from a file or URL, where those definitions are stored in a API definition language supported by that implementation. To add support for new API definition languages, you must provide an implementation of this class, and make that implementation available to the ApiProviderFactory.
    Since:
    IBM Integration Bus v10
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      Api create()
      Create a new API.
      java.lang.String getDescription()
      Get a description of this API provider.
      java.lang.String getID()
      Get the ID of this API provider.
      java.lang.String getName()
      Get the name of this API provider.
      Api load(java.io.InputStream is, java.lang.String fileName, Resolver resolver)
      Load an API from the specified input stream, using the specified resolver to find any other files that are required to load this API.
      Api load(java.nio.file.Path file)
      Load an API from the specified file.
      Api load(java.nio.file.Path file, Resolver resolver)
      Load an API from the specified file, using the specified resolver to find any other files that are required to load this API.
      Api load(java.net.URI uri)
      Load an API from the specified URI.
      Api loadFromZip(java.util.zip.ZipInputStream zis, java.lang.String fileName)
      Load an API from the specified file, which should be loaded from the specified ZIP input stream.
    • Method Detail

      • getID

        java.lang.String getID()
        Get the ID of this API provider.
        Returns:
        the ID of this API provider.
      • getName

        java.lang.String getName()
        Get the name of this API provider.
        Returns:
        the name of this API provider.
      • getDescription

        java.lang.String getDescription()
        Get a description of this API provider.
        Returns:
        a description of this API provider.
      • load

        Api load(java.net.URI uri)
          throws ApiException
        Load an API from the specified URI.
        Parameters:
        uri - the URI of the API to load.
        Returns:
        the loaded API.
        Throws:
        ApiException - if an error occurs loading the API.
      • load

        Api load(java.nio.file.Path file)
          throws ApiException
        Load an API from the specified file. A default resolver is used to find any other files that are required to load this API.
        Parameters:
        file - the file to load the API from.
        Returns:
        the loaded API.
        Throws:
        ApiException - if an error occurs loading the API.
      • load

        Api load(java.nio.file.Path file,
                 Resolver resolver)
          throws ApiException
        Load an API from the specified file, using the specified resolver to find any other files that are required to load this API.
        Parameters:
        file - the file to load the API from.
        resolver - the resolver to use to find any other required files.
        Returns:
        the loaded API.
        Throws:
        ApiException - if an error occurs loading the API.
      • load

        Api load(java.io.InputStream is,
                 java.lang.String fileName,
                 Resolver resolver)
          throws ApiException
        Load an API from the specified input stream, using the specified resolver to find any other files that are required to load this API.
        Parameters:
        is - the input stream to load the API from.
        fileName - the file name that represents this input stream.
        resolver - the resolver to use to find any other required files.
        Returns:
        the loaded API.
        Throws:
        ApiException - if an error occurs loading the API.
      • loadFromZip

        Api loadFromZip(java.util.zip.ZipInputStream zis,
                        java.lang.String fileName)
                 throws ApiException
        Load an API from the specified file, which should be loaded from the specified ZIP input stream. Additional files may be read from the ZIP input stream.
        Parameters:
        zis - the ZIP input stream to load the API from.
        fileName - the file to load the API from.
        Returns:
        the loaded API.
        Throws:
        ApiException - if an error occurs loading the API.
      • create

        Api create()
            throws ApiException
        Create a new API. The new API will have no resources, operations, or parameters.
        Returns:
        the new API.
        Throws:
        ApiException - if an error occurs creating the new API.