Package org.h2.server.web
Class WebSession
java.lang.Object
org.h2.server.web.WebSession
The web session keeps all data of a user session.
This class is used by the H2 Console.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Bnfprivate Connectionprivate DbContents(package private) StatementThe currently executing statement.(package private) longThe last time this client sent a request.(package private) LocaleThe current locale.The session attribute map.private static final intprivate DatabaseMetaData(package private) ResultSetThe current updatable result set.private final WebServerprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddCommand(String sql) Add a SQL statement to the history.(package private) voidclose()Close the connection and stop the statement if one is currently executing.(package private) ObjectGet the value for the given key.(package private) BnfgetBnf()Get the BNF object.(package private) StringgetCommand(int id) Get the SQL statement from history.Get the list of SQL statements in the history.(package private) Connection(package private) DbContentsgetInfo()Update session meta data information and get the information in a map.(package private) DatabaseMetaData(package private) boolean(package private) voidloadBnf()Load the SQL grammar BNF.(package private) voidPut an attribute value in the map.(package private) ObjectRemove a session attribute from the map.(package private) voidsetConnection(Connection conn) (package private) voidShutdown the server when disconnecting.
-
Field Details
-
MAX_HISTORY
private static final int MAX_HISTORY- See Also:
-
lastAccess
long lastAccessThe last time this client sent a request. -
map
The session attribute map. -
locale
Locale localeThe current locale. -
executingStatement
Statement executingStatementThe currently executing statement. -
result
ResultSet resultThe current updatable result set. -
server
-
commandHistory
-
conn
-
meta
-
contents
-
bnf
-
shutdownServerOnDisconnect
private boolean shutdownServerOnDisconnect
-
-
Constructor Details
-
WebSession
WebSession(WebServer server)
-
-
Method Details
-
put
Put an attribute value in the map.- Parameters:
key- the keyvalue- the new value
-
get
Get the value for the given key.- Parameters:
key- the key- Returns:
- the value
-
remove
Remove a session attribute from the map.- Parameters:
key- the key- Returns:
- value that was associated with the key, or null
-
getBnf
Bnf getBnf()Get the BNF object.- Returns:
- the BNF object
-
loadBnf
void loadBnf()Load the SQL grammar BNF. -
getCommand
Get the SQL statement from history.- Parameters:
id- the history id- Returns:
- the SQL statement
-
addCommand
Add a SQL statement to the history.- Parameters:
sql- the SQL statement
-
getCommandHistory
Get the list of SQL statements in the history.- Returns:
- the commands
-
getInfo
Update session meta data information and get the information in a map.- Returns:
- a map containing the session meta data
-
setConnection
- Throws:
SQLException
-
getMetaData
DatabaseMetaData getMetaData() -
getConnection
Connection getConnection() -
getContents
DbContents getContents() -
setShutdownServerOnDisconnect
void setShutdownServerOnDisconnect()Shutdown the server when disconnecting. -
getShutdownServerOnDisconnect
boolean getShutdownServerOnDisconnect() -
close
void close()Close the connection and stop the statement if one is currently executing.
-