Class WebServer
java.lang.Object
org.h2.server.web.WebServer
- All Implemented Interfaces:
Service
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddSession(Connection conn) Create a session with a given connection.booleanCheck if remote connections are allowed.getHost()getName()Get the human readable name of the service.intgetPort()Gets the port this service is listening on.getType()Get the human readable short name of the service.getURL()Get the URL of this service in a human readable formvoidInitialize the service from command line options.booleanbooleanisDaemon()Check if a daemon thread should be used.booleanisRunning(boolean traceError) Check if the service is running.booleanvoidlisten()Listen for incoming connections.voidsaveCommandHistoryList(ArrayList<String> commandHistory) Save the command history to the properties file.voidsetAllowSecureCreation(boolean allowSecureCreation) voidsetCommandHistoryAllowed(boolean allowed) voidSets the key for privileged connections.voidsetShutdownHandler(ShutdownHandler shutdownHandler) voidstart()Start the service.voidstop()Stop the service.
-
Constructor Details
-
WebServer
public WebServer()
-
-
Method Details
-
setKey
Sets the key for privileged connections.- Parameters:
key- key, or null
-
setAllowSecureCreation
public void setAllowSecureCreation(boolean allowSecureCreation) - Parameters:
allowSecureCreation- whether creation of databases using the key should be allowed
-
init
-
getURL
-
getHost
- Returns:
- host name
-
start
-
listen
-
isRunning
-
isStopped
public boolean isStopped() -
stop
-
getType
-
getName
-
getAllowOthers
public boolean getAllowOthers()Description copied from interface:ServiceCheck if remote connections are allowed.- Specified by:
getAllowOthersin interfaceService- Returns:
- true if remote connections are allowed
-
getPort
-
isCommandHistoryAllowed
public boolean isCommandHistoryAllowed() -
setCommandHistoryAllowed
public void setCommandHistoryAllowed(boolean allowed) -
getCommandHistoryList
-
saveCommandHistoryList
-
setShutdownHandler
-
addSession
Create a session with a given connection.- Parameters:
conn- the connection- Returns:
- the URL of the web site to access this connection
- Throws:
SQLException- on failure
-
isDaemon
-