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 Bnf
private Connection
private DbContents
(package private) Statement
The currently executing statement.(package private) long
The last time this client sent a request.(package private) Locale
The current locale.The session attribute map.private static final int
private DatabaseMetaData
(package private) ResultSet
The current updatable result set.private final WebServer
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
addCommand
(String sql) Add a SQL statement to the history.(package private) void
close()
Close the connection and stop the statement if one is currently executing.(package private) Object
Get the value for the given key.(package private) Bnf
getBnf()
Get the BNF object.(package private) String
getCommand
(int id) Get the SQL statement from history.Get the list of SQL statements in the history.(package private) Connection
(package private) DbContents
getInfo()
Update session meta data information and get the information in a map.(package private) DatabaseMetaData
(package private) boolean
(package private) void
loadBnf()
Load the SQL grammar BNF.(package private) void
Put an attribute value in the map.(package private) Object
Remove a session attribute from the map.(package private) void
setConnection
(Connection conn) (package private) void
Shutdown 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.
-