Interface IRemoteSessionControl


public interface IRemoteSessionControl
Interface that the framework session uses to perform functions on the client side.

This interface is only intended to be used by the framework.

Author:
Christopher Mindus
  • Method Details

    • triggerUnlockCheck

      void triggerUnlockCheck(int serial)
      Triggers a check for unlock event to the client side. Do not call this method, it is intended for the communications framework.
      Parameters:
      serial - The serial.
    • triggerRemoteOpenWindow

      boolean triggerRemoteOpenWindow(String url, String target, WindowOptions options, IWindowCloseListener windowListener)
      Triggers opening of a browser window on the client.
      Parameters:
      url - The URL to open.
      target - The target, null for _blank.
      options - Options to use, null for "new tab" for a browser client.
      windowListener - Callback to listen to blocked or user close window, null for none.
      Returns:
      true for success, false if the window cannot be opened because another window already is open or that the session is disposed of. In case of failure, any callback close listener will not be invoked.
    • triggerRemoteCloseWindow

      boolean triggerRemoteCloseWindow(boolean ignoreCallbackListener)
      Triggers closing of the window on the client that was opened with triggerRemoteOpenWindow.
      Parameters:
      ignoreCallbackListener - Flag to ignore calling a potential callback listener.
      Returns:
      true for success, false if no open window is present.
    • assignAuthenticatedUser

      void assignAuthenticatedUser(String userName)
      Tells the client the user that has signed in, for iiziRun to offer as the user name the next time it is started.

      The name is all the client is told. Until CC-LOGIN-L5-DEVICE-TOKEN (SignIn L-5, HUB-DESIGN R-22) this method also took the user's stored password hash and sent it to the client: a password equivalent that crossed the wire at every sign-in. What a device keeps to sign in again is the device token of IUserAuthenticationUI, never a password and never its hash.

      Parameters:
      userName - The user name.
    • sendStat

      void sendStat(String event, DeviceParameter... params)
      Sends an event to the analytics engine of the client, which logs it under its name.

      The event is sent to the client at once, and what happens to it there is the client's matter. A Browser hands it to Google Analytics only while Analytics runs: the application has a Measurement ID and, where consent is asked, only after the user's consent. iiziRun hands it to Firebase Analytics per its "Usage statistics" switch. Any other client drops it.

      The names follow the rules of Google Analytics 4 and Firebase, with ONE normalisation that every sender applies the same way - this API, the Browser client's sink in iz/analytics.js and iiziRun's own events in init.js (CC-FIX-GA4-V5): a hyphen in the event name or in a parameter name becomes an underscore, so js-exception is sent as js_exception. What is sent then starts with a letter and holds letters, digits and underscores only, 40 characters at most, does not start with one of the reserved prefixes firebase_, google_ or ga_, and is not one of the event names Google reserves (session_start, first_visit, page_view, error and the others of its documented lists): a name that fails this is refused with one WARNING in the log naming it, and nothing is sent. At most 25 parameters are sent with an event. A value longer than 100 characters is cut to 100, with a WARNING in the log that names the parameter and never the value. A sensitive parameter and a parameter whose value is null are not sent, and their names are not checked.

      Parameters:
      event - The event name.
      params - Parameters to send, null values and sensitive parameters are ignored.
      Throws:
      IllegalArgumentException - If the event name or the name of a parameter to send is not valid, the message naming it, or if more than 25 parameters are to be sent. Nothing is sent then.
      NullPointerException - If the event name or a parameter is null.
    • saveClientStorage

      boolean saveClientStorage(ISensitiveParameterHandler sensitive, DeviceParameter... params)
      Saves values in the client's storage for the current app (CC-CLIENT-STORAGE-V5): the settings of an iiziRun device, the localStorage of a Browser or an installed web app. The values travel over the WebSocket only, in the DevParams container of the client environment; the server never reads them from a request.

      Sensitive values are encrypted with a key kept on the server side. The encrypted data is padded and sent to the client and no key is used on the client side. Only the fingerprint of the server key used is included in the encrypted data. This means that the sensitive value is virtually undecipherable on the client side.

      Parameters:
      sensitive - Processor for sensitive information.
      params - Items to save. A DeviceParameter value of null means that the item and its value is removed from storage. Upon return of this method, each DeviceParameter of params is updated with a new state. Possible states are DeviceParameter.State.SUCCESS, DeviceParameter.State.UNAVAILABLE, DeviceParameter.State.NOT_FOUND or DeviceParameter.State.ENCRYPT_ERROR.
      Returns:
      true for success of at least one item, false for failure (or no items to save). In case of functional failure (i.e. not if an item is not found), an error is logged in the server.
    • getClientStorage

      boolean getClientStorage(ISensitiveParameterHandler sensitive, DeviceParameter... params)
      Retrieves values from the client's storage for the current app (CC-CLIENT-STORAGE-V5). The values and states are filled in before the return of this method call. The state indicates success, some error or if the item is not found. The state for each DeviceParameter is either DeviceParameter.State.SUCCESS, DeviceParameter.State.NOT_FOUND, DeviceParameter.State.UNAVAILABLE or DeviceParameter.State.DECRYPT_ERROR.
      Parameters:
      sensitive - Processor for sensitive information.
      params - The items to retrieve.
      Returns:
      true for success, false if the client's storage is not present. The return code is true if at least one item was successfully retrieved. If false is returned and the DevParams instance is not found in EnvProps for the client, an error is logged in the server.
    • getAllClientStorage

      boolean getAllClientStorage(ISensitiveParameterHandler sensitive, IDeviceParametersRefreshed callback)
      Refreshes all items of the client's storage for the current app (CC-CLIENT-STORAGE-V5). The state for each DeviceParameter is either DeviceParameter.State.SUCCESS or DeviceParameter.State.DECRYPT_ERROR.
      Parameters:
      sensitive - Processor for sensitive information.
      callback - The callback to invoke when the items are refreshed.
      Returns:
      Success when true, false when the client session is disposed of. Please note that if the client session is disposed before the items are retrieved, the callback will not be invoked. Upon success, the callback will be invoked at a later stage in the client session thread.
    • saveDeviceParameters

      @Deprecated default boolean saveDeviceParameters(ISensitiveParameterHandler sensitive, DeviceParameter... params)
      Deprecated.
      Since IIZI version 5 (CC-CLIENT-STORAGE-V5): use saveClientStorage(ISensitiveParameterHandler,DeviceParameter...).
      Saves parameters on the client device for the current app: the name of saveClientStorage(ISensitiveParameterHandler,DeviceParameter...) before IIZI version 5, which it calls.
      Parameters:
      sensitive - Processor for sensitive information.
      params - Parameters to save.
      Returns:
      true for success of at least one parameter, false otherwise.
    • getDeviceParameters

      @Deprecated default boolean getDeviceParameters(ISensitiveParameterHandler sensitive, DeviceParameter... params)
      Deprecated.
      Since IIZI version 5 (CC-CLIENT-STORAGE-V5): use getClientStorage(ISensitiveParameterHandler,DeviceParameter...).
      Retrieves parameters from the client device for the current app: the name of getClientStorage(ISensitiveParameterHandler,DeviceParameter...) before IIZI version 5, which it calls.
      Parameters:
      sensitive - Processor for sensitive information.
      params - The parameters to retrieve.
      Returns:
      true for success, false if the client's storage is not present.
    • getAllDeviceParameters

      @Deprecated default boolean getAllDeviceParameters(ISensitiveParameterHandler sensitive, IDeviceParametersRefreshed callback)
      Deprecated.
      Since IIZI version 5 (CC-CLIENT-STORAGE-V5): use getAllClientStorage(ISensitiveParameterHandler,IDeviceParametersRefreshed).
      Refreshes all device parameters from the client device for the current app: the name of getAllClientStorage(ISensitiveParameterHandler,IDeviceParametersRefreshed) before IIZI version 5, which it calls.
      Parameters:
      sensitive - Processor for sensitive information.
      callback - The callback to invoke when parameters are refreshed.
      Returns:
      Success when true, false when the client session is disposed of.