Class AppSessionGyro
- All Implemented Interfaces:
- IPrivateStorage,- IAppSessionGyro,- IFocusEngineProvider,- IMessageBox,- IRuntimeImageCache,- IToaster,- IRuntimeReferenceLookup,- IVirtualizedReferenceLookup,- IGyroFocusEngineOwner,- ILocaleString
- Author:
- Christopher Mindus
- Nested Class Summary- Nested classes/interfaces inherited from interface com.iizix.gyro.IMessageBox- IMessageBox.Icon- Nested classes/interfaces inherited from interface com.iizix.gyro.IToaster- IToaster.Direction, IToaster.Position, IToaster.Type
- Field Summary- Fields inherited from interface com.iizix.gyro.IAppSessionGyro- STORAGE_NAME- Fields inherited from interface com.iizix.gyro.IMessageBox- ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNING- Fields inherited from interface com.iizix.gyro.IToaster- TOASTER_DEFAULT_DURATION, TOASTER_MAX_DURATION, TOASTER_MIN_DURATION
- Constructor SummaryConstructorsConstructorDescription- AppSessionGyro- (ServerShell server, SessionInfo appSessionInfo, UserSessions userSessions, ClientParams clientParams, AuthenticatedUser authUser) Constructs the instance of the application for the first user session.
- Method SummaryModifier and TypeMethodDescription- booleanAdds a client connection listener for the application session.- boolean- addDisposeListener- (IAppSessionDisposeListener listener) Adds a dispose listener for the application session.Changes the authenticated user due an external authentication mechanism such as LinkedIn.- voidClears the entire cache.- voidCloses the remote windows for authentication.- createClientSessionGyro- (ClientEndPoint clientEndPoint, Worker worker, EnvProps envProps) Called to create the ClientSessionGyro for the first client session or for parallel client sessions.- intDecreases the incremental lock state.- boolean- dispose()Disposes of the Application session gyro, and effectively closes all the client sessions and end point connections.Gets the application factory.Returns the application session history used for backward and forward navigation.- getAppID()Gets the application ID.Retrieves the KStringInfoProvider for the application session.Gets the application timer engine.Gets the application root for static references look-up.Get the web server file provider for the application session.Gets the application session info.Gets the AppSessionGyro's Thread Group.Gets the Worker for the Application.Gets the authenticated user information.Gets the user ID for background location service identification.Gets the active client session Gyro's for this application session Gyro.- intGets the count of client sessions.- longGets the creation time in milliseconds.Returns the current focus in the VirtualSpace.- getCustomAppValue- (String key) Gets a value for a key in the custom app properties.Gets the original environment properties for Selector's or Value's.- getFocusEngine- (IFocusComp comp) Returns the focus engine instance for the specified component.Gets an image definition from the image container for the client session.Retrieves the KStringInfoProvider for the application session.Gets the language code of the application session.Gets the local info class instance.- getLocaleKString- (String id, boolean system) Gets the KString of a particular ID from the app's text tables that are flagged to also handle LocaleString's depending on the flag.Returns the location service for the application session.- intReturns the incremental lock count that governs the UI locking state.Gets the locale'd texts instance for the sessions language and text tables.Gets the concurrent hash map used to store the private data.- getRootFromName- (GProp<?> requestor, String module) Gets the module root for a name.- GProp- <?> - getRuntimePropFromReference- (String reference) Gets a reference for runtime use to get the reference of an item.- GProp- <?> - getRuntimePropFromReference- (String reference, boolean fallBackToNonVirtualized) Gets a reference for runtime use to get the reference of an item.Gets the server of this session.Gets the selected Server configuration environment for the Application Session.- static AppSessionGyroGets the AppSessionGyro instance for the current thread in an application session.- static AppSessionGyro- getSessionInstance- (SessionInfo sessionInfo) Gets the AppSessionGyro instance for the current thread in a client session.Gets the SessionUserIdentifier.Gets the transaction coordinator of the session.Gets the user authentication UI interface used for the initial login.- GProp- <?> - getVirtualizedPropFromReference- (String reference) Attempts to look up a virtualized property from a reference to the VirtualSpace only.- getVirtualizedVirtualSpace- (VirtualSpace virtualSpace, boolean doVirtualize) Gets the virtualized counterpart of a VirtualSpace.- getVirtualizedVSComponent- (IVSComponent component) Gets the virtualized VSComponent counterpart from a non-virtualized VSComponent.- <VSC extends VSComponent>
 VSC- getVirtualizedVSComponent- (VSC component) Gets the virtualized VSComponent counterpart from a non-virtualized VSComponent.- <T extends PropCnr>
 VirtualsContainer- <T> - getVirtuals- (IPluginDescriptor<T> serverPluginDescriptor) Gets the instance of the VirtualsContainer for the plug-in.The VirtualsContainer instance for VirtualSpace.- intIncreases the incremental lock state.- boolean- initialize- (EnvProps envProps, ClientSessionGyro clientGyro) Initiates the application for the client session.- booleanChecks if the application session Gyro is disposed of.- booleanGet the current UI lock state.- boolean- isVirtualized- (VirtualSpace virtualSpace) Returns if a VirtualSpace already is virtualized for the application.- booleanLocks the UI with a message and a delay.- boolean- lockUI- (KString waitMsg, ProgressIndicatorDelay delay) Locks the UI with a message and a delay.- void- messageBox- (IMessageBoxReply reply, IMessageBox.Icon icon, KString title, KString message, KString... buttons) Displays a message box with the specified title and message.- void- onFocusChanged- (IFocusComp newComp, IFocusComp oldComp, IGProp<?> trigger, boolean isRemoteInduced, boolean isInternal) Called when focus changes.- void- onFocusVetoChange- (FocusEvent event) Called to perform veto.- booleanRemoves a client connection listener for the application session.- booleanRemoves a dispose listener for the application session.- boolean- removeImage- (String name) Removes an image with a name from the client session.- requestOAuthCallbackDisplay- (IOAuthService service) Requests the OAuth (1.0a or 2.0) authentication callback provider to show an URL to the user in order to be accepted.Requests a UI lock state.- boolean- setImage- (RuntimeImageDefinition image) Adds the image definition to the image container for the client session.- setLocale- (LocaleInfo locale) Changes or sets the LocaleInfo for the environment.- boolean- setLockMessage- (KString msg) Sets the message to display for the lock state, above the indicator.- boolean- setLockMessage- (KString msg, int progress) Sets the message to display for the lock state, above the indicator, along with a progress value.- boolean- setLockMessage- (KString msg, int delay, int progress) Sets the message to display for the lock state, above the indicator, along with a progress value.- boolean- setLockProgress- (int progress) Sets the current progress bar value.Sets the focus to the specified VS component, regardless if the VS component is virtualized or not.- setVirtualizeSupportFocus- (IVSComponent vsComp, IGProp<?> trigger) Sets the focus to the specified VS component, regardless if the VS component is virtualized or not.- void- toast- (KString message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type, int duration) Displays a simple, unobstructive and ephemeral text message to the user.- toString()Formats the instance to a String.- boolean- unlockUI()Unlocks the UI.- Methods inherited from class java.lang.Object- clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait- Methods inherited from interface com.iizix.gyro.IAppSessionGyro- post- Methods inherited from interface com.iizix.text.ILocaleString- getLocaleKString- Methods inherited from interface com.iizix.gyro.IMessageBox- messageBox, messageBox, messageBox- Methods inherited from interface com.iizix.api.IPrivateStorage- getPrivateData, getPrivateData, setPrivateData
