@Requirement(reqId="DOI_SRV_130",reqName="Cr\u00e9ation d\'un suffixe projet") @Requirement(reqId="DOI_SRV_140",reqName="R\u00e9cup\u00e9ration du nom du projet \u00e0 partir du suffixe projet") @Requirement(reqId="DOI_SRV_150",reqName="Cr\u00e9ation d\'un token") @Requirement(reqId="DOI_SRV_180",reqName="Information sur le token") @Requirement(reqId="DOI_SRV_190",reqName="Visualisation des informations d\'un DOI",coverage=NONE) @Requirement(reqId="DOI_DISPO_020",reqName="V\u00e9rification des landing pages") public final class AdminApplication extends AbstractApplication
Security
--------------
The authentication is done by a simple login/password. Only users having the
group "admin" will be allowed to log in to this application.
The website for creating DOI is opened on the net whereas the others services
are filtered by IP. The allowed IPs are localhost and the IPs defined in
"Starter.admin.IP.allower" attribute from the
configuration file
Routing
--------------
root (DOI creation web form - no authorization)
|
|__ resources (status page - no authorization)
|__ status (Datacite status page - authorization)
|__ stats (Datacite stats page - authorization)
|_ ____________
|_|************|____ suffixProject (Get a random suffix - authorization)
|_|IP_filtering|____ token (Create a token - authorization)
|_|____________|____ token/{tokenID} (Get token information -
authorization)
Creating a project suffix for DOI
,
Creating a token and getting information about a token
Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_URI
URI "/admin" to access to the resources of the system
administration.
|
private static String |
API_CLASSPATH
Location of the resources for the API docs in the classpath.
|
private ClientMDS |
client
ClientMDS
|
static String |
DOIS_URI
URI "/dois" to get dois from a specific project.
|
private static String |
IHM_CLASSPATH
Location of the resources for the IHM in the classpath.
|
private static String |
IHM_CONFIG_URI
URI "/js/config.js" where the configuration file is located.
|
private static String |
IHM_FOOTER_URI
URI "/footer.txt" where the footer file is located.
|
static String |
IHM_URI
URI "/ihm" where the web site is located.
|
private static org.apache.logging.log4j.Logger |
LOG
Logger.
|
static String |
NAME
Application name.
|
private static int |
PERIOD_SCHEDULER
The period between successive executions : 1.
|
private static int |
PERIOD_SCHEDULER_FOR_TOKEN_DB
The period between successive executions :
1.
|
private static TimeUnit |
PERIOD_UNIT
The time unit of the initialDelay and period parameters.
|
static String |
RESOURCE_URI
URI "/resources" to access to the resources of the status page.
|
static String |
ROLE_ADMIN_URI
URI "/roles/admin" to check admin access rights.
|
static String |
ROLE_USERS_URI
URI "/roles/users" to check access rights.
|
static String |
STATS_URI
URI "/stats" to access to Stats page.
|
private static String |
STATUS_PAGE_CLASSPATH
Location of the resources for the status page in the classpath.
|
static String |
STATUS_URI
URI "/status" to access to the status page.
|
static String |
SUFFIX_PROJECT_NAME
URI "/{suffixProject}" to manage a project suffix.
|
static String |
SUFFIX_PROJECT_NAME_TEMPLATE
Project suffix template.
|
static String |
SUFFIX_PROJECT_URI
URI "/projects" to create a project suffix.
|
static String |
SUPERUSERS_URI
URI "/superusers" to handle superusers.
|
private static String |
TARGET_STATS_URL
DataCite Stats page "https://stats.datacite.org/#tab-prefixes".
|
private static String |
TARGET_URL
DataCite Status page "http://status.datacite.org".
|
static String |
TOKEN_NAME_URI
URI "/{tokenID}" to handle to get information from a token.
|
static String |
TOKEN_TEMPLATE
Token template.
|
static String |
TOKEN_URI
URI "/token" to create a token.
|
static String |
USERS_NAME
URI "/{userName}" to handle user.
|
static String |
USERS_NAME_TEMPLATE
Template user.
|
static String |
USERS_URI
URI "/users" to handle users.
|
DEFAULT_CORS_CREDENTIALS, DEFAULT_CORS_ORIGIN
Constructor and Description |
---|
AdminApplication(ClientMDS client)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
addRouteForWebSite(org.restlet.routing.Router router)
Adds default route to the website when it exists.
|
private void |
addServices(org.restlet.routing.Router router,
int redirectorMode,
String target,
String attachURI)
Adds route attacURI to the target according to redirection mode.
|
private void |
addServicesStats(org.restlet.routing.Router router)
Adds route "/stats" to the services giving the DataCite stats.
|
private void |
addServicesStatus(org.restlet.routing.Router router)
Adds route "/status" to the services describing the DataCite
status.
|
private void |
addStatusPage(org.restlet.routing.Router router)
Adds route "/resources" to the status page.
|
private org.restlet.routing.Router |
createAdminRouter()
Creates a router for REST services for the system administration.
|
org.restlet.Restlet |
createInboundRoot()
Creates a router for the AdminApplication.
|
private org.restlet.security.RoleAuthorizer |
createRoleAuthorizer()
Creates a authorization based on the role.
|
private org.restlet.service.TaskService |
createTaskService()
A task checking status of landing pages each 30 days.
|
private org.restlet.service.TaskService |
createUpdateDataBaseTaskService()
A task updating DOI users database from authentication service at each
configurable period of time.
|
private org.restlet.routing.Router |
createWebSiteRouter()
Creates a router for the web site resources.
|
List<String> |
getDois(String idProject)
Returns only the dois within the specified project from the search
result.
|
org.apache.logging.log4j.Logger |
getLog()
Returns the logger.
|
private void |
init()
Defines services and metadata.
|
private org.restlet.service.TaskService |
periodicalyDeleteExpiredTokenFromDB()
A task removing expired tokens in data base each days.
|
createAuthenticator, createAuthenticatorLoginBased, createCoreService, createHtmlRepresentation, createTokenAuthenticator, getConfig, getTokenDB, sendAlertWhenDataCiteFailed
attachToComponent, attachToHost, canDescribe, createFinder, createWadlRepresentation, getApplicationInfo, getBaseRef, getPreferredWadlVariant, getRouter, getWadlVariants, handle, isAutoDescribing, setAutoDescribing, setBaseRef, wadlRepresent, wadlRepresent
createOutboundRoot, getConnectorService, getConnegService, getConverterService, getCurrent, getDecoderService, getEncoderService, getInboundRoot, getMetadataService, getOutboundRoot, getRangeService, getRole, getRoles, getServices, getStatusService, getTaskService, getTunnelService, isDebugging, setConnectorService, setConnegService, setContext, setConverterService, setCurrent, setDebugging, setDecoderService, setEncoderService, setInboundRoot, setInboundRoot, setMetadataService, setOutboundRoot, setOutboundRoot, setRangeService, setRoles, setStatusService, setTaskService, setTunnelService, start, stop
public static final String NAME
public static final String ADMIN_URI
public static final String RESOURCE_URI
public static final String STATUS_URI
public static final String STATS_URI
public static final String ROLE_USERS_URI
public static final String ROLE_ADMIN_URI
public static final String SUFFIX_PROJECT_URI
public static final String SUFFIX_PROJECT_NAME_TEMPLATE
public static final String SUFFIX_PROJECT_NAME
public static final String DOIS_URI
public static final String USERS_URI
public static final String SUPERUSERS_URI
public static final String USERS_NAME_TEMPLATE
public static final String USERS_NAME
public static final String TOKEN_URI
public static final String TOKEN_TEMPLATE
public static final String TOKEN_NAME_URI
public static final String IHM_URI
private static final org.apache.logging.log4j.Logger LOG
private static final String IHM_CONFIG_URI
private static final String IHM_FOOTER_URI
private static final String STATUS_PAGE_CLASSPATH
private static final String IHM_CLASSPATH
private static final String API_CLASSPATH
private static final int PERIOD_SCHEDULER
private static final int PERIOD_SCHEDULER_FOR_TOKEN_DB
private static final TimeUnit PERIOD_UNIT
private static final String TARGET_URL
private static final String TARGET_STATS_URL
private final ClientMDS client
public AdminApplication(ClientMDS client)
client
- Client MDSprivate void init()
@Requirement(reqId="DOI_DISPO_020", reqName="V\u00e9rification des landing pages") private org.restlet.service.TaskService createTaskService()
private org.restlet.service.TaskService periodicalyDeleteExpiredTokenFromDB()
private org.restlet.service.TaskService createUpdateDataBaseTaskService()
public org.restlet.Restlet createInboundRoot()
ADMIN_URI
createInboundRoot
in class org.restlet.Application
the router that contains the
the web resources
,
the router that contains the
REST resources
,
the authentication mechanism
,
the authorization mechanism
private org.restlet.security.RoleAuthorizer createRoleAuthorizer()
RoleAuthorizer.ROLE_ADMIN
are allowedprivate org.restlet.routing.Router createAdminRouter()
SUFFIX_PROJECT_URI
resource to handle the
project suffix, which is used in the Digital Object IdentifierTOKEN_URI
resource to handle the token for
the authenticationResource to handle the the project suffix
,
Resource to handle the token resource
private org.restlet.routing.Router createWebSiteRouter()
RESOURCE_URI
to distribute the web resources
for the status pageIHM_URI
directory when
it is distributed by the DOI server.private void addStatusPage(org.restlet.routing.Router router)
router
- routerprivate void addServices(org.restlet.routing.Router router, int redirectorMode, String target, String attachURI)
router
- routerredirectorMode
- redirection modetarget
- targetattachURI
- attachURIprivate void addServicesStatus(org.restlet.routing.Router router)
router
- routerprivate void addServicesStats(org.restlet.routing.Router router)
router
- routerprivate void addRouteForWebSite(org.restlet.routing.Router router)
router
- routerpublic org.apache.logging.log4j.Logger getLog()
getLog
in class AbstractApplication
public List<String> getDois(String idProject) throws ClientMdsException
idProject
- project IDClientMdsException
- it happens when a problem
happens with DataciteCopyright © 2017–2020 CNES. All rights reserved.