Class SyncopeEnduserSession
- java.lang.Object
-
- org.apache.wicket.Session
-
- org.apache.wicket.protocol.http.WebSession
-
- org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession
-
- org.apache.wicket.authroles.authentication.AuthenticatedWebSession
-
- org.apache.syncope.client.enduser.SyncopeEnduserSession
-
- All Implemented Interfaces:
Serializable
,BaseSession
,IEventSink
,IFeedbackContributor
,IMetadataContext<Serializable,Session>
,IClusterable
public class SyncopeEnduserSession extends AuthenticatedWebSession implements BaseSession
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SyncopeEnduserSession.Error
-
Field Summary
Fields Modifier and Type Field Description protected SyncopeAnonymousClient
anonymousClient
protected SyncopeClient
client
protected SyncopeClientFactoryBean
clientFactory
protected String
domain
protected static Logger
LOG
protected UserTO
selfTO
protected Map<Class<?>,Object>
services
-
Fields inherited from class org.apache.wicket.Session
clientInfo, SESSION_ATTRIBUTE_NAME
-
-
Constructor Summary
Constructors Constructor Description SyncopeEnduserSession(Request request)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authenticate(String jwt)
boolean
authenticate(String username, String password)
void
cleanup()
<T> Future<T>
execute(Callable<T> command)
static SyncopeEnduserSession
get()
SyncopeAnonymousClient
getAnonymousClient()
<T> T
getAnonymousService(Class<T> serviceClass)
DateOps.Format
getDateFormat()
String
getDomain()
String
getJWT()
javax.ws.rs.core.MediaType
getMediaType()
PlatformInfo
getPlatformInfo()
Roles
getRoles()
UserTO
getSelfTO()
UserTO
getSelfTO(boolean reload)
<T> T
getService(Class<T> serviceClass)
<T> T
getService(String etag, Class<T> serviceClass)
void
invalidate()
protected boolean
isAuthenticated()
protected boolean
isMustChangePassword()
protected String
message(SyncopeClientException sce)
void
onException(Exception e)
Extract and localize (if translation available) the actual message from the given exception; then, report it viaSession.error(java.io.Serializable)
.protected void
refreshAuth(String username)
<T> void
resetClient(Class<T> service)
void
setDomain(String domain)
-
Methods inherited from class org.apache.wicket.authroles.authentication.AuthenticatedWebSession
isSignedIn, signIn, signIn, signOut
-
Methods inherited from class org.apache.wicket.protocol.http.WebSession
generateNewSessionId, getClientInfo, newBrowserInfoPage
-
Methods inherited from class org.apache.wicket.Session
bind, changeSessionId, clear, debug, detach, dirty, dirty, endRequest, error, exists, fatal, getApplication, getAttribute, getAttributeNames, getAuthorizationStrategy, getClassResolver, getFeedbackMessages, getId, getLocale, getMetaData, getPageFactory, getPageManager, getSessionStore, getSizeInBytes, getStyle, info, internalDetach, invalidateNow, isRtlLanguage, isRtlLocale, isSessionInvalidated, isTemporary, newPageAccessSynchronizer, nextPageId, nextSequenceValue, onEvent, onInvalidate, removeAttribute, replaceSession, setAttribute, setClientInfo, setLocale, setMetaData, setStyle, success, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.syncope.client.ui.commons.BaseSession
getSupportedLocales
-
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
-
clientFactory
protected final SyncopeClientFactoryBean clientFactory
-
domain
protected String domain
-
client
protected SyncopeClient client
-
anonymousClient
protected SyncopeAnonymousClient anonymousClient
-
selfTO
protected UserTO selfTO
-
-
Constructor Detail
-
SyncopeEnduserSession
public SyncopeEnduserSession(Request request)
-
-
Method Detail
-
get
public static SyncopeEnduserSession get()
-
message
protected String message(SyncopeClientException sce)
-
onException
public void onException(Exception e)
Extract and localize (if translation available) the actual message from the given exception; then, report it viaSession.error(java.io.Serializable)
.- Specified by:
onException
in interfaceBaseSession
- Parameters:
e
- raised exception- See Also:
RestClientExceptionMapper
-
getMediaType
public javax.ws.rs.core.MediaType getMediaType()
-
execute
public <T> Future<T> execute(Callable<T> command)
- Specified by:
execute
in interfaceBaseSession
-
setDomain
public void setDomain(String domain)
- Specified by:
setDomain
in interfaceBaseSession
-
getDomain
public String getDomain()
- Specified by:
getDomain
in interfaceBaseSession
-
getJWT
public String getJWT()
- Specified by:
getJWT
in interfaceBaseSession
-
getRoles
public Roles getRoles()
- Specified by:
getRoles
in classAbstractAuthenticatedWebSession
-
getPlatformInfo
public PlatformInfo getPlatformInfo()
-
authenticate
public boolean authenticate(String username, String password)
- Specified by:
authenticate
in classAuthenticatedWebSession
-
authenticate
public boolean authenticate(String jwt)
-
refreshAuth
protected void refreshAuth(String username)
-
isAuthenticated
protected boolean isAuthenticated()
-
isMustChangePassword
protected boolean isMustChangePassword()
-
cleanup
public void cleanup()
-
invalidate
public void invalidate()
- Overrides:
invalidate
in classAuthenticatedWebSession
-
getSelfTO
public UserTO getSelfTO()
-
getSelfTO
public UserTO getSelfTO(boolean reload)
-
getAnonymousClient
public SyncopeAnonymousClient getAnonymousClient()
- Specified by:
getAnonymousClient
in interfaceBaseSession
-
getAnonymousService
public <T> T getAnonymousService(Class<T> serviceClass)
- Specified by:
getAnonymousService
in interfaceBaseSession
-
getService
public <T> T getService(Class<T> serviceClass)
- Specified by:
getService
in interfaceBaseSession
-
getService
public <T> T getService(String etag, Class<T> serviceClass)
- Specified by:
getService
in interfaceBaseSession
-
resetClient
public <T> void resetClient(Class<T> service)
- Specified by:
resetClient
in interfaceBaseSession
-
getDateFormat
public DateOps.Format getDateFormat()
- Specified by:
getDateFormat
in interfaceBaseSession
-
-