Class APITypeManager


  • public class APITypeManager
    extends java.lang.Object
    Specify how the client communicate with the engine. There are three ways of doing it:
    • Using Java System Properties
    • Programmatically
    • DEPRECATED: using a file inside bonita-home. See online documentation.

    Using Java System Properties

    Use System property -Dorg.bonitasoft.engine.api-type=

    • LOCAL:

      connect to the server in the local JVM (default). No other configuration is necessary.

    • HTTP

      connect to the server using HTTP. You must also specify:

      • -Dorg.bonitasoft.engine.api-type.server.url=HTTP_SERVER_URL, e.g. http://localhost:8080
      • -Dorg.bonitasoft.engine.api-type.application.name=WEBAPP_NAME, this is the name of the web application, e.g. bonita
      Optionally you can specify the maximum number of connections (JVM-wide) using -Dorg.bonitasoft.engine.api-type.connections.max=CONNECTIONS_MAX

    • TCP

      not recommended, only for testing purpose.

    Programmatically

    • LOCAL access:

      APITypeManager.setAPITypeAndParams(ApiAccessType.LOCAL, null);

    • HTTP access:
       HashMap parameters = new HashMap<>();
       parameters.put("server.url", "http://myserver.com:8080");
       parameters.put("application.name", "bonita-application");
       parameters.put("connections.max", "5");
       APITypeManager.setAPITypeAndParams(ApiAccessType.HTTP, parameters);
       
    See Also:
    Online documentation on Client configuration
    • Constructor Detail

      • APITypeManager

        public APITypeManager()
    • Method Detail

      • getAPITypeParameters

        public static java.util.Map<java.lang.String,​java.lang.String> getAPITypeParameters()
                                                                                           throws org.bonitasoft.engine.exception.ServerAPIException,
                                                                                                  java.io.IOException
        Throws:
        org.bonitasoft.engine.exception.ServerAPIException
        java.io.IOException
      • setAPITypeAndParams

        public static void setAPITypeAndParams​(ApiAccessType type,
                                               java.util.Map<java.lang.String,​java.lang.String> parameters)
      • refresh

        public static void refresh()