Package de.elo.ix.client
Class IXAuthenticationWrapper
java.lang.Object
de.elo.ix.client.IXAuthenticationWrapper
- All Implemented Interfaces:
byps.BAuthentication
,IXAuthenticationIF
- Direct Known Subclasses:
IXAuthenticationNormalized
This class encapsulates an
IXAuthenticationIF
object to intercept authentication
functions.-
Field Summary
Fields inherited from interface de.elo.ix.client.IXAuthenticationIF
LOGIN_FOR_PUBLIC_ENCR_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(IXAuthenticationListener listener) Add a listener that is called on re-login.void
authenticate
(byps.BClient client1, byps.BAsyncResult<Boolean> asyncResult) Authenticate the current user.encryptPassword
(String pwd) Encrypt the given text before sending over the wire.void
Store provided SessionOptions object in current session options.Type of this authentication object.Get database engine name.Reserved.protected abstract IXAuthenticationIF
Return the encapsulated authentication object.LoginResult
received from Indexserver as the result of authentication.void
getSession
(byps.BClient client, int typeId, byps.BAsyncResult<Object> asyncResult) Return the object representing the current session.Return session options.boolean
Check whether the current sessionClientInfo.ticket
is expired.boolean
isReloginException
(byps.BClient client, Throwable e, int typeId) Return true, if the given exception has to trigger authentication.Build SessionOptions object from current session options.boolean
Check whether the current sessionClientInfo.ticket
needs to be renewed.void
removeListener
(IXAuthenticationListener listener) Remove a listener that was previously set byIXAuthenticationIF.addListener(IXAuthenticationListener)
.void
setLoginResult
(LoginResult loginResult) Called after authentication to pass theLoginResult
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.elo.ix.client.IXAuthenticationIF
getClientInfo, getInstanceName, getServerTime, getVersion
-
Constructor Details
-
IXAuthenticationWrapper
public IXAuthenticationWrapper()
-
-
Method Details
-
getInnerAuthentication
Return the encapsulated authentication object.- Returns:
- Authentication object
-
getLoginResult
LoginResult
received from Indexserver as the result of authentication.- Specified by:
getLoginResult
in interfaceIXAuthenticationIF
- Returns:
- LoginResult
-
authenticate
Authenticate the current user.- Specified by:
authenticate
in interfacebyps.BAuthentication
- Parameters:
client1
- BClient objectasyncResult
- Result object, only the exception is evaluated.
-
isReloginException
Return true, if the given exception has to trigger authentication.- Specified by:
isReloginException
in interfacebyps.BAuthentication
- Parameters:
client
- BClient objecte
- Exception returned from the last request.typeId
- Type ID (serialVersionUID) of the last request class. For each API function, the generator has created a request class named BRequest_functionname. The passed type ID is the serialVersionUID of this class.- Returns:
- true triggers authentication, false forwards the exception to the caller.
-
getSession
Return the object representing the current session. This object will be passed to every request class (e.g. BRequest_functionname) for remote interfaces tagged with @BSessionParamType. If the function throws an exception, the isReloginException and maybe the authentication functions are called before the current method request is sent.- Specified by:
getSession
in interfacebyps.BAuthentication
- Parameters:
client
- BClient objecttypeId
- Type ID (serialVersionUID) of the last request class, seeBAuthentication.isReloginException(BClient, Throwable, int)
.asyncResult
- This object receives the session object or an exception.- See Also:
-
BMethodRequest.setSession(Object)
-
makeSessOptsObj
Build SessionOptions object from current session options.- Specified by:
makeSessOptsObj
in interfaceIXAuthenticationIF
- Returns:
- SessionOptions
-
fromSessOptsObj
Store provided SessionOptions object in current session options. This function does not send the options to IX.- Specified by:
fromSessOptsObj
in interfaceIXAuthenticationIF
- Parameters:
opts
- SessionOptions object.
-
addListener
Add a listener that is called on re-login.- Specified by:
addListener
in interfaceIXAuthenticationIF
- Parameters:
listener
- Callback object
-
removeListener
Remove a listener that was previously set byIXAuthenticationIF.addListener(IXAuthenticationListener)
.- Specified by:
removeListener
in interfaceIXAuthenticationIF
- Parameters:
listener
- Callback object
-
isExpired
public boolean isExpired()Check whether the current sessionClientInfo.ticket
is expired.- Specified by:
isExpired
in interfaceIXAuthenticationIF
- Returns:
- true if expired
-
needAlive
public boolean needAlive()Check whether the current sessionClientInfo.ticket
needs to be renewed.- Specified by:
needAlive
in interfaceIXAuthenticationIF
- Returns:
- true if renew is required
-
getSessionOptions
Return session options.- Specified by:
getSessionOptions
in interfaceIXAuthenticationIF
- Returns:
- Session options
-
encryptPassword
Encrypt the given text before sending over the wire.- Specified by:
encryptPassword
in interfaceIXAuthenticationIF
- Parameters:
pwd
- Plain text to be encrypted- Returns:
- Encrypted text
- Throws:
byps.RemoteException
-
getDatabaseEngine
Get database engine name. This value is received by a call toIXServicePortIF.getServerInfo(ClientInfo)
and corresponds toServerInfo.databaseEngine
.- Specified by:
getDatabaseEngine
in interfaceIXAuthenticationIF
- Returns:
- Database engine
-
getEncryptionPasswords
Reserved.- Specified by:
getEncryptionPasswords
in interfaceIXAuthenticationIF
- Returns:
-
getAuthenticationType
Type of this authentication object.- Specified by:
getAuthenticationType
in interfaceIXAuthenticationIF
- Returns:
- Authentication type
-
setLoginResult
Called after authentication to pass theLoginResult
.- Specified by:
setLoginResult
in interfaceIXAuthenticationIF
- Parameters:
loginResult
- Authentication result
-