Server setup
Standalone based servers
The standalone, raspberrypi and swing
servers are packaged as a zip file that contains scripts
(under the bin directory) to start an stop the server.
When these servers are started they take the configuration parameters
from the file located in conf/server.properties.
The parameters that can be set in this file are the following:
- port: the TCP port through which the server will accept connections.
The port by default is 9999.
- shutdownFile: the path of the shutdown file.
When this file is specified, the server creates it on startup and shuts down when it is removed.
- multiTenant: a boolean (true or false)
that enables the multi-tenant mode. By default multiTenant is false.
- accessKey: the server access key. That key grants access to all modules in the server.
By default its value is null and the server is unprotected.
- accessKeyFile: the path of the access key file used in multi-tenant mode.
That file is a Java properties file that contains for each tenant its server access key (tenant=accessKey).
- libraries: a comma separated string that contains the name of the libraries to load at startup.
By default, only Core and Module libraries are loaded.
- keyStoreFile: the path of the key store file to enable secure server connections.
- keyStoreType: the type of the key store file. By default that type is PKCS12.
- keyStorePass: the key store password.
- keyPass: the key password.
- sslProtocol: the secure sockets layer protocol. By default sslProtocol is TLS.
- storeClass: the full Java class name of the server store.
By default storeClass is org.brain4it.server.store.FileSystemStore.
- basePath: the path where the FileSystemStore will save the module data.
By default that path is System.getProperty("user.home") + "/brain4it_modules"
- maxWaitTime: the maximum number of seconds to wait for a result in a POST call (command execution or exterior function invocation).
By default its value is 300 seconds (5 minutes).
- monitorMaxWaitTime: the maximum number of seconds to wait for an exterior function to return a value in a monitoring session.
By default its value is 10 seconds.
- monitorPingTime: the time in seconds between two consecutive ping messages sent to the client.
Ping messages are sent to check if connection has been closed.
By default monitorPingTime is 30 seconds.
See Watch exterior functions for more details.
- keepAliveTime: the maximum time in seconds that the server will keep an
idle socket open in HTTP persistent connections. By default keepAliveTime is 5 seconds.
To load an additional library on these servers copy its jar file (and others it depends on) in the
lib directory of the server and add the library name to the libraries
property of conf/server.properties file.
J2EE server
The J2EE server is intented to run on a web container like Tomcat or Jetty
and is packaged as a war file.
It can be configured through the context parameters of the web application file
(located in WEB-INF/web.xml).
The configuration (context) parameters that this server accepts are the following:
- basePath: the path where the FileSystemStore will save the module data.
By default that path is System.getProperty("user.home") + "/brain4it_modules"
- multiTenant: a boolean (true or false)
that enables the multi-tenant mode. By default multiTenant is false.
- accessKey: the server access key. That key grants access to all modules in the server.
By default its value is null and the server is unprotected.
- accessKeyFile: the path of the access key file used in multi-tenant mode.
That file is a Java properties file that contains for each tenant its server access key (tenant=accessKey).
- libraries: a comma separated string that contains the name of the libraries to load at startup.
- maxWaitTime: the maximum number of seconds to wait for a result in a POST call (command execution or exterior function invocation).
By default its value is 300 seconds (5 minutes).
- monitorMaxWaitTime: the maximum number of seconds to wait for an exterior function to return a value in a monitoring session.
By default its value is 10 seconds.
- monitorPingTime: the time in seconds between two consecutive ping messages sent to the client.
Ping messages are sent to check if connection has been closed.
By default monitorPingTime is 30 seconds.
See Watch exterior functions for more details.
Secure server connections must be configured in the web container (server.xml file in Tomcat)
To load an additional library on this server copy its jar file (and others it depends on) in the
WEB-INF/lib directory of the web applitation and add the library name to the libraries
property of WEB-INF/web.xml file.
Android server
The android server is packaged as a apk file and only accepts the following configuration
parameters that can be set through the setup menu of the application:
- Server port: the TCP port through which the server will accept connections.
A number in the range 1024-65535. The port by default is 9999.
- Access Key: the server access key. That key grants access to all modules in the server.
By default its value is null and the server is unprotected.