public class EchoBaseSession extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
static String |
SESSION_TOKEN_ERRORS |
static String |
SESSION_TOKEN_MESSAGES |
static String |
SESSION_TOKEN_WARNINGS |
protected Map<String,Object> |
store
To store all properties in this session.
|
| Modifier | Constructor and Description |
|---|---|
protected |
EchoBaseSession()
Protect session constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMessage(String messageScope,
String message) |
void |
clearDynamicData() |
void |
close()
Release any resources contained in the user session.
|
<T extends Serializable> |
consumeDynamicData(String token) |
<T extends Serializable> |
consumeDynamicSetData(String token) |
protected boolean |
contains(String key)
Tests if for a given key, there is an associated object in this sessio!!!n.
|
protected <T> T |
get(String key,
Class<T> type)
Gets from this session an object given his key and his type.
|
<C extends AbstractEchobaseActionConfiguration> |
getActionConfiguration(Class<C> configurationType) |
protected Map<String,Object> |
getDynamicData() |
<T extends Serializable> |
getDynamicData(String token) |
<T extends Serializable> |
getDynamicSetData(String token) |
static EchoBaseSession |
getEchoBaseSession(com.opensymphony.xwork2.ActionContext actionContext)
Obtain the user T3 session.
|
static EchoBaseSession |
getEchoBaseSession(javax.servlet.http.HttpSession session) |
Collection<String> |
getFlashErrors() |
Collection<String> |
getFlashMessages() |
Collection<String> |
getFlashWarnings() |
EchoBaseUser |
getUser()
Gets the informations of user as soon as the user is loggued.
|
JdbcConfiguration |
getWorkingDbConfiguration() |
org.nuiton.topia.TopiaContext |
getWorkingDbRootContext() |
void |
initWorkingDb(JdbcConfiguration jdbcConfiguration)
Initialize the t3 database configuration from the given connection
configuration.
|
boolean |
isAdmin() |
boolean |
isWithFlashErrors() |
boolean |
isWithFlashMessages() |
boolean |
isWithFlashWarnings() |
boolean |
isWorkingDbSelected() |
void |
putDynamicData(String token,
Serializable data) |
<T extends Serializable> |
putDynamicSetData(String token,
Set<T> data) |
void |
releaseWorkingDb() |
protected Object |
remove(String key)
Remove form this session, the object from his given key and returns it.
|
<C extends AbstractEchobaseActionConfiguration> |
removeActionConfiguration(Class<C> configurationType) |
void |
removeDynamicData(String token) |
static void |
removeEchoBaseSession(com.opensymphony.xwork2.ActionContext actionContext) |
protected void |
set(String key,
Object value)
Sets in this session the igven object using the given key.
|
<C extends AbstractEchobaseActionConfiguration> |
setActionConfiguration(C configurationType) |
void |
setUser(EchoBaseUser user)
Sets in this session the loggued user.
|
public static final String SESSION_TOKEN_MESSAGES
public static final String SESSION_TOKEN_ERRORS
public static final String SESSION_TOKEN_WARNINGS
public static EchoBaseSession getEchoBaseSession(com.opensymphony.xwork2.ActionContext actionContext)
actionContext - where to find user sessionpublic static EchoBaseSession getEchoBaseSession(javax.servlet.http.HttpSession session)
public static void removeEchoBaseSession(com.opensymphony.xwork2.ActionContext actionContext)
public EchoBaseUser getUser()
null if not in sessionpublic boolean isAdmin()
public void setUser(EchoBaseUser user)
user - the user loggued to use in this sessionpublic JdbcConfiguration getWorkingDbConfiguration()
public org.nuiton.topia.TopiaContext getWorkingDbRootContext()
public boolean isWorkingDbSelected()
public void initWorkingDb(JdbcConfiguration jdbcConfiguration) throws org.nuiton.topia.TopiaNotFoundException
jdbcConfiguration - the connection configuration to useorg.nuiton.topia.TopiaNotFoundException - if could not create root contextpublic <C extends AbstractEchobaseActionConfiguration> C getActionConfiguration(Class<C> configurationType)
public <C extends AbstractEchobaseActionConfiguration> void setActionConfiguration(C configurationType)
public <C extends AbstractEchobaseActionConfiguration> void removeActionConfiguration(Class<C> configurationType)
public void releaseWorkingDb()
public <T extends Serializable> T getDynamicData(String token)
public <T extends Serializable> Set<T> getDynamicSetData(String token)
public <T extends Serializable> T consumeDynamicData(String token)
public <T extends Serializable> Set<T> consumeDynamicSetData(String token)
public <T extends Serializable> void putDynamicSetData(String token, Set<T> data)
public void putDynamicData(String token, Serializable data)
public void removeDynamicData(String token)
public void clearDynamicData()
protected Object remove(String key)
key - the key of object to remove from this sessionnull if not foundprotected boolean contains(String key)
key - the key to test in this sessiontrue if an object was found in this session,
false otherwiseprotected <T> T get(String key, Class<T> type)
T - the type of object to obtain from this sessionkey - the key of object to obtain from this sessiontype - the type of object to obtain from this sessionnull if not foundprotected void set(String key, Object value)
key - the key where to store the object in this sessionvalue - the object to store in this sessionpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic boolean isWithFlashMessages()
public boolean isWithFlashErrors()
public boolean isWithFlashWarnings()
public Collection<String> getFlashMessages()
public Collection<String> getFlashErrors()
public Collection<String> getFlashWarnings()
Copyright © 2011–2013 Ifremer. All rights reserved.