Package de.kosmos_lab.web.server
Class ExampleWebServer
- java.lang.Object
-
- de.kosmos_lab.web.server.WebServer
-
- de.kosmos_lab.web.server.ExampleWebServer
-
- All Implemented Interfaces:
ControllerWithPersistence
public abstract class ExampleWebServer extends WebServer implements ControllerWithPersistence
-
-
Field Summary
-
Fields inherited from class de.kosmos_lab.web.server.WebServer
context, DEFAULT_CONFIG, DEFAULT_PORT, handlers, loadedServlets, logger, paths, port, servclasses, server, servlets, STATUS_CONFLICT, STATUS_DUPLICATE, STATUS_ERROR, STATUS_FAILED, STATUS_FORBIDDEN, STATUS_METHOD_NOT_ALLOWED, STATUS_MISSING_VALUE, STATUS_NO_AUTH, STATUS_NO_RESPONSE, STATUS_NOT_FOUND, STATUS_OK, STATUS_UNPROCESSABLE, STATUS_VALIDATION_FAILED, stopped, wssclasses, wsservices
-
-
Constructor Summary
Constructors Constructor Description ExampleWebServer()ExampleWebServer(File configFile, boolean testing)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddJWT(String jwtid, org.json.JSONObject o)voidaddPersistence(IPersistence p)voidaddPersistence(IPersistence perstistence, Class<?> clazz)voidaddUUID(UUID uuid, Object object)IPersistencecreatePersistence(org.json.JSONObject config)UUIDgenerateUUID()ObjectgetByUUID(UUID uuid)org.json.JSONObjectgetConfig()ClassgetDefaultPersistenceClass()StringgetDefaultStorage()JWTgetJwt()<T> TgetPersistence(Class<T> clazz)StringhashPepper(String input)StringhashSaltPepper(String input, String salt)abstract voidinit(org.json.JSONObject config)booleanisKnownJWTID(String jwtid)voidprepare()org.json.JSONObjectreadConfig()abstract voidsanitizeConfig(org.json.JSONObject jsonConfig)voidstop()-
Methods inherited from class de.kosmos_lab.web.server.WebServer
addStaticFile, createServlet, createWebSocketService, findServlets, getDefaultConfig, getDefaultPort, getPort, isStopped, start
-
-
-
-
Method Detail
-
readConfig
public org.json.JSONObject readConfig()
- Overrides:
readConfigin classWebServer
-
addJWT
public void addJWT(String jwtid, org.json.JSONObject o) throws NoPersistenceException
- Specified by:
addJWTin interfaceControllerWithPersistence- Throws:
NoPersistenceException
-
addPersistence
public void addPersistence(IPersistence perstistence, Class<?> clazz)
- Specified by:
addPersistencein interfaceControllerWithPersistence
-
addPersistence
public void addPersistence(IPersistence p)
- Specified by:
addPersistencein interfaceControllerWithPersistence
-
addUUID
public void addUUID(UUID uuid, Object object)
- Specified by:
addUUIDin interfaceControllerWithPersistence
-
createPersistence
public IPersistence createPersistence(org.json.JSONObject config)
- Specified by:
createPersistencein interfaceControllerWithPersistence
-
generateUUID
public UUID generateUUID()
- Specified by:
generateUUIDin interfaceControllerWithPersistence
-
getByUUID
public Object getByUUID(UUID uuid)
- Specified by:
getByUUIDin interfaceControllerWithPersistence
-
getDefaultPersistenceClass
public Class getDefaultPersistenceClass()
- Specified by:
getDefaultPersistenceClassin interfaceControllerWithPersistence
-
getJwt
public JWT getJwt()
- Specified by:
getJwtin interfaceControllerWithPersistence
-
getPersistence
public <T> T getPersistence(Class<T> clazz) throws NoPersistenceException
- Specified by:
getPersistencein interfaceControllerWithPersistence- Throws:
NoPersistenceException
-
hashPepper
public String hashPepper(String input)
- Specified by:
hashPepperin interfaceControllerWithPersistence
-
hashSaltPepper
public String hashSaltPepper(String input, String salt)
- Specified by:
hashSaltPepperin interfaceControllerWithPersistence
-
init
public abstract void init(org.json.JSONObject config)
-
isKnownJWTID
public boolean isKnownJWTID(String jwtid)
- Specified by:
isKnownJWTIDin interfaceControllerWithPersistence
-
sanitizeConfig
public abstract void sanitizeConfig(org.json.JSONObject jsonConfig)
-
getDefaultStorage
public String getDefaultStorage()
-
-