- Constructor Details- AppSessionGyropublic AppSessionGyro- (ServerShell server, SessionInfo appSessionInfo, UserSessions userSessions, ClientParams clientParams, AuthenticatedUser authUser) throws UserException Constructs the instance of the application for the first user session. Subsequent parallel user sessions do not construct this instance.- Parameters:
- server- The Server.
- appSessionInfo- The application session information.
- userSessions- The user sessions.
- clientParams- The client parameters.
- authUser- The authenticated user information.
- Throws:
- UserException- If the user is not allowed access.
 
 
- Method Details- getSessionInstanceGets the AppSessionGyro instance for the current thread in an application session.- Returns:
- The AppSessionGyro instance when called from a thread of the client session, nullotherwise.
 
- getSessionInstanceGets the AppSessionGyro instance for the current thread in a client session.- Parameters:
- sessionInfo- A session information instance, or null for none.
- Returns:
- The AppSessionGyro instance when called from a thread of the application session, nullotherwise.
 
- addDisposeListenerAdds a dispose listener for the application session. Calling this method multiple times with the same listener will have no effect (but to return false).- Specified by:
- addDisposeListenerin interface- IAppSessionGyro
- Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeDisposeListenerRemoves a dispose listener for the application session.- Specified by:
- removeDisposeListenerin interface- IAppSessionGyro
- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.
 
- addClientConnectionListenerAdds a client connection listener for the application session. Calling this method multiple times with the same listener will have no effect (but to return false).- Specified by:
- addClientConnectionListenerin interface- IAppSessionGyro
- Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeClientConnectionListenerRemoves a client connection listener for the application session.- Specified by:
- removeClientConnectionListenerin interface- IAppSessionGyro
- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.
 
- disposepublic boolean dispose()Disposes of the Application session gyro, and effectively closes all the client sessions and end point connections.- Specified by:
- disposein interface- IAppSessionGyro
- Returns:
- true for dispose success, false if already disposed of.
 
- isDisposedpublic boolean isDisposed()Checks if the application session Gyro is disposed of.- Specified by:
- isDisposedin interface- IAppSessionGyro
- Returns:
- true if the user's app-session is disposed of along with all client sessions, false otherwise.
 
- getVirtualspublic <T extends PropCnr> VirtualsContainer<T> getVirtuals- (IPluginDescriptor<T> serverPluginDescriptor) Gets the instance of the VirtualsContainer for the plug-in. The instance is allocated if not yet created. This instance will be disposed of when the application session is disposed of.- Parameters:
- serverPluginDescriptor- The server plug-in descriptor.
- Returns:
- The instance of the virtuals container, or null if appGyro is disposed of.
- Throws:
- NullPointerException- If the plug-ins server ID is null from- IPluginDescriptor.getServerID().
 
- getServerGets the server of this session.
- getAppSessionInfoGets the application session info.- Specified by:
- getAppSessionInfoin interface- IAppSessionGyro
- Returns:
- The original session information that initiated the application session.
 
- getAppThreadGroupGets the AppSessionGyro's Thread Group.- Specified by:
- getAppThreadGroupin interface- IAppSessionGyro
- Returns:
- The Virtual Thread Group.
 
- getEnvironmentGets the original environment properties for Selector's or Value's.- This is NOT the same instance as the one available from the - ClientSessionGyro.getEnvironment().- Specified by:
- getEnvironmentin interface- IAppSessionGyro
- Specified by:
- getEnvironmentin interface- IRuntimeReferenceLookup
- Returns:
- The original environment properties for selectors, null if never initialized.
 
- getServerConfigurationEnvironmentGets the selected Server configuration environment for the Application Session.- Returns:
- The Server configuration environment to use for the sessions, null for none.
 
- getFocusEngineReturns the focus engine instance for the specified component.- Specified by:
- getFocusEnginein interface- IAppSessionGyro
- Specified by:
- getFocusEnginein interface- IFocusEngineProvider
- Parameters:
- comp- The component requesting the focus engine. For the AppSessionGyro, the focus engine returns an instance of the VirtualSpace focus engine if the component instance is a IVSComponent (VSTable, VSField, etc) or a VirtualSpace, for now.
- Returns:
- The focus engine instance, or null if not found.
 
- getCreationTimepublic long getCreationTime()Gets the creation time in milliseconds.- Specified by:
- getCreationTimein interface- IAppSessionGyro
- Returns:
- Milliseconds since the epoch.
 
- getAppIDGets the application ID.- Specified by:
- getAppIDin interface- IAppSessionGyro
- Returns:
- The AppID is an upper case string.
 
- getAppFactoryGets the application factory.- Specified by:
- getAppFactoryin interface- IRuntimeReferenceLookup
- Returns:
- The AppFactory.
 
- getCustomAppValueGets a value for a key in the custom app properties.- Specified by:
- getCustomAppValuein interface- IAppSessionGyro
- Parameters:
- key- The key or name of the property to retrieve.
- Returns:
- The value, or null if no value is defined for the key, or the custom map is not defined.
 
- getTransactionCoordinatorGets the transaction coordinator of the session.- Specified by:
- getTransactionCoordinatorin interface- IAppSessionGyro
- Returns:
- The TXP coordinator, or null for none.
 
- getVirtualSpaceVirtualsContainerThe VirtualsContainer instance for VirtualSpace. This instance is shared for all parallel client sessions (if this is enabled or allowed).
- getSessionUserIdentifierGets the SessionUserIdentifier.- Specified by:
- getSessionUserIdentifierin interface- IAppSessionGyro
- Returns:
- The user identifier of the session.
 
- getAuthenticatedUserGets the authenticated user information.- Specified by:
- getAuthenticatedUserin interface- IAppSessionGyro
- Returns:
- The authenticated user instance, or nullfor none.
 
- changeExternallyAuthenticatedUserChanges the authenticated user due an external authentication mechanism such as LinkedIn.- Parameters:
- authUser- The new authenticated user.
- Returns:
- The authentication result, perhaps error "user is disabled".
- Throws:
- NullPointerException- If the client gyro or authUser parameter is null.
 
- getAppPropCnrGets the application root for static references look-up.
- getVirtualizedPropFromReferenceAttempts to look up a virtualized property from a reference to the VirtualSpace only.- Specified by:
- getVirtualizedPropFromReferencein interface- IVirtualizedReferenceLookup
- Parameters:
- reference- The reference to look-up.
- Returns:
- The virtualized instance of the property, null if not found.
 
- getRuntimePropFromReferenceGets a reference for runtime use to get the reference of an item. The reference must be fully qualified such as "*ALIAS:/type/path" or "MODULE:/type/path" and cannot be relative.- Note: The reference can be to the static or virtualized properties, but if a property type is virtualized and the property is not found, a fall-back to search the application for the static non-virtualized property IS NOT PERFORMED. - Calling this method is the same as calling - getRuntimePropFromReference(reference, false)}.- Specified by:
- getRuntimePropFromReferencein interface- IAppSessionGyro
- Specified by:
- getRuntimePropFromReferencein interface- IRuntimeReferenceLookup
- Parameters:
- reference- The reference to look-up.
- Returns:
- The property found, or null for reference not found.
 
- getRuntimePropFromReferenceGets a reference for runtime use to get the reference of an item. The reference must be fully qualified such as "*ALIAS:/type/path" or "MODULE:/type/path" and cannot be relative.- If the flag - fallBackToNonVirtualizedis false, the search will not fallback to searching for the non-virtualized property in the runtime app. The result will only returned virtualized properties, i.e. for a reference as e.g. "module:/vs/someVS", and depending on where this method is called (the client session), also includes other virtualized properties such as panels as e.g. "module:/panel/somePanel".- To always fallback to also searching the runtime app, specify - fallBackToNonVirtualizedto true.- Specified by:
- getRuntimePropFromReferencein interface- IAppSessionGyro
- Specified by:
- getRuntimePropFromReferencein interface- IRuntimeReferenceLookup
- Parameters:
- reference- The reference to look-up.
- fallBackToNonVirtualized- Flag indicating a fallback to non-virtualized properties.
- Returns:
- The property found, or null for reference not found.
 
- getRootFromNameGets the module root for a name. In the Editor, the module is the project, and that root container is returned. In the Server, the module doesn't matter, so the real root returns itself.- When running with assertions, this call throws an assertion error by default, showing that the call is directed to a non-root property container. - Specified by:
- getRootFromNamein interface- IAppSessionGyro
- Specified by:
- getRootFromNamein interface- IRuntimeReferenceLookup
- Parameters:
- requestor- The requestor property.
- module- The module name (without colon), i.e. the project name in the Designer.
- Returns:
- The root property container, or null if this container is not the root, or if the module name is not found. The default implementation returns null.
 
