Class ClientParams

java.lang.Object
com.iizix.server.client.ClientParams

public class ClientParams extends 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 Details

    • SERVER_CONFIGURATION_ENVIRONMENT

      public static final String SERVER_CONFIGURATION_ENVIRONMENT
      The Server configuration environment property: "env".
      See Also:
    • query

      public final String query
      The original query.
    • error

      public final String error
      The error message, null for OK.
    • appID

      public final String appID
      The Application ID, null if not found.
    • app

      public final AppFactory app
      The application to use, null if not found.
    • isUnknownApp

      public final boolean isUnknownApp
      Tells whether the error is that the application named in "&app=" is not registered on this server: the one refusal an external page answers with status 404 and a small JSON body instead of a failure (CC-FIX-SERVER-THEME-WALK, AW-5 of CC-ANDROID-APPS-WALK).
    • user

      public SessionUserIdentifier user
      The session user identifier, null if not defined properly.
  • Constructor Details

    • ClientParams

      public ClientParams(ServerShell server, String query)
      Constructor for a WebSocket client: the Application ID and the user label are required.
      Parameters:
      server - The server instance.
      query - The Query string from the URI.
    • ClientParams

      public ClientParams(ServerShell server, String query, boolean doRequireKey)
      Constructor.
      Parameters:
      server - The server instance.
      query - The Query string from the URI.
      doRequireKey - The Application ID in "&app=" and the user label in "&user=" are required, as for a WebSocket client. No client public key is used any more (IIZI version 5, L-15 R5): a WebSocket client that sends one in "&k=" without the protocol version in "&pv=" is an iiziApp page of an earlier version and gets an error.
  • Method Details

    • assignSessionID

      public SessionUserIdentifier assignSessionID(String sessionID)
      Assigns a new Session ID for this session. This changes the user instance to a new SessionUserIdentifier instance.
      Parameters:
      sessionID - The session ID.
      Returns:
      The new SessionUserIdentifier.
    • getParameterValue

      public String getParameterValue(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 String toString()
      Returns a string representation of this client parameters and its values.
      Overrides:
      toString in class Object
      Returns:
      A string representation.