Package com.iizix.gyro
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 Summary
Modifier and TypeMethodDescriptionvoid
assignAuthenticatedUser
(String userName, String hashPW) Changes the authenticated user to be used the next time the client is started.boolean
getAllDeviceParameters
(ISensitiveParameterHandler sensitive, IDeviceParametersRefreshed callback) Refreshes all device parameters from the client device for the current app.boolean
getDeviceParameters
(ISensitiveParameterHandler sensitive, DeviceParameter... params) Retrieves parameters from the client device for the current app.boolean
saveDeviceParameters
(ISensitiveParameterHandler sensitive, DeviceParameter... params) Saves parameters on the client device for the current app.void
sendStat
(String event, DeviceParameter... params) Sends statistics event to the analytics engine on the client to log the event.boolean
triggerRemoteCloseWindow
(boolean ignoreCallbackListener) Triggers closing of the window on the client that was opened with triggerRemoteOpenWindow.boolean
triggerRemoteOpenWindow
(String url, String target, WindowOptions options, IWindowCloseListener windowListener) Triggers opening of a browser window on the client.void
triggerUnlockCheck
(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
Changes the authenticated user to be used the next time the client is started.- Parameters:
userName
- The user name.hashPW
- The hashed password. It is based on PBKDF2 with Keyed-Hash Message Authentication Code (HMAC) with a SHA-256 hash. It can start with "EXTERNAL:
" if the user has signed in using an external Sign In Provider, e.g. LinkedIn or Facebook, the remaining part of the string identifies the provider and the users identifier for that provider.
sendStat
Sends statistics event to the analytics engine on the client to log the event.- Parameters:
event
- The event name.params
- Parameters to send, null values and sensitive parameters are ignored.
saveDeviceParameters
Saves parameters on the client device for the current app.Sensitive parameters 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 parameter is virtually undecipherable on the client side.
- Parameters:
sensitive
- Processor for sensitive information.params
- Parameters to save. ADeviceParameter
value ofnull
means that the device parameter and its value is removed from storage. Upon return of this method, eachDeviceParameter
ofparams
is updated with a new state. Possible states areDeviceParameter.State.SUCCESS
,DeviceParameter.State.UNAVAILABLE
,DeviceParameter.State.NOT_FOUND
orDeviceParameter.State.ENCRYPT_ERROR
.- Returns:
true
for success of at least one device parameter,false
for failure (or no parameters to save). In case of functional failure (i.e. not if a device parameter is not found), an error is logged in the server.
getDeviceParameters
Retrieves parameters from the client device for the current app. The variables values and state are filled in before the return of this method call. The state indicates success, some error or if the parameter is not found. The state for eachDeviceParameter
is eitherDeviceParameter.State.SUCCESS
,DeviceParameter.State.NOT_FOUND
,DeviceParameter.State.UNAVAILABLE
orDeviceParameter.State.DECRYPT_ERROR
.- Parameters:
sensitive
- Processor for sensitive information.params
- The parameters to retrieve.- Returns:
true
for success,false
if device parameters are not present. The return code istrue
if at least one device parameter was successfully retrieved. Iffalse
is returned and theDevParams
instance is not found inEnvProps
for the client, an error is logged in the server.
getAllDeviceParameters
boolean getAllDeviceParameters(ISensitiveParameterHandler sensitive, IDeviceParametersRefreshed callback) Refreshes all device parameters from the client device for the current app. The state for eachDeviceParameter
is eitherDeviceParameter.State.SUCCESS
orDeviceParameter.State.DECRYPT_ERROR
.- 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. Please note that if the client session is disposed before the device parameters are retrieved, thecallback
will not be invoked. Upon success, thecallback
will be invoked at a later stage in the client session thread.