Package de.elo.ix.client
Class IXConnLogin
java.lang.Object
de.elo.ix.client.IXConnLogin
- Direct Known Subclasses:
IXConnLoginBYPS
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
static final int
protected Properties
protected IXServicePortIF
protected ArrayList<IXConnLoginCallback>
protected int
protected LoginResult
protected static final String[]
protected Properties
protected long
-
Constructor Summary
ConstructorsConstructorDescriptionIXConnLogin
(IXServicePortIF ix, ClientInfo ci, Properties sessOpts, Properties encrPasswords) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add login listener.ci()
Return the current ClientInfo object.abstract String
encryptPassword
(String pwd) Encrypts the given password.Get encryption passwords.int
Number of re-logins are counted by this value.Get session options.long
Ticket is valid until this time.boolean
Returns true, if the specified error is a session timeout error.ix()
Get Indexserver interface.abstract void
login()
Performs the login.lr()
Return the current LoginResult object.protected SessionOptions
Make Indexserver API object from java.util.Propertiesint
reloginOrThrow
(int prevLoginCount, int loopCount, byps.RemoteException e) Checks wether the given error is a session timeout.
-
Field Details
-
ix
-
lr
-
loginCount
protected volatile int loginCount -
callId
protected int callId -
sessOpts
-
encrPasswords
-
ticketBestBefore
protected long ticketBestBefore -
loginCallbacks
-
DEFAULT_LOOP_MAX
public static final int DEFAULT_LOOP_MAX- See Also:
-
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 optionsencrPasswords
- Passwords used to decrypt/encrypt documents.
-
-
Method Details
-
ci
Return the current ClientInfo object.- Returns:
- ClientInfo object
-
lr
Return the current LoginResult object.- Returns:
- LoginResult object
-
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
Get session options.- Returns:
- Session options
-
getEncrPasswords
Get encryption passwords.- Returns:
- Encryption passwords
-
isReloginError
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 callloopCount
- Number of retriese
- 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
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
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.RemoteExceptionPerforms the login. To be implemented by subclass.- Throws:
byps.RemoteException
- Exception with message text of format "[ELOIX:number] text".
-
encryptPassword
Encrypts the given password.- Parameters:
pwd
- Plain text password.- Returns:
- Encrypted password.
- Throws:
byps.RemoteException
- Exception with message text of format "[ELOIX:number] text".
-