Package com.iizix.server.client
Class ClientParams
- java.lang.Object
- com.iizix.server.client.ClientParams
public class ClientParams extends java.lang.Object
Class used to hold the information for the client parameters and to parse the Query string in the Client WebSocket URI.- Author:
- Christopher Mindus
Field Summary
Fields Modifier and Type Field Description AppFactory
app
The application to use, null if not found.java.lang.String
appID
The Application ID, null if not found.java.lang.String
error
The error message, null for OK.java.lang.String
hash
The user hash when the user is returning.java.lang.String
query
The original query.static java.lang.String
SERVER_CONFIGURATION_ENVIRONMENT
The Server configuration environment property: "env".SessionUserIdentifier
user
The session user identifier, null if not defined properly.
Constructor Summary
Constructors Constructor Description ClientParams(ServerShell server, java.lang.String query)
Constructor with public key required from remote party.ClientParams(ServerShell server, java.lang.String query, boolean doRequireKey)
Constructor.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendPublicKey(SendTransaction trans)
Appends the server public key for the Diffie-Hellman key exchange with the client.SessionUserIdentifier
assignSessionID(java.lang.String sessionID)
Assigns a new Session ID for this session.java.lang.String
getParameterValue(java.lang.String name)
Gets a property that is defined as the "other" properties, e.g.java.lang.String
toString()
Returns a string representation of this client parameters and its values.java.lang.String
updatePassword(ReadTransaction trans)
Updates the instance with the encrypted password in the transaction from a client.
Field Detail
SERVER_CONFIGURATION_ENVIRONMENT
public static final java.lang.String SERVER_CONFIGURATION_ENVIRONMENT
The Server configuration environment property: "env".- See Also:
- Constant Field Values
query
public final java.lang.String query
The original query.
error
public final java.lang.String error
The error message, null for OK.
appID
public final java.lang.String appID
The Application ID, null if not found.
app
public final AppFactory app
The application to use, null if not found.
user
public SessionUserIdentifier user
The session user identifier, null if not defined properly.
hash
public final java.lang.String hash
The user hash when the user is returning.
Constructor Detail
ClientParams
public ClientParams(ServerShell server, java.lang.String query)
Constructor with public key required from remote party.- Parameters:
server
- The server instance.query
- The Query string from the URI.
ClientParams
public ClientParams(ServerShell server, java.lang.String query, boolean doRequireKey)
Constructor.- Parameters:
server
- The server instance.query
- The Query string from the URI.doRequireKey
- Public key required in "&k=" parameter and Application ID in "&app=".
Method Detail
assignSessionID
public SessionUserIdentifier assignSessionID(java.lang.String sessionID)
Assigns a new Session ID for this session. This changes theuser
instance to a newSessionUserIdentifier
instance.- Parameters:
sessionID
- The session ID.- Returns:
- The new SessionUserIdentifier.
appendPublicKey
public void appendPublicKey(SendTransaction trans)
Appends the server public key for the Diffie-Hellman key exchange with the client.- Parameters:
trans
- The transaction.
updatePassword
public final java.lang.String updatePassword(ReadTransaction trans) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException, java.io.UnsupportedEncodingException, java.security.InvalidAlgorithmParameterException
Updates the instance with the encrypted password in the transaction from a client.- Parameters:
trans
- The transaction.- Returns:
- The password.
- Throws:
java.lang.IllegalArgumentException
- If the password encoding is invalid.java.io.UnsupportedEncodingException
- If the named charset is not supported.javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
javax.crypto.NoSuchPaddingException
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
getParameterValue
public java.lang.String getParameterValue(java.lang.String name)
Gets a property that is defined as the "other" properties, e.g.SERVER_CONFIGURATION_ENVIRONMENT
for server configuration environment.- Parameters:
name
- The parameter name, e.g. "env".- Returns:
- The defined parameter value, or null if undefined.
toString
public java.lang.String toString()
Returns a string representation of this client parameters and its values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation.