~~Title: Using Client/Server Properties~~
Client/Server properties are used to transmit information about the client to the server and vice versa. The transmission of properties is integrated in the communication protocol and does not require special handling.
During the transmission, only new, changed, or deleted properties are considered. In addition, only strings, numbers, and boolean values are transmitted but no serializable POJOs. This guarantees that the same properties are available at the server and at the client and that they are synchronized at the time of access.
When a property is set at the client, it does not always trigger immediate transmission to the server. The properties are usually considered automatically during the next communication. There are, however, properties to which this does not apply, particularly properties that control certain settings, such as timeouts.
Properties are set at the client using the connection class:
MasterConnection macon = new MasterConnect(createConnection());
macon.setProperty(IConnectionConstants.PREFIX_CLIENT + "language", "de_AT");
Properties are defined as key/value pairs. The key can generally be chosen freely, but there are certain categories that are predefined by IConnectionConstants PREFIX_CLIENT, PREFIX_SERVER, PREFIX_SESSION, PREFIX_SYSPROP and PREFIX_REQUEST.
All properties that start with PREFIX_SERVER + PREFIX_SESSION trigger an immediate transmission from the client to the server if a connection has already been made. Properties with PREFIX_CLIENT can only be altered as long as the connection between client and server has not been created.
Several predefined properties are set when a connection is established, e.g.:
PREFIX_CLIENT + PREFIX_SYSPROP + "user.name" with System.getProperty("user.name")
PREFIX_CLIENT + PREFIX_SYSPROP + "os.name" with System.getProperty("os.name")
PREFIX_CLIENT + PREFIX_SYSPROP + "os.version" with System.getProperty("os.version")
...
...
PREFIX_CLIENT + "spec_version" mit jvx.rad.IPackageSetup.SPEC_VERSION
Properties are set/placed in the session directly at the server. The session is available via SessionContext:
SessionContext.getCurrentSession().setProperty("name", "value");
Properties are also set on the server side during initialization of the session:
PREFIX_SERVER + PREFIX_SYSPROP + "user.name" with System.getProperty("user.name")
PREFIX_SERVER + PREFIX_SYSPROP + "os.name" with System.getProperty("os.name")
PREFIX_SERVER + PREFIX_SYSPROP + "os.version" with System.getProperty("os.version")
...
...
PREFIX_SERVER + "server_version" with com.sibvisions.rad.IPackageSetup.SERVER_VERSION
PREFIX_SERVER + "spec_version" with jvx.rad.IPackageSetup.SPEC_VERSION
PREFIX_SERVER + "hostname" with the host name of the server
PREFIX_SERVER + "address" with the IP address of the server