org.eclipse.emf.emfstore.client
Interface ESUsersession

All Known Implementing Classes:
ESUsersessionImpl

public interface ESUsersession

User session for a given ESServer. Can be used with multiple projects. An user session is gained by calling ESServer.login(String, String)

Author:
emueller, wesendon

Method Summary
 void delete()
          Deletes this usersession.
 String getPassword()
          Returns the password.
 ESServer getServer()
          Returns the usersession's server.
 ESSessionId getSessionId()
          Returns the session id of this session.
 String getUsername()
          Returns the name of the user this user session is associated with.
 boolean isLoggedIn()
          Checks whether the user session has a ESSessionId.
 boolean isSavePassword()
          Whether the password that is used by this session will be saved.
 void logout()
          Logs out the user session.
 void refresh()
          Relogins into the server using the same credentials in order to update the ESSessionId.
 void setSavePassword(boolean shouldSavePassword)
          Whether the password that is used by this session should be saved.
 

Method Detail

getServer

ESServer getServer()
Returns the usersession's server.

Returns:
the server this user session is associated with

getUsername

String getUsername()
Returns the name of the user this user session is associated with.

Returns:
username the name of the user this user session is associated with

getPassword

String getPassword()
Returns the password. The password is encrypted with the server's public key, so there's no access to the cleartext password.

Returns:
the encrypted password

isLoggedIn

boolean isLoggedIn()
Checks whether the user session has a ESSessionId.

Returns:
true, if session is logged in, false otherwise

refresh

void refresh()
             throws ESException
Relogins into the server using the same credentials in order to update the ESSessionId.

Throws:
ESException - in case renewal of the session failed

logout

void logout()
            throws ESException
Logs out the user session.

Throws:
ESException - in case an error occurred during logout

getSessionId

ESSessionId getSessionId()
Returns the session id of this session.

Returns:
the current session id

setSavePassword

void setSavePassword(boolean shouldSavePassword)
Whether the password that is used by this session should be saved.

Parameters:
shouldSavePassword - true if the password should be saved, false otherwise
Since:
1.1

isSavePassword

boolean isSavePassword()
Whether the password that is used by this session will be saved.

Returns:
true if the password is saved, false otherwise
Since:
1.1

delete

void delete()
            throws ESException
Deletes this usersession.

Throws:
ESException - in case removing the session fails
Since:
1.1


Copyright © 2015. All Rights Reserved.