org.eclipse.emf.emfstore.internal.client.model.connectionmanager
Class BasicSessionProvider

java.lang.Object
  extended by org.eclipse.emf.emfstore.client.sessionprovider.ESAbstractSessionProvider
      extended by org.eclipse.emf.emfstore.internal.client.model.connectionmanager.BasicSessionProvider

public class BasicSessionProvider
extends ESAbstractSessionProvider

Basic implementation of ESAbstractSessionProvider. It's intended for when using EMFStore headless. The UI counterpart of this would open the login dialog, this implementation throws an exceptions and requires you to login the Usersession first.

Author:
wesendon

Constructor Summary
BasicSessionProvider()
           
 
Method Summary
 ESUsersession login(ESUsersession usersession)
           This method is called by the SessionManager in order to login a given user session.
 ESUsersession provideUsersession(ESServer serverInfo)
           This is the template method for ESAbstractSessionProvider.provideUsersession(ESServer).
 
Methods inherited from class org.eclipse.emf.emfstore.client.sessionprovider.ESAbstractSessionProvider
provideUsersession
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicSessionProvider

public BasicSessionProvider()
Method Detail

provideUsersession

public ESUsersession provideUsersession(ESServer serverInfo)
                                 throws ESException

This is the template method for ESAbstractSessionProvider.provideUsersession(ESServer). It is called, if the latter couldn't determine a suitable user session. Use this in order to implement a session selection UI or a headless selection logic.

Specified by:
provideUsersession in class ESAbstractSessionProvider
Parameters:
serverInfo - This parameter is a hint from the ESServer. For that reason it can be null. A common example is share, where the user first has to select the server before logging in. If ESServer is set you should allow the user to select the account for the given server.
Returns:
an user session. It is not specified whether this session is logged in or logged out.
Throws:
ESException - in case an exception occurred while obtaining the user session
See Also:
ESAbstractSessionProvider.provideUsersession(org.eclipse.emf.emfstore.client.ESServer)

login

public ESUsersession login(ESUsersession usersession)
                    throws ESException

This method is called by the SessionManager in order to login a given user session. If the given session can not be logged in, it is the provider's responsibility to either throw an exception or to provide another valid session, e.g. by means of calling a login hdialog that will create a new session.

Specified by:
login in class ESAbstractSessionProvider
Parameters:
usersession - the session to be logged in
Returns:
a logged in user session, possibly another one as the one passed in. It is the provider's responsibility to determine whether the passed in session and the one that is returned need to differ
Throws:
ESException - in case an exception occurred while logging in the given session
See Also:
ESAbstractSessionProvider.login(org.eclipse.emf.emfstore.client.ESUsersession)


Copyright © 2015. All Rights Reserved.