Package org.bonitasoft.engine.util
Class APITypeManager
- java.lang.Object
-
- org.bonitasoft.engine.util.APITypeManager
-
public class APITypeManager extends java.lang.ObjectSpecify 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:
HashMapparameters = 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 Constructor Description APITypeManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ApiAccessTypegetAPIType()static java.util.Map<java.lang.String,java.lang.String>getAPITypeParameters()static voidrefresh()static voidsetAPITypeAndParams(ApiAccessType type, java.util.Map<java.lang.String,java.lang.String> parameters)
-
-
-
Method Detail
-
getAPIType
public static ApiAccessType getAPIType() throws org.bonitasoft.engine.exception.ServerAPIException, UnknownAPITypeException, java.io.IOException
- Throws:
org.bonitasoft.engine.exception.ServerAPIExceptionUnknownAPITypeExceptionjava.io.IOException
-
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.ServerAPIExceptionjava.io.IOException
-
setAPITypeAndParams
public static void setAPITypeAndParams(ApiAccessType type, java.util.Map<java.lang.String,java.lang.String> parameters)
-
refresh
public static void refresh()
-
-