- createClientSessionGyropublic ClientSessionGyro createClientSessionGyro- (ClientEndPoint clientEndPoint, Worker worker, EnvProps envProps) Called to create the ClientSessionGyro for the first client session or for parallel client sessions.- Parameters:
- clientEndPoint- The client end point.
- worker- The worker.
- Returns:
- The client session gyro
 
- getClientSessionGyrosGets the active client session Gyro's for this application session Gyro.- Specified by:
- getClientSessionGyrosin interface- IAppSessionGyro
- Returns:
- The array of active client session Gyro's.
 
- getClientSessionsCountpublic int getClientSessionsCount()Gets the count of client sessions.- Specified by:
- getClientSessionsCountin interface- IAppSessionGyro
 
- toStringFormats the instance to a String.
- initializeInitiates the application for the client session. This is done only once for the same user and will remain in that state, e.g. languages, etc.- Parameters:
- envProps- The client environment properties.
- clientGyro- The client session gyro used to place an additional session according to the current VirtualSpace.
- Returns:
- true for success, false if configuration is unsupported.
 
- isVirtualizedReturns if a VirtualSpace already is virtualized for the application.- Specified by:
- isVirtualizedin interface- IAppSessionGyro
- Parameters:
- virtualSpace- The VirtualSpace.
- Returns:
- true if vsalready is virtualized or a virtualized instance is present, false otherwise.
 
- getVirtualizedVirtualSpaceGets the virtualized counterpart of a VirtualSpace. If the VirtualSpace is not virtualized, it will be done. If the VirtualSpace parameter already is a virtualized VirtualSpace, that instance is returned.- This method is typically used by data connectors as action actors that have another target VirtualSpace. Focus can be set to a component in another VirtualSpace once virtualized. - Specified by:
- getVirtualizedVirtualSpacein interface- IAppSessionGyro
- Parameters:
- virtualSpace- The VirtualSpace.
- doVirtualize- Flag to virtualize the VirtualSpace if not already virtualized or not.
- Returns:
- A virtualized VirtualSpace for the virtualSpace parameter, or the virtualSpace parameter instance if it was virtualized.
 
- getVirtualizedVSComponentGets the virtualized VSComponent counterpart from a non-virtualized VSComponent. If the component's VirtualSpace is not virtualized, it will be done. If the component parameter already is virtualized, that instance is returned. This method can also process a VirtualSpace instance as it is implementing the IVSComponent interface.- Specified by:
- getVirtualizedVSComponentin interface- IAppSessionGyro
- Parameters:
- component- A VS component.
- Returns:
- A virtualized component for the component parameter, or the component parameter instance if it was virtualized. nullis returned if the VirtualSpace is virtualized and the VSComponent counterpart doesn't exist or the class instance is not the same as the original component, or if thecomponentparameter isnull.
 
- getVirtualizedVSComponentGets the virtualized VSComponent counterpart from a non-virtualized VSComponent. If the component's VirtualSpace is not virtualized, it will be done. If the component parameter already is virtualized, that instance is returned.- Specified by:
- getVirtualizedVSComponentin interface- IAppSessionGyro
- Parameters:
- component- A VS component.
- Returns:
- A virtualized component for the component parameter, or the component parameter instance if it was virtualized. nullis returned if the VirtualSpace is virtualized and the VSComponent counterpart doesn't exist or the class instance is not the same as the original component, or if thecomponentparameter isnull.
 
- onFocusVetoChangeCalled to perform veto.- Specified by:
- onFocusVetoChangein interface- IGyroFocusEngineOwner
- Parameters:
- event- The focus event, InternalFocusEvent perhaps.
- Throws:
- FocusVetoException- When the focus is veto'ed.
 
- onFocusChangedpublic void onFocusChanged- (IFocusComp newComp, IFocusComp oldComp, IGProp<?> trigger, boolean isRemoteInduced, boolean isInternal) Called when focus changes.- Specified by:
- onFocusChangedin interface- IGyroFocusEngineOwner
- Parameters:
- newComp- New focus component.
- oldComp- Old focus component.
- trigger- The trigger property, null for none.
- isRemoteInduced- If the event is remote induced.
- isInternal- The internal flag as specified in the- setFocusmethod to the focus engine.
 
