fr.ifremer.echobase.ui
Class EchoBaseSession

java.lang.Object
  extended by fr.ifremer.echobase.ui.EchoBaseSession

public class EchoBaseSession
extends Object

The session object of EchoBase to put in servlet session.

Since:
0.1
Author:
tchemit

Field Summary
protected static String PROPERTY_ECHO_BASE_USER
          Key to set User connected in this session.
protected static String PROPERTY_EMBEDDED_APPLICATION_CONFIGURATION
          Key to keep embedded application configuration in this session.
protected static String PROPERTY_EXPORT_DB_CONFIGURATION
          Key to keep export db configuration in this session.
protected static String PROPERTY_IMPORT_DB_CONFIGURATION
          Key to keep import db configuration in this session.
protected  Map<String,Object> store
          To store all properties in this session.
 
Constructor Summary
EchoBaseSession()
          Protect session constructor.
 
Method Summary
 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.
 EchoBaseUser getEchoBaseUser()
          Gets the informations of user as soon as the user is loggued.
 EmbeddedApplicationConfiguration getEmbeddedApplicationConfiguration()
           
 ExportDbConfiguration getExportDbConfiguration()
           
<M extends AbstractImportConfiguration>
M
getImportDataConfiguration(Class<M> configurationType)
           
 ImportDbConfiguration getImportDbConfiguration()
           
 boolean isAdmin()
           
 Object remove(String key)
          Remove form this session, the object from his given key and returns it.
<M extends AbstractImportConfiguration>
void
removeImportDataConfiguration(Class<M> configurationType)
           
protected  void set(String key, Object value)
          Sets in this session the igven object using the given key.
 void setEchoBaseUser(EchoBaseUser echoBaseUser)
          Sets in this session the loggued user.
 void setEmbeddedApplicationConfiguration(EmbeddedApplicationConfiguration configuration)
           
 void setExportDbConfiguration(ExportDbConfiguration configuration)
           
<M extends AbstractImportConfiguration>
void
setImportDataConfiguration(M configuration)
           
 void setImportDbConfiguration(ImportDbConfiguration configuration)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_ECHO_BASE_USER

protected static final String PROPERTY_ECHO_BASE_USER
Key to set User connected in this session.

See Also:
Constant Field Values

PROPERTY_IMPORT_DB_CONFIGURATION

protected static final String PROPERTY_IMPORT_DB_CONFIGURATION
Key to keep import db configuration in this session.

See Also:
Constant Field Values

PROPERTY_EXPORT_DB_CONFIGURATION

protected static final String PROPERTY_EXPORT_DB_CONFIGURATION
Key to keep export db configuration in this session.

See Also:
Constant Field Values

PROPERTY_EMBEDDED_APPLICATION_CONFIGURATION

protected static final String PROPERTY_EMBEDDED_APPLICATION_CONFIGURATION
Key to keep embedded application configuration in this session.

See Also:
Constant Field Values

store

protected Map<String,Object> store
To store all properties in this session.

Constructor Detail

EchoBaseSession

public EchoBaseSession()
Protect session constructor.

Method Detail

getEchoBaseUser

public EchoBaseUser getEchoBaseUser()
Gets the informations of user as soon as the user is loggued.

Returns:
the informations of loggued user or null if not in session

setEchoBaseUser

public void setEchoBaseUser(EchoBaseUser echoBaseUser)
Sets in this session the loggued user.

Parameters:
echoBaseUser - the user loggued to use in this session

getImportDbConfiguration

public ImportDbConfiguration getImportDbConfiguration()

setImportDbConfiguration

public void setImportDbConfiguration(ImportDbConfiguration configuration)

getExportDbConfiguration

public ExportDbConfiguration getExportDbConfiguration()

setExportDbConfiguration

public void setExportDbConfiguration(ExportDbConfiguration configuration)

getEmbeddedApplicationConfiguration

public EmbeddedApplicationConfiguration getEmbeddedApplicationConfiguration()

setEmbeddedApplicationConfiguration

public void setEmbeddedApplicationConfiguration(EmbeddedApplicationConfiguration configuration)

getImportDataConfiguration

public <M extends AbstractImportConfiguration> M getImportDataConfiguration(Class<M> configurationType)

setImportDataConfiguration

public <M extends AbstractImportConfiguration> void setImportDataConfiguration(M configuration)

removeImportDataConfiguration

public <M extends AbstractImportConfiguration> void removeImportDataConfiguration(Class<M> configurationType)

remove

public Object remove(String key)
Remove form this session, the object from his given key and returns it.

Parameters:
key - the key of object to remove from this session
Returns:
the removed object from session, or null if not found

contains

public boolean contains(String key)
Tests if for a given key, there is an associated object in this sessio!!!n.

Parameters:
key - the key to test in this session
Returns:
true if an object was found in this session, false otherwise

get

protected <T> T get(String key,
                    Class<T> type)
Gets from this session an object given his key and his type.

Type Parameters:
T - the type of object to obtain from this session
Parameters:
key - the key of object to obtain from this session
type - the type of object to obtain from this session
Returns:
the object found in this session, or null if not found

set

protected void set(String key,
                   Object value)
Sets in this session the igven object using the given key.

Parameters:
key - the key where to store the object in this session
value - the object to store in this session

isAdmin

public boolean isAdmin()


Copyright © 2011-2012 Ifremer. All Rights Reserved.