Session
com.kesoftware.imu.Session
com.kesoftware.imu.Session
Since: 1.0
Description
Manages a connection to an IMu server.
The server’s host name and port can be specified by setting properties on the object or by setting class-based default properties.
Class Properties
Method |
Details |
---|---|
The name of the host to connect to if no object-specific host has been supplied. Getter: String getDefaultHost() Setter: setDefaultHost(String value) |
|
The number of the port on the host if no object-specific port has been supplied. Getter: int getDefaultPort() Setter: setDefaultPort(int value) |
Constructors
Constructor |
Details |
||||
---|---|---|---|---|---|
|
Session(String host, int port) Creates a Session object with the specified Parameters:
|
||||
|
Session(String host) Creates a Session object with the specified The port to connect on will be taken from the Parameters:
|
||||
|
Session(int port) Creates a Session object with the specified port. The host to connect to will be taken from the Parameters:
|
||||
|
Session() Creates a Session object. The host to connect to will be taken from the The port to connect on will be taken from the |
Properties
Property |
Details |
---|---|
|
A flag controlling whether the connection to the server should be closed after the next request. This flag is passed to the server as part of the next request to allow it to clean up. Getter: boolean getClose() Setter: setClose(boolean value) |
|
The unique identifier assigned by the server to the current session. Getter: String getContext() Setter: setContext(String value) |
The name of the host to connect to. Setting this property after the connection has been established has no effect. Getter: String getHost() Setter: setHost(String value) |
|
The number of the port on the host to connect to. Setting this property after the connection has been established has no effect. Getter: int getPort() Setter: setPort(int value) |
|
|
A flag controlling whether the server process handling this session should begin listening on a distinct, process-specific port to ensure a new session connects to the same server process. This is part of IMu's mechanism for maintaining state. If this flag is set
to true, then after the next request is made to the server, the
Getter: boolean getSuspend() Setter: setSuspend(boolean value) |
Methods
Property |
Details |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
void connect() Open a connection to an IMu server. Returns:
Throws:
|
||||||||||||
|
void disconnect() Closes the connection to the IMu server. Returns:
|
||||||||||||
|
Map login(String login, String password, boolean spawn) Logs in as the given user with the given password. The Parameters:
Returns:
Throws:
|
||||||||||||
|
Map login(String login, String password) Logs in as the given user with the given password. The
Parameters:
Returns:
Throws:
|
||||||||||||
|
Map login(String login) Logs in as the given user. Uses server-side authentication (such as The server will spawn a new child process specifically for handling the newly logged in user's requests. Parameters:
Returns:
Throws:
|
||||||||||||
|
Map logout() Logs the user out of the server. Returns:
|
||||||||||||
|
Map request(Map request) Submits a low-level request to the IMu server. Parameters:
Returns:
Throws:
|