Package org.syncany.operations.daemon
Class WebServer
- java.lang.Object
-
- org.syncany.operations.daemon.WebServer
-
public class WebServer extends java.lang.Object
The web server provides a HTTP/REST and WebSocket API to thin clients, as well as a mechanism to run a web interface by implementing aWebInterfacePlugin
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WebServer.RequestFormatType
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
API_ENDPOINT_REST_JSON
static java.lang.String
API_ENDPOINT_REST_XML
static java.lang.String
API_ENDPOINT_WS_JSON
static java.lang.String
API_ENDPOINT_WS_XML
-
Constructor Summary
Constructors Constructor Description WebServer(DaemonConfigTO daemonConfig)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClientChannel(io.undertow.websockets.core.WebSocketChannel clientChannel, WebServer.RequestFormatType format)
static void
generateNewKeyPairAndCertificate(java.lang.String certificateCommonName)
java.io.File
getFileTokenTempFileFromCache(java.lang.String fileToken)
void
onEvent(ExternalEvent event)
void
onGetFileResponseInternal(GetFileFolderResponseInternal fileResponseInternal)
void
onResponse(Response response)
void
putCacheRestRequest(int id, io.undertow.server.HttpServerExchange exchange)
void
putCacheWebSocketRequest(int id, io.undertow.websockets.core.WebSocketChannel clientSocket)
void
putRequestFormatType(int id, WebServer.RequestFormatType requestFormatType)
void
removeClientChannel(io.undertow.websockets.core.WebSocketChannel clientChannel)
void
start()
void
stop()
-
-
-
Field Detail
-
API_ENDPOINT_WS_XML
public static final java.lang.String API_ENDPOINT_WS_XML
- See Also:
- Constant Field Values
-
API_ENDPOINT_WS_JSON
public static final java.lang.String API_ENDPOINT_WS_JSON
- See Also:
- Constant Field Values
-
API_ENDPOINT_REST_XML
public static final java.lang.String API_ENDPOINT_REST_XML
- See Also:
- Constant Field Values
-
API_ENDPOINT_REST_JSON
public static final java.lang.String API_ENDPOINT_REST_JSON
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WebServer
public WebServer(DaemonConfigTO daemonConfig) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-
Method Detail
-
start
public void start() throws ServiceAlreadyStartedException
- Throws:
ServiceAlreadyStartedException
-
stop
public void stop()
-
generateNewKeyPairAndCertificate
public static void generateNewKeyPairAndCertificate(java.lang.String certificateCommonName)
-
onGetFileResponseInternal
public void onGetFileResponseInternal(GetFileFolderResponseInternal fileResponseInternal)
-
onEvent
public void onEvent(ExternalEvent event)
-
onResponse
public void onResponse(Response response)
-
addClientChannel
public void addClientChannel(io.undertow.websockets.core.WebSocketChannel clientChannel, WebServer.RequestFormatType format)
-
removeClientChannel
public void removeClientChannel(io.undertow.websockets.core.WebSocketChannel clientChannel)
-
putCacheRestRequest
public void putCacheRestRequest(int id, io.undertow.server.HttpServerExchange exchange)
-
putCacheWebSocketRequest
public void putCacheWebSocketRequest(int id, io.undertow.websockets.core.WebSocketChannel clientSocket)
-
putRequestFormatType
public void putRequestFormatType(int id, WebServer.RequestFormatType requestFormatType)
-
getFileTokenTempFileFromCache
public java.io.File getFileTokenTempFileFromCache(java.lang.String fileToken)
-
-