Interface IRemoteSessionControl
This interface is only intended to be used by the framework.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionvoidassignAuthenticatedUser(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.booleangetAllClientStorage(ISensitiveParameterHandler sensitive, IDeviceParametersRefreshed callback) Refreshes all items of the client's storage for the current app (CC-CLIENT-STORAGE-V5).default booleangetAllDeviceParameters(ISensitiveParameterHandler sensitive, IDeviceParametersRefreshed callback) Deprecated.booleangetClientStorage(ISensitiveParameterHandler sensitive, DeviceParameter... params) Retrieves values from the client's storage for the current app (CC-CLIENT-STORAGE-V5).default booleangetDeviceParameters(ISensitiveParameterHandler sensitive, DeviceParameter... params) Deprecated.Since IIZI version 5 (CC-CLIENT-STORAGE-V5): usegetClientStorage(ISensitiveParameterHandler,DeviceParameter...).booleansaveClientStorage(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.default booleansaveDeviceParameters(ISensitiveParameterHandler sensitive, DeviceParameter... params) Deprecated.Since IIZI version 5 (CC-CLIENT-STORAGE-V5): usesaveClientStorage(ISensitiveParameterHandler,DeviceParameter...).voidsendStat(String event, DeviceParameter... params) Sends an event to the analytics engine of the client, which logs it under its name.booleantriggerRemoteCloseWindow(boolean ignoreCallbackListener) Triggers closing of the window on the client that was opened with triggerRemoteOpenWindow.booleantriggerRemoteOpenWindow(String url, String target, WindowOptions options, IWindowCloseListener windowListener) Triggers opening of a browser window on the client.voidtriggerUnlockCheck(int serial) Triggers a check for unlock event to the client side.
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
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
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.jsand iiziRun's own events ininit.js(CC-FIX-GA4-V5): a hyphen in the event name or in a parameter name becomes an underscore, sojs-exceptionis sent asjs_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 prefixesfirebase_,google_orga_, and is not one of the event names Google reserves (session_start,first_visit,page_view,errorand 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 isnullare 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
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 theDevParamscontainer 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. ADeviceParametervalue ofnullmeans that the item and its value is removed from storage. Upon return of this method, eachDeviceParameterofparamsis updated with a new state. Possible states areDeviceParameter.State.SUCCESS,DeviceParameter.State.UNAVAILABLE,DeviceParameter.State.NOT_FOUNDorDeviceParameter.State.ENCRYPT_ERROR.- Returns:
truefor success of at least one item,falsefor 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
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 eachDeviceParameteris eitherDeviceParameter.State.SUCCESS,DeviceParameter.State.NOT_FOUND,DeviceParameter.State.UNAVAILABLEorDeviceParameter.State.DECRYPT_ERROR.- Parameters:
sensitive- Processor for sensitive information.params- The items to retrieve.- Returns:
truefor success,falseif the client's storage is not present. The return code istrueif at least one item was successfully retrieved. Iffalseis returned and theDevParamsinstance is not found inEnvPropsfor 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 eachDeviceParameteris eitherDeviceParameter.State.SUCCESSorDeviceParameter.State.DECRYPT_ERROR.- Parameters:
sensitive- Processor for sensitive information.callback- The callback to invoke when the items are refreshed.- Returns:
- Success when
true,falsewhen the client session is disposed of. Please note that if the client session is disposed before the items are retrieved, thecallbackwill not be invoked. Upon success, thecallbackwill 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): usesaveClientStorage(ISensitiveParameterHandler,DeviceParameter...).Saves parameters on the client device for the current app: the name ofsaveClientStorage(ISensitiveParameterHandler,DeviceParameter...)before IIZI version 5, which it calls.- Parameters:
sensitive- Processor for sensitive information.params- Parameters to save.- Returns:
truefor success of at least one parameter,falseotherwise.
getDeviceParameters
@Deprecated default boolean getDeviceParameters(ISensitiveParameterHandler sensitive, DeviceParameter... params) Deprecated.Since IIZI version 5 (CC-CLIENT-STORAGE-V5): usegetClientStorage(ISensitiveParameterHandler,DeviceParameter...).Retrieves parameters from the client device for the current app: the name ofgetClientStorage(ISensitiveParameterHandler,DeviceParameter...)before IIZI version 5, which it calls.- Parameters:
sensitive- Processor for sensitive information.params- The parameters to retrieve.- Returns:
truefor success,falseif 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): usegetAllClientStorage(ISensitiveParameterHandler,IDeviceParametersRefreshed).Refreshes all device parameters from the client device for the current app: the name ofgetAllClientStorage(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,falsewhen the client session is disposed of.
getAllClientStorage(ISensitiveParameterHandler,IDeviceParametersRefreshed).