public class PortalConnection extends java.lang.Object implements Connection
NAME
Constructor and Description |
---|
PortalConnection() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ConnectionListener listener)
Add a connection listener.
|
PortalSession |
getSession()
Get current user session.
|
boolean |
isConnected()
Check if the client is connected to the middleware.
|
void |
login(java.util.Locale locale,
java.lang.String ipAddress,
java.lang.String clientInfo)
Log in to the system with system account.
|
void |
login(java.lang.String login,
java.lang.String password,
java.util.Locale locale,
java.lang.String ipAddress,
java.lang.String clientInfo)
Log in to the system.
|
void |
logout()
Log out of the system.
|
void |
removeListener(ConnectionListener listener)
Remove a connection listener.
|
void |
update(PortalSession session)
Update internal state with the passed user session object.
|
public void login(java.lang.String login, java.lang.String password, java.util.Locale locale, @Nullable java.lang.String ipAddress, @Nullable java.lang.String clientInfo) throws LoginException
Connection
login
in interface Connection
login
- user login namepassword
- encrypted user passwordlocale
- user localeipAddress
- IP addressclientInfo
- Client infoLoginException
- in case of unsuccesful login due to wrong credentials or other issuespublic void login(java.util.Locale locale, @Nullable java.lang.String ipAddress, @Nullable java.lang.String clientInfo) throws LoginException
Connection
login
in interface Connection
locale
- LocaleipAddress
- IP addressclientInfo
- Client infoLoginException
- in case of unsuccesful login due to wrong credentials or other issuespublic void logout()
Connection
logout
in interface Connection
public boolean isConnected()
Connection
isConnected
in interface Connection
public PortalSession getSession()
Connection
getSession
in interface Connection
public void update(PortalSession session) throws LoginException
Connection
update
in interface Connection
session
- new UserSession objectLoginException
- in case of unsuccesful updatepublic void addListener(ConnectionListener listener)
Connection
addListener
in interface Connection
listener
- listener to addpublic void removeListener(ConnectionListener listener)
Connection
removeListener
in interface Connection
listener
- listener to remove