public class DoiServer
extends org.restlet.Component
Modifier and Type | Field and Description |
---|---|
static String |
CITATION_URI
URI of the Citation application.
|
static String |
DEFAULT_MAX_CONNECTIONS_PER_HOST
Default number for RESTLET_MAX_CONNECTIONS_PER_HOST.
|
static String |
DEFAULT_MAX_TOTAL_CONNECTIONS
Default number for RESTLET_MAX_TOTAL_CONNECTIONS.
|
static String |
DEFAULT_SSL_CTX
Default value for
SSL_CTX_FACTORY parameter :
"org.restlet.engine.ssl.DefaultSslContextFactory". |
static String |
JKS_DIRECTORY
Directory "jks".
|
static String |
JKS_FILE
JKS file, which is stored in the JAR.
|
static String |
KEY_PWD
Key password parameter "keyPassword".
|
static String |
KEY_STORE_PATH
Key store parameter "keyStorePath".
|
static String |
KEY_STORE_PWD
Key store password parameter "keyStorePassword".
|
static String |
KEY_STORE_TYPE
Key store type parameter "keyStoreType".
|
private static org.apache.logging.log4j.Logger |
LOG
Logger.
|
static String |
MDS_URI
URI of the Meta Data Store application.
|
private static String |
MESSAGE_TPL
Template message "{} : {}".
|
private static String |
PARAMETERS
Text to display "Parameters" in log messages.
|
static String |
RESTLET_MAX_CONNECTIONS_PER_HOST
Number connections per host.
|
static String |
RESTLET_MAX_TOTAL_CONNECTIONS
Number total connections.
|
private DoiSettings |
settings
Configuration.
|
static String |
SSL_CTX_FACTORY
SslContectFactory parameter "sslContextFactory".
|
static String |
STATUS_URI
URI of the Datacite status.
|
static String |
TRUST_STORE_PATH
Trust store path parameter "trustStorePath".
|
static String |
TRUST_STORE_PWD
Trust store password parameter "trustStorePath".
|
static String |
TRUST_STORE_TYPE
Trust store type parameter "trustStorePath".
|
Constructor and Description |
---|
DoiServer(DoiSettings settings)
Creates an instance of the server with settings coming from the
config.properties
|
Modifier and Type | Method and Description |
---|---|
private void |
addAuthenticationUserAsAdmin(String username)
Adds an authentication system user as administrator of the DOI server
|
private void |
configureServer()
Configures the Server in HTTP and HTTPS.
|
private String |
extractKeyStoreToPath()
Extracts keystore for JAR and copy it in a directory in order to use it.
|
private void |
initAttachApplication()
Routes the applications.
|
private void |
initClients()
Inits supported protocols.
|
private boolean |
initHttpServer()
Inits the HTTP server.
|
private boolean |
initHttpsServer()
Inits the HTTPS server.
|
private void |
initJettyConfiguration(org.restlet.Server server)
Init the Jetty configuration and applies it to the server.
|
private void |
initLogServices()
Init log services.
|
void |
start() |
private org.restlet.Server |
startHttpServer(Integer port)
Creates a HTTP server
|
private org.restlet.Server |
startHttpsServer(Integer port)
Creates a HTTPS server
|
private void |
startWithProxy()
Starts with proxy.
|
void |
stop() |
getClients, getDefaultHost, getHosts, getInternalRouter, getLogService, getRealm, getRealms, getServers, getServices, getStatusService, getTaskService, handle, main, setClients, setContext, setDefaultHost, setHosts, setInternalRouter, setLogService, setRealms, setServers, setStatusService, setTaskService, startClients, startHelper, startRealms, startRouters, startServers, startServices, stopClients, stopHelper, stopRealms, stopRouters, stopServers, stopServices, updateHosts
public static final String DEFAULT_SSL_CTX
SSL_CTX_FACTORY
parameter :
"org.restlet.engine.ssl.DefaultSslContextFactory".public static final String SSL_CTX_FACTORY
public static final String KEY_STORE_PATH
public static final String KEY_STORE_PWD
public static final String KEY_STORE_TYPE
public static final String KEY_PWD
public static final String TRUST_STORE_PATH
public static final String TRUST_STORE_PWD
public static final String TRUST_STORE_TYPE
public static final String JKS_FILE
public static final String JKS_DIRECTORY
public static final String MDS_URI
public static final String CITATION_URI
public static final String STATUS_URI
public static final String RESTLET_MAX_TOTAL_CONNECTIONS
public static final String RESTLET_MAX_CONNECTIONS_PER_HOST
public static final String DEFAULT_MAX_TOTAL_CONNECTIONS
public static final String DEFAULT_MAX_CONNECTIONS_PER_HOST
private static final org.apache.logging.log4j.Logger LOG
private static final String MESSAGE_TPL
private static final String PARAMETERS
private final DoiSettings settings
public DoiServer(DoiSettings settings) throws ClientMdsException
settings
- settingsClientMdsException
- It happens when the server
cannot access to Datacite accountprivate void initLogServices()
@Requirement(reqId="DOI_ARCHI_010", reqName="Protocole HTTP et HTTPS pour les API") private void configureServer() throws ClientMdsException
ClientMdsException
private boolean initHttpServer()
private boolean initHttpsServer()
private void initJettyConfiguration(org.restlet.Server server)
server
- HTTP or HTTPS serverprivate void initClients()
private void initAttachApplication() throws ClientMdsException
ClientMdsException
private void addAuthenticationUserAsAdmin(String username)
username
- usernameprivate void startWithProxy() throws ClientMdsException
ClientMdsException
private org.restlet.Server startHttpServer(Integer port)
port
- HTTP portprivate org.restlet.Server startHttpsServer(Integer port)
port
- HTTPS portprivate String extractKeyStoreToPath()
public void start() throws Exception
start
in class org.restlet.Component
Exception
Copyright © 2017–2020 CNES. All rights reserved.