CaosDBServer

public class CaosDBServer extends Application

Fields

REQUEST_ERRORS_LOGGER

public static final String REQUEST_ERRORS_LOGGER

REQUEST_TIME_LOGGER

public static final String REQUEST_TIME_LOGGER

Methods

addPostShutdownHook

public static void addPostShutdownHook(Thread t)

Add a shutdown hook which runs after the Restlet Server has been shut down.

addPreShutdownHook

public static void addPreShutdownHook(Runnable runnable)

Add a shutdown hook which runs before the Restlet Server is being shut down.

createInboundRoot

public Restlet createInboundRoot()

Specify the dispatching restlet that maps URIs to their associated resources for processing.

Returns:

A Router restlet that implements dispatching.

getComponent

public static Component getComponent()

getServerInfo

public static ServerInfo getServerInfo()

getServerProperties

public static Properties getServerProperties()

getServerProperty

public static String getServerProperty(String key)

getShiroConfig

public static Ini getShiroConfig()

getTimeZoneFromDate

public static String getTimeZoneFromDate()

initBackend

public static void initBackend()

initCaching

public static void initCaching()

initOneTimeTokens

public static void initOneTimeTokens()

initServerProperties

public static void initServerProperties()

initShiro

public static void initShiro()

initShiro

public static void initShiro(Ini config)

initTimeZone

public static void initTimeZone()

Precedence order:

  1. ServerProperty “TIMEZONE”

  2. JVM property “user.timezone”

  3. Environment variable “TZ”

  4. Output of posix’ “date +%Z”

Throws:

isDebugMode

public static boolean isDebugMode()

main

public static void main(String[] args)

This main method starts up a web application that will listen on a port defined in the config file.

Parameters:
  • args – One option temporarily (for testing) available: silent: If present: disable System.out-stream (stream to a NullPrintStream). This makes the response of the database amazingly faster.

Throws:

scheduleJob

public static void scheduleJob(JobDetail job, Trigger trigger)

setProperty

public static void setProperty(String key, String value)

Set a server property to a new value. This might not have an immediate effect if classes did already read an older configuration and stick to that.

Parameters:
  • key, – the server property.

  • value, – the new value.

useCache

public static boolean useCache()