|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.emfstore.client.sessionprovider.ESAbstractSessionProvider
public abstract class ESAbstractSessionProvider
This is the abstract super class for SessionProviders. All session providers should extend this class.
SessionProvider derives a user session for a given server request (ESServerCall
). When overriding
provideUsersession(ESServerCall)
, it is possible to gain more context for the ESUsersession
selection.
However, in most usecases most, users will use the session provider to open a login dialog of some kind. For this
purpose it is better to use provideUsersession(ESServer)
. SessionProviders can be registered via an
extension point.
NOTE: Implementations of SessionProviders must not assume that they are executed within the UI-Thread.
Constructor Summary | |
---|---|
ESAbstractSessionProvider()
|
Method Summary | |
---|---|
abstract ESUsersession |
login(ESUsersession usersession)
This method is called by the SessionManager in order to login a given user session. |
abstract ESUsersession |
provideUsersession(ESServer server)
This is the template method for provideUsersession(ESServer) . |
ESUsersession |
provideUsersession(ESServerCall serverCall)
The SessionManager calls this method in order to obtain a user session. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ESAbstractSessionProvider()
Method Detail |
---|
public ESUsersession provideUsersession(ESServerCall serverCall) throws ESException
The SessionManager calls this method in order to obtain a user session. In its default implementation it first
looks for specified user session in the ESServerCall
, then it checks whether the local project is
associated with a user session (e.g. in case of update). If there is still no user session,
provideUsersession(ESServer)
is called, which is meant to be used when implementing an UI to select a
UI.
In most cases it is sufficient to implement provideUsersession(ESServer)
. There should be no need to
change this implementation.
serverCall
- current server call
ESException
- in case an exception occurred while obtaining the user sessionpublic abstract ESUsersession provideUsersession(ESServer server) throws ESException
This is the template method for 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.
server
- 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.
ESException
- in case an exception occurred while obtaining the user sessionpublic abstract 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.
usersession
- the session to be logged in
ESException
- in case an exception occurred while logging in the given session
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |