Interface IAppSessionFocusProvider
A class can implement this interface and programmatically:
- refuse a session before it exists (session admission),
- refuse a user who signs in to the application (sign-in admission),
- set the initial VS focus,
- provide the UI focus to use for changes of focus in the VS.
The class instance lives for the entire application session for all application and client sessions.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptiondefault UICompfindFocusFromVS(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, IVirtualSpaceFocusEngine vsFocusEngine, VirtualSpace vsVirtual, IVSComponent vsComp, UIComp currentFocusedUIComp, boolean mustChangePanel) Finds the UI focus from VS.default IVSComponentgetInitialVSFocus(IAppSessionGyro appGyro, IClientSessionGyro clientGyro) Returns the initial focus to set in the application.default StringgetSignInRefusal(UserInfoBase user, String appID) Called before a user who signs in to the application is accepted: at every sign-in the server verifies for the application - a password, a second step, a passkey, a device that stays signed in, an external login - and before anything of that sign-in is recorded in a session (CC-SERVERADMIN-SIGNIN).default voidonDisposed(IAppSessionGyro appGyro) Called when the application session is disposed of.default voidonInitialized(IAppSessionGyro appGyro) Called when the application session is initialized.default voidonSessionAdmission(IAuthenticatedUser user, SessionUserIdentifier sessionUser, String appID) Called before an application session is created for a user the server has signed in (or admitted without a password, for an external login), and before any resource of the session exists.
Method Details
onSessionAdmission
default void onSessionAdmission(IAuthenticatedUser user, SessionUserIdentifier sessionUser, String appID) throws UserException Called before an application session is created for a user the server has signed in (or admitted without a password, for an external login), and before any resource of the session exists.Override to refuse users the application does not admit: throwing refuses the session, and the client receives the sign-in refusal of the exception's result the way it receives a wrong password - the caller learns nothing more, so the reason belongs in a WARNING logged by the implementation. The default admits everyone the server has signed in.
The instance is the application's, created when the application loads and shared by all its sessions, so this method may run for several sessions at once.
- Parameters:
user- The authenticated user, undefined when nobody has signed in.sessionUser- The session user identifier of the client.appID- The application ID.- Throws:
UserException- To refuse the session: the client receives the sign-in refusal ofUserException.getAuthenticationResult(), or the message.
getSignInRefusal
Called before a user who signs in to the application is accepted: at every sign-in the server verifies for the application - a password, a second step, a passkey, a device that stays signed in, an external login - and before anything of that sign-in is recorded in a session (CC-SERVERADMIN-SIGNIN). Since IIZI version 5 nobody is signed in when a session connects, soonSessionAdmission(IAuthenticatedUser, SessionUserIdentifier, String)sees no user: an application that admits only some users refuses the others here.Override to refuse users the application does not admit. A refused user is answered
SigninResult.APP_ACCESS_DENIED, as a user whom no group admits to the application is; the reason returned is logged by the server and never sent to the client. The default admits everyone.The instance is the application's, created when the application loads and shared by all its sessions, so this method may run for several sign-ins at once, on any thread.
- Parameters:
user- The user, as the server read it from its database.appID- The application ID.- Returns:
- null to admit the user, otherwise the reason of the refusal, for the log.
onInitialized
Called when the application session is initialized.Override to handle initializing. The default does nothing.
- Parameters:
appGyro- The Application Session Gyro instance.
onDisposed
Called when the application session is disposed of.- Parameters:
appGyro- The Application Session Gyro instance.Override to handle dispose. The default does nothing.
getInitialVSFocus
Returns the initial focus to set in the application. The component returned is not virtualized and is looked up from the application factory. Use the methodIAppSessionGyro.getRuntimePropFromReference(String)to look-up a VS component. Once retrieved, cast it to IVSComponent. The focus might be to the VirtualSpace itself.Override to set initial focus. The default returns null for default processing.
- Parameters:
appGyro- The Application Session Gyro instance.clientGyro- The Client Session Gyro instance who's UI focus is to be looked up.- Returns:
- The initial focus to set, or null for default.
findFocusFromVS
default UIComp findFocusFromVS(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, IVirtualSpaceFocusEngine vsFocusEngine, VirtualSpace vsVirtual, IVSComponent vsComp, UIComp currentFocusedUIComp, boolean mustChangePanel) Finds the UI focus from VS.Programming note: this method is SYNCHRONIZED on the lock object in case multiple calls to focus is done from threads.
Override to set process UI focus. The default returns null for default processing.
- Parameters:
appGyro- The Application Session Gyro instance.clientGyro- The Client Session Gyro instance who's UI focus is to be looked up.vsFocusEngine- The VS focus engine instance.vsVirtual- The current Virtualized VirtualSpace.vsComp- The currently focused Virtualized VS component.currentFocusedUIComp- Currently focused UI component, null for none.mustChangePanel- Flag indicating it's best to change panel, false means try not to do so.- Returns:
- UIComp component to focus, null for default processing. If the returned component is not virtualized, the panel will be virtualized.