- getCurrentFocusReturns the current focus in the VirtualSpace. If no particular component is in focus, the VirtualSpace that last had focus is returned.- Specified by:
- getCurrentFocusin interface- IAppSessionGyro
- Returns:
- The component in focus, or null if no focus is currently set.
 
- setVirtualizeSupportFocusSets the focus to the specified VS component, regardless if the VS component is virtualized or not. If not virtualized, it will be prior to setting the focus.- Specified by:
- setVirtualizeSupportFocusin interface- IAppSessionGyro
- Parameters:
- vsComp- The VS component to focus.
- Returns:
- Error message, or null for success.
 
- setVirtualizeSupportFocusSets the focus to the specified VS component, regardless if the VS component is virtualized or not. If not virtualized, it will be prior to setting the focus.- Specified by:
- setVirtualizeSupportFocusin interface- IAppSessionGyro
- Parameters:
- vsComp- The VS component to focus.
- trigger- The trigger component, null for none.
- Returns:
- Error message, or null for success.
 
- getApplicationTimerEngineGets the application timer engine. All timer tasks as disposed of automatically when the application session exits.- Specified by:
- getApplicationTimerEnginein interface- IAppSessionGyro
- Returns:
- The application session implementation of the timeout engine.
 
- getAppWorkerGets the Worker for the Application.- Specified by:
- getAppWorkerin interface- IAppSessionGyro
- Returns:
- The Application Worker.
 
- getPrivateStorageMapGets the concurrent hash map used to store the private data.- Specified by:
- getPrivateStorageMapin interface- IPrivateStorage
- Returns:
- The private storage map.
 
