Package org.bonitasoft.engine.util
Class APITypeManager
java.lang.Object
org.bonitasoft.engine.util.APITypeManager
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
-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<String, String> 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);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ApiAccessTypestatic voidrefresh()static voidsetAPITypeAndParams(ApiAccessType type, Map<String, String> parameters)
-
Constructor Details
-
APITypeManager
public APITypeManager()
-
-
Method Details
-
getAPIType
public static ApiAccessType getAPIType() throws org.bonitasoft.engine.exception.ServerAPIException, UnknownAPITypeException, IOException- Throws:
org.bonitasoft.engine.exception.ServerAPIExceptionUnknownAPITypeExceptionIOException
-
getAPITypeParameters
public static Map<String,String> getAPITypeParameters() throws org.bonitasoft.engine.exception.ServerAPIException, IOException- Throws:
org.bonitasoft.engine.exception.ServerAPIExceptionIOException
-
setAPITypeAndParams
-
refresh
public static void refresh()
-