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 TypeMethodDescriptionvoidaddListener(IXAuthenticationListener listener) Add a listener that is called on re-login.voidauthenticate(byps.BClient client1, byps.BAsyncResult<Boolean> asyncResult) Authenticate the current user.encryptPassword(String pwd) Encrypt the given text before sending over the wire.voidStore provided SessionOptions object in current session options.Type of this authentication object.Get database engine name.Reserved.protected abstract IXAuthenticationIFReturn the encapsulated authentication object.LoginResultreceived from Indexserver as the result of authentication.voidgetSession(byps.BClient client, int typeId, byps.BAsyncResult<Object> asyncResult) Return the object representing the current session.Return session options.booleanCheck whether the current sessionClientInfo.ticketis expired.booleanisReloginException(byps.BClient client, Throwable e, int typeId) Return true, if the given exception has to trigger authentication.Build SessionOptions object from current session options.booleanCheck whether the current sessionClientInfo.ticketneeds to be renewed.voidremoveListener(IXAuthenticationListener listener) Remove a listener that was previously set byIXAuthenticationIF.addListener(IXAuthenticationListener).voidsetLoginResult(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, waitMethods 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
LoginResultreceived from Indexserver as the result of authentication.- Specified by:
getLoginResultin interfaceIXAuthenticationIF- Returns:
- LoginResult
-
authenticate
Authenticate the current user.- Specified by:
authenticatein 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:
isReloginExceptionin 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:
getSessionin 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:
makeSessOptsObjin interfaceIXAuthenticationIF- Returns:
- SessionOptions
-
fromSessOptsObj
Store provided SessionOptions object in current session options. This function does not send the options to IX.- Specified by:
fromSessOptsObjin interfaceIXAuthenticationIF- Parameters:
opts- SessionOptions object.
-
addListener
Add a listener that is called on re-login.- Specified by:
addListenerin interfaceIXAuthenticationIF- Parameters:
listener- Callback object
-
removeListener
Remove a listener that was previously set byIXAuthenticationIF.addListener(IXAuthenticationListener).- Specified by:
removeListenerin interfaceIXAuthenticationIF- Parameters:
listener- Callback object
-
isExpired
public boolean isExpired()Check whether the current sessionClientInfo.ticketis expired.- Specified by:
isExpiredin interfaceIXAuthenticationIF- Returns:
- true if expired
-
needAlive
public boolean needAlive()Check whether the current sessionClientInfo.ticketneeds to be renewed.- Specified by:
needAlivein interfaceIXAuthenticationIF- Returns:
- true if renew is required
-
getSessionOptions
Return session options.- Specified by:
getSessionOptionsin interfaceIXAuthenticationIF- Returns:
- Session options
-
encryptPassword
Encrypt the given text before sending over the wire.- Specified by:
encryptPasswordin 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:
getDatabaseEnginein interfaceIXAuthenticationIF- Returns:
- Database engine
-
getEncryptionPasswords
Reserved.- Specified by:
getEncryptionPasswordsin interfaceIXAuthenticationIF- Returns:
-
getAuthenticationType
Type of this authentication object.- Specified by:
getAuthenticationTypein interfaceIXAuthenticationIF- Returns:
- Authentication type
-
setLoginResult
Called after authentication to pass theLoginResult.- Specified by:
setLoginResultin interfaceIXAuthenticationIF- Parameters:
loginResult- Authentication result
-