- requestUILockRequests a UI lock state. The object returned can be used to set a message below the lock spinner. It can also be used to set a progress indicator, also below the spinner. A progress indicator can also be handled using the lock object.- Note: You MUST call the objects - {link @ILockState#release()}method to release the lock state.- Specified by:
- requestUILockin interface- IAppSessionGyro
- Returns:
- The lock state object.
 
- isUILockedpublic boolean isUILocked()Get the current UI lock state.- You may also query the incremental lock state using - getLockCount()- Specified by:
- isUILockedin interface- IAppSessionGyro
- Returns:
- true if busy state is on, false otherwise.
 
- lockUILocks the UI with a message and a delay.- Consider using the method - requestUILock()- This call will not change the potential wait message or wait message delay if the method is not successful. - Also consider using the method - decrementUILock()- Specified by:
- lockUIin interface- IAppSessionGyro
- Parameters:
- waitMsg- The wait message, null for none.
- delay- Delay before the message is shown in the Client.
- Returns:
- Busy change flag, true if busy state changed, false otherwise. The return value may be false because the lock count is non-zero.
 
- lockUILocks the UI with a message and a delay.- Consider using the method - requestUILock()- This call will not change the potential wait message or wait message delay if the method is not successful. - Also consider using the method - decrementUILock()- Specified by:
- lockUIin interface- IAppSessionGyro
- Parameters:
- waitMsg- The wait message, null for none.
- delay- Delay of lock spinner: -2 for default (1.5 second), -1 disabled, 0=no delay, >0 wait time in milliseconds (1-20_000, i.e. 20 seconds).
- Returns:
- Busy change flag, true if busy state changed, false otherwise. The return value may be false because the lock count is non-zero.
- Throws:
- IllegalArgumentException- If the- delayvalue is not -1 to 20_000 milliseconds (20 seconds).
 
- unlockUIpublic boolean unlockUI()Unlocks the UI.- Consider using the method - requestUILock()- This call will not change the potential wait message or wait message delay if the method is not successful. - Also consider using the method - decrementUILock()- Specified by:
- unlockUIin interface- IAppSessionGyro
- Returns:
- Busy change flag, true if busy state changed, false otherwise. The return value may be false because the lock count is non-zero.
 
- getLockCountpublic int getLockCount()Returns the incremental lock count that governs the UI locking state. Note that the lock state may be in effect even if the lock count is zero.- Specified by:
- getLockCountin interface- IAppSessionGyro
- Returns:
- The lock count, zero or positive value.
 
- incrementUILockpublic int incrementUILock()Increases the incremental lock state. If it was zero, it will UI lock the session. Each call to this method must match a call to- decrementUILock()- Consider using the method - requestUILock()- Specified by:
- incrementUILockin interface- IAppSessionGyro
- Returns:
- The lock count, i.e. the number of calls that has been made to this method minus the number of calls to decrementUILock()
 
- decrementUILockpublic int decrementUILock()Decreases the incremental lock state. If it becomes zero, it will UI unlock the session. Each call to this method must match a call to- incrementUILock()- If this method is called and the lock count is zero, nothing will happen, but a warning event with a call stack will be logged. - Specified by:
- decrementUILockin interface- IAppSessionGyro
- Returns:
- The lock count, i.e. the number of calls that has been made to incrementUILock()
 
- setLockMessageSets the message to display for the lock state, above the indicator.- Specified by:
- setLockMessagein interface- IAppSessionGyro
- Parameters:
- msg- The message to display, or null to remove it.
- Returns:
- true for changed, or false if busy state is not present or no change of message.
 
- setLockMessageSets the message to display for the lock state, above the indicator, along with a progress value.- Specified by:
- setLockMessagein interface- IAppSessionGyro
- Parameters:
- msg- The message to display, or null to remove it.
- progress- The progress value between 0 and 100, or -1 to remove it.
- Returns:
- true for changed, or false if busy state is not present or no change of values.
- Throws:
- IllegalArgumentException- If the progress value is not -1 or 0 to 100.
 
- setLockMessageSets the message to display for the lock state, above the indicator, along with a progress value.- Specified by:
- setLockMessagein interface- IAppSessionGyro
- Parameters:
- msg- The message to display, or null to remove it.
- delay- Delay of lock spinner: -2 for default (1.5 second), -1 disabled, 0=no delay, >0 wait time in milliseconds (1-20000, i.e. 20 seconds).
- progress- The progress value between 0 and 100, or -1 to remove it.
- Returns:
- true for changed, or false if busy state is not present or no change of values.
- Throws:
- IllegalArgumentException- If progress value is not -1 or 0 to 100, or delay is smaller than -2 or larger than 20_000.
 
- setLockProgresspublic boolean setLockProgress- (int progress) Sets the current progress bar value. This method will not do anything if the lock state is not present.- Specified by:
- setLockProgressin interface- IAppSessionGyro
- Parameters:
- progress- The progress value between 0 and 100, or -1 to remove it.
- Returns:
- true for changes, false for no change or no lock state.
- Throws:
- IllegalArgumentException- If the progress value is not -1 or 0 to 100.
 
- getAppHistoryReturns the application session history used for backward and forward navigation.- Specified by:
- getAppHistoryin interface- IAppSessionGyro
- Returns:
- The application session history instance.
 
- getLanguageCodeGets the language code of the application session. This language may very well not be the one requested by the end user device, but rather one of the languages the application supports.- Specified by:
- getLanguageCodein interface- IAppSessionGyro
- Returns:
- The language code.
 
- getAppKStringInfoProviderRetrieves the KStringInfoProvider for the application session.- Note: it is recommended to use the - IClientSessionGyro.getKStringInfoProvider()- Specified by:
- getAppKStringInfoProviderin interface- IAppSessionGyro
- Returns:
- The KString information provider instance, or null if not possible.
 
- getKStringInfoProviderRetrieves the KStringInfoProvider for the application session.- Note: it is recommended to use the - IClientSessionGyro.getKStringInfoProvider()- Specified by:
- getKStringInfoProviderin interface- IAppSessionGyro
- Specified by:
- getKStringInfoProviderin interface- ILocaleString
- Returns:
- The KString information provider instance, or null if not possible. This method returns the same value as getAppKStringInfoProvider().
 
- getLocaleGets the local info class instance.- Specified by:
- getLocalein interface- ILocaleString
- Returns:
- The locale info class instance when the client environment has been set, otherwise the default client locale info instance specified for the server.
 
- setLocaleChanges or sets the LocaleInfo for the environment.- Specified by:
- setLocalein interface- IAppSessionGyro
- Parameters:
- locale- localeInfo The locale information to use.
- Returns:
- The old LocaleInfo, or null if not set.
 
- getLocaleKStringGets the KString of a particular ID from the app's text tables that are flagged to also handle LocaleString's depending on the flag.- Specified by:
- getLocaleKStringin interface- ILocaleString
- Parameters:
- id- The text ID.
- system- Flagged to handle system strings for LocaleString's.
- Returns:
- The KString for the text ID in current locale, null if not found.
 
- getPrettyLocaledTextsGets the locale'd texts instance for the sessions language and text tables.- Specified by:
- getPrettyLocaledTextsin interface- IAppSessionGyro
- Returns:
- The instance used to create locale'd strings for e.g. duration and distances.
 
- getAppSessionFileProviderGet the web server file provider for the application session.- Returns:
- The web server file provider.
- Throws:
- IOException- If the directory for the application session files failed to be created.
- IllegalStateException- If the application session is disposed of.
 
- requestOAuthCallbackDisplayRequests the OAuth (1.0a or 2.0) authentication callback provider to show an URL to the user in order to be accepted.- Returns:
- The authentication callback.
 
- closeAuthenticationWindowspublic void closeAuthenticationWindows()Closes the remote windows for authentication.
- getImageGets an image definition from the image container for the client session.- Specified by:
- getImagein interface- IRuntimeImageCache
- Parameters:
- name- The image name.
- Returns:
- The predefined image definition, or null if not found.
 
- setImageAdds the image definition to the image container for the client session. If the image already exists, it is replaced with the new definition.- Specified by:
- setImagein interface- IRuntimeImageCache
- Parameters:
- image- The image definition.
- Returns:
- true if the container was changed, i.e. image was added or replaced, false for no change.
 
- removeImageRemoves an image with a name from the client session.- Specified by:
- removeImagein interface- IRuntimeImageCache
- Parameters:
- name- The image to remove.
- Returns:
- true for removed, false if not found.
 
- clearImageCachepublic void clearImageCache()Clears the entire cache.- Specified by:
- clearImageCachein interface- IRuntimeImageCache
 
- messageBoxpublic void messageBox- (IMessageBoxReply reply, IMessageBox.Icon icon, KString title, KString message, KString... buttons) Displays a message box with the specified title and message.- The callback is done in the application worker thread. - Specified by:
- messageBoxin interface- IMessageBox
- Parameters:
- reply- The reply callback that is called when the user chooses a button or session is closed,- nullfor none.
- icon- Icon to display, see the- {link Icon}enumeration.
- title- The title string, must be non-null.
- message- The message to display, must be non-null.
- buttons- The strings for the buttons to display, if none, just an- OKbutton is displayed. This array of buttons defined the index value returned by this method.
- Throws:
- NullPointerException- If- iconor- messageis null, or if any of the elements in- buttonsarray is null.
- IllegalStateException- If the application session is disposed of.
 
- toastpublic void toast- (KString message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type, int duration) Displays a simple, unobstructive and ephemeral text message to the user.- Specified by:
- toastin interface- IToaster
- Parameters:
- message- The message to display.
- position- Position of toast, default value is Position.BOTTOM_CENTER if null.
- direction- Direction of the toast animation, default Direction.UP if null.
- type- Type of message style: message, warning, error of fatal, default is message if null
- duration- Duration of the toast message being shown in ms. Valid values are in the interval [0, 10000], 0 for a sticky toast.
 
- getLocationServiceReturns the location service for the application session.- Specified by:
- getLocationServicein interface- IAppSessionGyro
- Returns:
- The "application singleton" instance of the location service.
 
- getAuthenticatedUserUUIDGets the user ID for background location service identification.- Specified by:
- getAuthenticatedUserUUIDin interface- IAppSessionGyro
- Returns:
- String made up of the authenticated user's UUID, null if the user is not yet authenticated or undefined.
 
- getUserAuthenticationUIGets the user authentication UI interface used for the initial login.- Specified by:
- getUserAuthenticationUIin interface- IAppSessionGyro
- Returns:
- The user authentication interface.