- All Known Subinterfaces:
EntityServerConfiguration
public interface ServerConfiguration
Configuration values for a
Server.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA Builder for ServerConfiguration -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyValue<Integer> The port on which the server should export the remote admin interface Value type: Integer Default value: 0 (admin not exported)static final PropertyValue<String> Specifies a username:password combination representing the server admin user
Example: scott:tiger
Value type: String Default value: nonestatic final PropertyValue<String> A comma separated list of auxiliary server factories, providing servers to run alongside this Server
Those must implementAuxiliaryServerFactoryValue type: String Default value: nonestatic final PropertyValue<String> The rmi ssl keystore to use on the classpath, this will be resolved to a temporary file and set as the javax.net.ssl.keyStore system property (JVM-wide) the first time aServerConfigurationbuilder is created Value type: String Default value: nullstatic final PropertyValue<Integer> Specifies the interval between server connection maintenance runs, in milliseconds Value type: Integer Default value: 30_000ms (30 seconds)static final intThe default connection maintenance interval in milliseconds.static final intThe default idle connection timeout in milliseconds.static final PropertyValue<Integer> Specifies the default idle client connection timeout in milliseconds.static final StringThe system property key for specifying a ssl keystorestatic final StringThe system property key for specifying a ssl keystore passwordstatic final PropertyValue<String> The rmi ssl keystore to use Value type: String Default value: nullstatic final PropertyValue<String> The rmi ssl keystore password to use Value type: String Default value: nullstatic final StringLocalhoststatic final PropertyValue<String> Specifies theObjectInputFilterFactoryclass to use Value type: String Default value: nonestatic final PropertyValue<Boolean> Specifies whether anObjectInputFilterFactoryis required for the server to run.static final PropertyValue<Integer> The port on which to locate the server registry Value type: Integer Default value:Registry.REGISTRY_PORT(1099)static final PropertyValue<Boolean> Specifies whether the server participates in RMI at all — whether it exports itself for remote data connections, exports each client connection, and binds itself into an RMI registry.static final PropertyValue<String> Specifies the rmi server hostname
Note that this is the standard Java property 'java.rmi.server.hostname' Value type: String Default value: localhoststatic final PropertyValue<String> Specifies the prefix used when exporting/looking up the Codion server Value type: String Default value: Codion Serverstatic final PropertyValue<Integer> The port on which the server is made available to clients.
If specified on the client side, the client will only connect to a server running on this port, use -1 or no value if the client should connect to any available server Value type: Integer Default value: -1static final PropertyValue<Boolean> Specifies whether the server should establish connections using a secure sockets layer, true (on) or false (off) Value type: Boolean Default value: truestatic final PropertyValue<Boolean> Specifies whether the server supplies its system properties viaServerAdmin.systemProperties(). -
Method Summary
Modifier and TypeMethodDescriptionintstatic <B extends ServerConfiguration.Builder<B>>
ServerConfiguration.Builder<B> builder()intintbooleanintport()intbooleanrmi()Note that the configured server name supplier is evaluated on each call.booleanboolean
-
Field Details
-
DEFAULT_IDLE_CONNECTION_TIMEOUT
static final int DEFAULT_IDLE_CONNECTION_TIMEOUTThe default idle connection timeout in milliseconds.- See Also:
-
DEFAULT_CONNECTION_MAINTENANCE_INTERVAL
static final int DEFAULT_CONNECTION_MAINTENANCE_INTERVALThe default connection maintenance interval in milliseconds.- See Also:
-
JAVAX_NET_KEYSTORE
The system property key for specifying a ssl keystore- See Also:
-
JAVAX_NET_KEYSTORE_PASSWORD
The system property key for specifying a ssl keystore password- See Also:
-
LOCALHOST
Localhost- See Also:
-
RMI_SERVER_HOSTNAME
Specifies the rmi server hostname
Note that this is the standard Java property 'java.rmi.server.hostname'- Value type: String
- Default value: localhost
-
SERVER_NAME_PREFIX
Specifies the prefix used when exporting/looking up the Codion server- Value type: String
- Default value: Codion Server
-
SERVER_PORT
The port on which the server is made available to clients.
If specified on the client side, the client will only connect to a server running on this port, use -1 or no value if the client should connect to any available server- Value type: Integer
- Default value: -1
-
REGISTRY_PORT
The port on which to locate the server registry- Value type: Integer
- Default value:
Registry.REGISTRY_PORT(1099)
-
RMI
Specifies whether the server participates in RMI at all — whether it exports itself for remote data connections, exports each client connection, and binds itself into an RMI registry.When false the server serves only via its auxiliary servers (typically HTTP), no RMI data connection is exported and a remote
connect()is refused; the RMI admin interface stays available independently (seeADMIN_PORT), so the server can still be introspected with theEntityServerMonitor.- Value type: Boolean
- Default value: true
-
CLASSPATH_KEYSTORE
The rmi ssl keystore to use on the classpath, this will be resolved to a temporary file and set as the javax.net.ssl.keyStore system property (JVM-wide) the first time aServerConfigurationbuilder is created- Value type: String
- Default value: null
-
KEYSTORE
The rmi ssl keystore to use- Value type: String
- Default value: null
- See Also:
-
KEYSTORE_PASSWORD
The rmi ssl keystore password to use- Value type: String
- Default value: null
-
ADMIN_PORT
The port on which the server should export the remote admin interface- Value type: Integer
- Default value: 0 (admin not exported)
-
ADMIN_USER
Specifies a username:password combination representing the server admin user
Example: scott:tiger
- Value type: String
- Default value: none
-
SSL_ENABLED
Specifies whether the server should establish connections using a secure sockets layer, true (on) or false (off)- Value type: Boolean
- Default value: true
-
IDLE_CONNECTION_TIMEOUT
Specifies the default idle client connection timeout in milliseconds.- Value type: Integer
- Default value: 120_000ms (2 minutes)
-
AUXILIARY_SERVER_FACTORIES
A comma separated list of auxiliary server factories, providing servers to run alongside this Server
Those must implementAuxiliaryServerFactory- Value type: String
- Default value: none
- See Also:
-
OBJECT_INPUT_FILTER_FACTORY
Specifies theObjectInputFilterFactoryclass to use- Value type: String
- Default value: none
- See Also:
-
OBJECT_INPUT_FILTER_FACTORY_REQUIRED
Specifies whether anObjectInputFilterFactoryis required for the server to run.If this is true and no
ServerConfiguration.Builder.objectInputFilterFactory(String)is specified, an exception is thrown on startup.- Value type: Boolean
- Default value: true
- See Also:
-
CONNECTION_MAINTENANCE_INTERVAL
Specifies the interval between server connection maintenance runs, in milliseconds- Value type: Integer
- Default value: 30_000ms (30 seconds)
-
SYSTEM_PROPERTIES
Specifies whether the server supplies its system properties viaServerAdmin.systemProperties().- Value type: Boolean
- Default value: false
-
-
Method Details
-
serverName
String serverName()Note that the configured server name supplier is evaluated on each call.- Returns:
- the server name
- Throws:
IllegalArgumentException- in case the supplied server name is null or empty- See Also:
-
rmi
boolean rmi()- Returns:
- true if the server participates in RMI (exports itself and its connections and binds into a registry)
- See Also:
-
port
int port()- Returns:
- the server port
-
registryPort
int registryPort()- Returns:
- the registry port to use
-
adminPort
int adminPort()- Returns:
- the port on which to make the server admin interface accessible
-
auxiliaryServerFactories
Collection<String> auxiliaryServerFactories()- Returns:
- the class names of auxiliary server factories, providing the servers to run alongside this server
-
authenticators
Collection<String> authenticators()- Returns:
- the class names of
Authenticators to use
-
sslEnabled
boolean sslEnabled()- Returns:
- true if ssl is enabled
-
rmiClientSocketFactory
Optional<RMIClientSocketFactory> rmiClientSocketFactory()- Returns:
- the rmi client socket factory to use, or an empty Optional if none is specified
-
rmiServerSocketFactory
Optional<RMIServerSocketFactory> rmiServerSocketFactory()- Returns:
- the rmi server socket factory to use, or an empty Optional if none is specified
-
objectInputFilterFactory
- Returns:
- the object input filter factory class name, or an empty Optional if none is specified
-
objectInputFilterFactoryRequired
boolean objectInputFilterFactoryRequired()- Returns:
- true if an
ObjectInputFilterFactoryis required for the server to run
-
connectionMaintenanceInterval
int connectionMaintenanceInterval()- Returns:
- the interval between server connection maintenance runs, in milliseconds.
-
connectionLimit
int connectionLimit()- Returns:
- the maximum number of concurrent connections, -1 for no limit
-
systemProperties
boolean systemProperties()- Returns:
- true if the server should provide its system properties via the admin interface
-
builder
- Type Parameters:
B- the builder type- Returns:
- a default server configuration builder
-