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 classWebServer.RequestFormatType
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAPI_ENDPOINT_REST_JSONstatic java.lang.StringAPI_ENDPOINT_REST_XMLstatic java.lang.StringAPI_ENDPOINT_WS_JSONstatic java.lang.StringAPI_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 voidaddClientChannel(io.undertow.websockets.core.WebSocketChannel clientChannel, WebServer.RequestFormatType format)static voidgenerateNewKeyPairAndCertificate(java.lang.String certificateCommonName)java.io.FilegetFileTokenTempFileFromCache(java.lang.String fileToken)voidonEvent(ExternalEvent event)voidonGetFileResponseInternal(GetFileFolderResponseInternal fileResponseInternal)voidonResponse(Response response)voidputCacheRestRequest(int id, io.undertow.server.HttpServerExchange exchange)voidputCacheWebSocketRequest(int id, io.undertow.websockets.core.WebSocketChannel clientSocket)voidputRequestFormatType(int id, WebServer.RequestFormatType requestFormatType)voidremoveClientChannel(io.undertow.websockets.core.WebSocketChannel clientChannel)voidstart()voidstop()
-
-
-
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)
-
-