Class IXConnLogin

java.lang.Object
de.elo.ix.client.IXConnLogin
Direct Known Subclasses:
IXConnLoginBYPS

public abstract class IXConnLogin extends Object
  • Field Details

    • ix

      protected IXServicePortIF ix
    • lr

      protected LoginResult lr
    • loginCount

      protected volatile int loginCount
    • callId

      protected int callId
    • sessOpts

      protected Properties sessOpts
    • encrPasswords

      protected Properties encrPasswords
    • ticketBestBefore

      protected long ticketBestBefore
    • loginCallbacks

      protected ArrayList<IXConnLoginCallback> loginCallbacks
    • DEFAULT_LOOP_MAX

      public static final int DEFAULT_LOOP_MAX
      See Also:
    • RELOGIN_ERRORS

      protected static final String[] RELOGIN_ERRORS
  • Constructor Details

    • IXConnLogin

      public IXConnLogin(IXServicePortIF ix, ClientInfo ci, Properties sessOpts, Properties encrPasswords)
      Constructor.
      Parameters:
      ix - Indexserver interface.
      ci - ClientInfo, Language, Timezone, etc.
      sessOpts - Session options
      encrPasswords - Passwords used to decrypt/encrypt documents.
  • Method Details

    • ci

      public ClientInfo ci()
      Return the current ClientInfo object.
      Returns:
      ClientInfo object
    • lr

      public LoginResult lr()
      Return the current LoginResult object.
      Returns:
      LoginResult object
    • ix

      public IXServicePortIF ix()
      Get Indexserver interface.
      Returns:
      Indexserver object
    • getLoginCount

      public int getLoginCount()
      Number of re-logins are counted by this value.
      Returns:
      Number of re-logins
    • getSessionOptions

      public IXProperties getSessionOptions()
      Get session options.
      Returns:
      Session options
    • getEncrPasswords

      public Properties getEncrPasswords()
      Get encryption passwords.
      Returns:
      Encryption passwords
    • isReloginError

      public boolean isReloginError(Throwable e)
      Returns true, if the specified error is a session timeout error.
      Parameters:
      e - Exception
      Returns:
      true, if function should be retried after a re-login.
    • reloginOrThrow

      public int reloginOrThrow(int prevLoginCount, int loopCount, byps.RemoteException e) throws byps.RemoteException
      Checks wether the given error is a session timeout. In this case the login function is called. Otherwise the exeption is thrown.
      Parameters:
      prevLoginCount - Number of login retries passed to the previous call
      loopCount - Number of retries
      e - Exception or null. If not null, the Exception is immediately fired.
      Returns:
      Current number of re-logins.
      Throws:
      byps.RemoteException - Exception with message text of format "[ELOIX:number] text".
    • makeSessOptsObj

      protected SessionOptions makeSessOptsObj()
      Make Indexserver API object from java.util.Properties
      Returns:
      Session options
    • getTicketBestBefore

      public long getTicketBestBefore()
      Ticket is valid until this time.
      Returns:
      System milliseconds when the ticket expires
    • addLoginListener

      public void addLoginListener(IXConnLoginCallback cb)
      Add login listener. The interface is called, after login was successful and session options were sent. If the session expires and a re-login is performed, the interface is called again.
      Parameters:
      cb - Callback object
    • login

      public abstract void login() throws byps.RemoteException
      Performs the login. To be implemented by subclass.
      Throws:
      byps.RemoteException - Exception with message text of format "[ELOIX:number] text".
    • encryptPassword

      public abstract String encryptPassword(String pwd) throws byps.RemoteException
      Encrypts the given password.
      Parameters:
      pwd - Plain text password.
      Returns:
      Encrypted password.
      Throws:
      byps.RemoteException - Exception with message text of format "[ELOIX:number] text".