Package no.polaric.core.httpd
Class ServerBase
java.lang.Object
no.polaric.core.httpd.ServerBase
- Direct Known Subclasses:
Services
,WsNotifier
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addSubtype
(Class type, String name) Add a subtype to be used in JSON mapper.static String
protected String
clientIpAddr
(io.javalin.http.Context ctx) protected ServerConfig
conf()
Get interface to the server-configstatic Object
deserializeJson
(String text, Class cls) Deserialize object from JSONprotected String
Sanitize text that can be used in HTML output.static Object
Deserialize object from JSONprotected AuthInfo
getAuthInfo
(io.javalin.http.Context ctx) Get info about logged-in user and authorizationprotected String
icon()
protected String
protected void
Protect an URL.protected void
Protect an URL.protected static double
roundDeg
(double x) static String
serializeJson
(Object obj) Serialize object to JSONvoid
systemNotification
(String user, String txt, int ttl) Send a system notification to a user.static String
Serialize object to JSONprotected WebServer
wServer()
Get interface to the web-server
-
Field Details
-
_conf
-
a
protected io.javalin.Javalin a -
_encoding
- See Also:
-
utcTime
-
localTime
-
mapper
protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Constructor Details
-
ServerBase
-
-
Method Details
-
toJson
Serialize object to JSON -
fromJson
Deserialize object from JSON -
serializeJson
Serialize object to JSON -
deserializeJson
Deserialize object from JSON -
addSubtype
Add a subtype to be used in JSON mapper. -
icon
-
conf
Get interface to the server-config -
wServer
Get interface to the web-server -
roundDeg
protected static double roundDeg(double x) -
protect
Protect an URL. Require login and the given authorization level -
protect
Protect an URL. Require login -
getAuthInfo
Get info about logged-in user and authorization- Returns:
- AuthInfo.
-
clientIpAddr
-
systemNotification
Send a system notification to a user. TTL is in minutes -
fixText
Sanitize text that can be used in HTML output. -
cleanPath
-
metaTag
-