Top Description Fields Constructors Methods
org.h2.server.web

pack-priv Class WebSession

extends Object
Class Inheritance
Imports
java.sql.Connection, .DatabaseMetaData, .ResultSet, .SQLException, .Statement, .Timestamp, java.util.ArrayList, .HashMap, .Locale, org.h2.bnf.Bnf, org.h2.bnf.context.DbContents, .DbContextRule, org.h2.message.DbException

The web session keeps all data of a user session. This class is used by the H2 Console.

Field Summary

Modifier and TypeField and Description
private Bnf
private final ArrayList<String>
private Connection
private DbContents
pack-priv Statement
executingStatement

The currently executing statement.

pack-priv long
lastAccess

The last time this client sent a request.

pack-priv Locale
locale

The current locale.

pack-priv final HashMap<String, Object>
map

The session attribute map.

private static final int
private DatabaseMetaData
pack-priv ResultSet
result

The current updatable result set.

private final WebServer
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addCommand(String
the SQL statement
sql
)

Add a SQL statement to the history.

pack-priv void
close()

Close the connection and stop the statement if one is currently executing.

pack-priv Object

Returns:

the value
get
(String
the key
key
)

Get the value for the given key.

pack-priv Bnf

Returns:

the BNF object
getBnf
()

Get the BNF object.

pack-priv String

Returns:

the SQL statement
getCommand
(int
the history id
id
)

Get the SQL statement from history.

pack-priv ArrayList<String>

Returns:

the commands
getCommandHistory
()

Get the list of SQL statements in the history.

pack-priv Connection
pack-priv DbContents
pack-priv HashMap<String, Object>

Returns:

a map containing the session meta data
getInfo
()

Update session meta data information and get the information in a map.

pack-priv DatabaseMetaData
pack-priv boolean
pack-priv void
loadBnf()

Load the SQL grammar BNF.

pack-priv void
put(String
the key
key
,
Object
the new value
value
)

Put an attribute value in the map.

pack-priv Object

Returns:

value that was associated with the key, or null
remove
(String
the key
key
)

Remove a session attribute from the map.

pack-priv void
pack-priv void
setShutdownServerOnDisconnect()

Shutdown the server when disconnecting.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bnfback to summary
private Bnf bnf
commandHistoryback to summary
private final ArrayList<String> commandHistory
connback to summary
private Connection conn
contentsback to summary
private DbContents contents
executingStatementback to summary
pack-priv Statement executingStatement

The currently executing statement.

lastAccessback to summary
pack-priv long lastAccess

The last time this client sent a request.

localeback to summary
pack-priv Locale locale

The current locale.

mapback to summary
pack-priv final HashMap<String, Object> map

The session attribute map.

MAX_HISTORYback to summary
private static final int MAX_HISTORY
metaback to summary
private DatabaseMetaData meta
resultback to summary
pack-priv ResultSet result

The current updatable result set.

serverback to summary
private final WebServer server
shutdownServerOnDisconnectback to summary
private boolean shutdownServerOnDisconnect

Constructor Detail

WebSessionback to summary
pack-priv WebSession(WebServer server)

Method Detail

addCommandback to summary
pack-priv void addCommand(String sql)

Add a SQL statement to the history.

Parameters
sql:String

the SQL statement

closeback to summary
pack-priv void close()

Close the connection and stop the statement if one is currently executing.

getback to summary
pack-priv Object get(String key)

Get the value for the given key.

Parameters
key:String

the key

Returns:Object

the value

getBnfback to summary
pack-priv Bnf getBnf()

Get the BNF object.

Returns:Bnf

the BNF object

getCommandback to summary
pack-priv String getCommand(int id)

Get the SQL statement from history.

Parameters
id:int

the history id

Returns:String

the SQL statement

getCommandHistoryback to summary
pack-priv ArrayList<String> getCommandHistory()

Get the list of SQL statements in the history.

Returns:ArrayList<String>

the commands

getConnectionback to summary
pack-priv Connection getConnection()
getContentsback to summary
pack-priv DbContents getContents()
getInfoback to summary
pack-priv HashMap<String, Object> getInfo()

Update session meta data information and get the information in a map.

Returns:HashMap<String, Object>

a map containing the session meta data

getMetaDataback to summary
pack-priv DatabaseMetaData getMetaData()
getShutdownServerOnDisconnectback to summary
pack-priv boolean getShutdownServerOnDisconnect()
loadBnfback to summary
pack-priv void loadBnf()

Load the SQL grammar BNF.

putback to summary
pack-priv void put(String key, Object value)

Put an attribute value in the map.

Parameters
key:String

the key

value:Object

the new value

removeback to summary
pack-priv Object remove(String key)

Remove a session attribute from the map.

Parameters
key:String

the key

Returns:Object

value that was associated with the key, or null

setConnectionback to summary
pack-priv void setConnection(Connection conn) throws SQLException
setShutdownServerOnDisconnectback to summary
pack-priv void setShutdownServerOnDisconnect()

Shutdown the server when disconnecting.