Class IXAuthenticationWrapper

java.lang.Object
de.elo.ix.client.IXAuthenticationWrapper
All Implemented Interfaces:
byps.BAuthentication, IXAuthenticationIF
Direct Known Subclasses:
IXAuthenticationNormalized

public abstract class IXAuthenticationWrapper extends Object implements IXAuthenticationIF
This class encapsulates an IXAuthenticationIF object to intercept authentication functions.
  • Constructor Details

    • IXAuthenticationWrapper

      public IXAuthenticationWrapper()
  • Method Details

    • getInnerAuthentication

      protected abstract IXAuthenticationIF getInnerAuthentication()
      Return the encapsulated authentication object.
      Returns:
      Authentication object
    • getLoginResult

      public LoginResult getLoginResult()
      LoginResult received from Indexserver as the result of authentication.
      Specified by:
      getLoginResult in interface IXAuthenticationIF
      Returns:
      LoginResult
    • authenticate

      public void authenticate(byps.BClient client1, byps.BAsyncResult<Boolean> asyncResult)
      Authenticate the current user.
      Specified by:
      authenticate in interface byps.BAuthentication
      Parameters:
      client1 - BClient object
      asyncResult - Result object, only the exception is evaluated.
    • isReloginException

      public boolean isReloginException(byps.BClient client, Throwable e, int typeId)
      Return true, if the given exception has to trigger authentication.
      Specified by:
      isReloginException in interface byps.BAuthentication
      Parameters:
      client - BClient object
      e - 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

      public void getSession(byps.BClient client, int typeId, byps.BAsyncResult<Object> asyncResult)
      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 interface byps.BAuthentication
      Parameters:
      client - BClient object
      typeId - Type ID (serialVersionUID) of the last request class, see BAuthentication.isReloginException(BClient, Throwable, int).
      asyncResult - This object receives the session object or an exception.
      See Also:
      • BMethodRequest.setSession(Object)
    • makeSessOptsObj

      public SessionOptions makeSessOptsObj()
      Build SessionOptions object from current session options.
      Specified by:
      makeSessOptsObj in interface IXAuthenticationIF
      Returns:
      SessionOptions
    • fromSessOptsObj

      public void fromSessOptsObj(SessionOptions opts)
      Store provided SessionOptions object in current session options. This function does not send the options to IX.
      Specified by:
      fromSessOptsObj in interface IXAuthenticationIF
      Parameters:
      opts - SessionOptions object.
    • addListener

      public void addListener(IXAuthenticationListener listener)
      Add a listener that is called on re-login.
      Specified by:
      addListener in interface IXAuthenticationIF
      Parameters:
      listener - Callback object
    • removeListener

      public void removeListener(IXAuthenticationListener listener)
      Remove a listener that was previously set by IXAuthenticationIF.addListener(IXAuthenticationListener).
      Specified by:
      removeListener in interface IXAuthenticationIF
      Parameters:
      listener - Callback object
    • isExpired

      public boolean isExpired()
      Check whether the current session ClientInfo.ticket is expired.
      Specified by:
      isExpired in interface IXAuthenticationIF
      Returns:
      true if expired
    • needAlive

      public boolean needAlive()
      Check whether the current session ClientInfo.ticket needs to be renewed.
      Specified by:
      needAlive in interface IXAuthenticationIF
      Returns:
      true if renew is required
    • getSessionOptions

      public Properties getSessionOptions()
      Return session options.
      Specified by:
      getSessionOptions in interface IXAuthenticationIF
      Returns:
      Session options
    • encryptPassword

      public String encryptPassword(String pwd) throws byps.RemoteException
      Encrypt the given text before sending over the wire.
      Specified by:
      encryptPassword in interface IXAuthenticationIF
      Parameters:
      pwd - Plain text to be encrypted
      Returns:
      Encrypted text
      Throws:
      byps.RemoteException
    • getDatabaseEngine

      public String getDatabaseEngine()
      Get database engine name. This value is received by a call to IXServicePortIF.getServerInfo(ClientInfo) and corresponds to ServerInfo.databaseEngine.
      Specified by:
      getDatabaseEngine in interface IXAuthenticationIF
      Returns:
      Database engine
    • getEncryptionPasswords

      public Properties getEncryptionPasswords()
      Reserved.
      Specified by:
      getEncryptionPasswords in interface IXAuthenticationIF
      Returns:
    • getAuthenticationType

      public EAuthenticationType getAuthenticationType()
      Type of this authentication object.
      Specified by:
      getAuthenticationType in interface IXAuthenticationIF
      Returns:
      Authentication type
    • setLoginResult

      public void setLoginResult(LoginResult loginResult)
      Called after authentication to pass the LoginResult.
      Specified by:
      setLoginResult in interface IXAuthenticationIF
      Parameters:
      loginResult - Authentication result