public class SuffixProjectsResource extends AbstractResource
Modifier and Type | Field and Description |
---|---|
private org.apache.logging.log4j.Logger |
LOG
Logger.
|
static int |
NB_DIGITS
Number of digits (6) in which the suffix project is
encoded.
|
static String |
PROJECT_NAME_PARAMETER
Parameter for the project name "projectName".
|
static String |
USER_PARAMETER
Query parameter for user "user".
|
private String |
userName
The user name
|
Constructor and Description |
---|
SuffixProjectsResource() |
Modifier and Type | Method and Description |
---|---|
private void |
checkInputs(org.restlet.data.Form mediaForm)
Tests if the
PROJECT_NAME_PARAMETER is set. |
org.restlet.representation.Representation |
createProject(org.restlet.data.Form mediaForm)
Creates a suffix projet based on the project name.
|
protected void |
describeGet(org.restlet.ext.wadl.MethodInfo info)
Describes a GET method.
|
protected void |
describePost(org.restlet.ext.wadl.MethodInfo info)
Describes a POST method.
|
protected void |
doInit()
Set-up method that can be overridden in order to initialize the state of
the resource.
|
Map<String,Integer> |
getProjectsNameAsJson()
Returns the list of projects as Json or xml format.
|
private org.restlet.ext.wadl.RepresentationInfo |
projectsRepresentation()
projects representation
|
addRequestDocToMethod, addRequestDocToMethod, addRequestDocToMethod, addResponseDocToMethod, createQueryParamDoc, createQueryRepresentationDoc, createResponseDoc, createResponseDoc, createResponseDoc, htmlRepresentation, isObjectExist, isObjectNotExist, isValueExist, isValueNotExist, stringRepresentation
canDescribe, createHtmlRepresentation, createWadlRepresentation, describe, describe, describe, describe, describe, describe, describe, describe, describeDelete, describeMethod, describeMethod, describeOptions, describeParameters, describePatch, describePut, getDescription, getName, getParameter, getParameters, getPreferredWadlVariant, getResourcePath, getResourcesBase, getWadlVariants, isAutoDescribing, options, setAutoDescribing, setDescription, setName
abort, commit, delete, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, get, getAttribute, getInfo, getInfo, getOnSent, getPreferredVariant, getRole, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, patch, patch, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDimensions, setExisting, setLocationRef, setLocationRef, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensions
doError, doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toBoolean, toByte, toDouble, toFloat, toInteger, toLong, toObject, toRepresentation, toRepresentation, toRepresentation, toShort, toString
public static final String PROJECT_NAME_PARAMETER
public static final int NB_DIGITS
public static final String USER_PARAMETER
private volatile org.apache.logging.log4j.Logger LOG
private volatile String userName
protected void doInit() throws org.restlet.resource.ResourceException
doInit
in class AbstractResource
org.restlet.resource.ResourceException
- - if a problem happens@Requirement(reqId="DOI_SRV_140", reqName="R\u00e9cup\u00e9ration du nom du projet \u00e0 partir du suffixe projet") @Get(value="json|xml") public Map<String,Integer> getProjectsNameAsJson()
@Requirement(reqId="DOI_SRV_130", reqName="Cr\u00e9ation d\'un suffixe projet") @Post public org.restlet.representation.Representation createProject(org.restlet.data.Form mediaForm)
PROJECT_NAME_PARAMETER
) in the mediaForm.
When a project suffix is created, a role with the same name is also
automatically created.mediaForm
- submitted formprivate void checkInputs(org.restlet.data.Form mediaForm) throws org.restlet.resource.ResourceException
PROJECT_NAME_PARAMETER
is set.mediaForm
- the parametersorg.restlet.resource.ResourceException
- - if PROJECT_NAME_PARAMETER is not set@Requirement(reqId="DOI_DOC_010", reqName="Documentation des interfaces") private org.restlet.ext.wadl.RepresentationInfo projectsRepresentation()
@Requirement(reqId="DOI_DOC_010", reqName="Documentation des interfaces") protected void describeGet(org.restlet.ext.wadl.MethodInfo info)
describeGet
in class org.restlet.ext.wadl.WadlServerResource
info
- method information@Requirement(reqId="DOI_DOC_010", reqName="Documentation des interfaces") protected void describePost(org.restlet.ext.wadl.MethodInfo info)
describePost
in class org.restlet.ext.wadl.WadlServerResource
info
- method informationCopyright © 2017–2020 CNES. All rights reserved.