public class TAPParameters extends UWSParameters
Modifier and Type | Field and Description |
---|---|
protected static java.util.List<java.lang.String> |
TAP_PARAMETERS
All the TAP parameters.
|
expectedAdditionalParams, files, mapParamControllers, params, UWS_RO_PARAMETERS, UWS_RW_PARAMETERS, UWS_RW_PARAMETERS_REGEXP
Constructor and Description |
---|
TAPParameters(javax.servlet.http.HttpServletRequest request,
ServiceConnection service)
Create a
TAPParameters instance whose the parameters must be extracted from the given HttpServletRequest . |
TAPParameters(javax.servlet.http.HttpServletRequest request,
ServiceConnection service,
java.util.Map<java.lang.String,InputParamController> controllers)
Create a
TAPParameters instance whose the parameters must be extracted from the given HttpServletRequest . |
TAPParameters(ServiceConnection service)
Create an empty list of parameters.
|
TAPParameters(ServiceConnection service,
java.util.Map<java.lang.String,java.lang.Object> params)
Create a
TAPParameters instance whose the parameters are given in parameter. |
TAPParameters(ServiceConnection service,
java.util.Map<java.lang.String,java.lang.Object> params,
java.util.Map<java.lang.String,InputParamController> controllers)
Create a
TAPParameters instance whose the parameters are given in parameter. |
Modifier and Type | Method and Description |
---|---|
protected static java.util.Map<java.lang.String,InputParamController> |
buildDefaultControllers(ServiceConnection service,
java.util.Map<java.lang.String,InputParamController> customControllers)
Build a map containing all controllers for all standard TAP parameters.
|
void |
check()
Check the coherence between all TAP parameters.
|
java.lang.String |
getFormat()
Get the value of the standard TAP parameter "FORMAT".
|
java.lang.String |
getLang()
Get the value of the standard TAP parameter "LANG".
|
java.lang.Integer |
getMaxRec()
Get the value of the standard TAP parameter "MAX_REC".
|
java.lang.String |
getQuery()
Get the value of the standard TAP parameter "QUERY".
|
java.lang.String |
getRequest()
Get the value of the standard TAP parameter "REQUEST".
|
protected java.lang.String |
getStringParam(java.lang.String paramName)
Get the value of the given parameter, but as a String, whatever is its original type.
|
java.lang.String |
getUpload()
Get the value of the standard TAP parameter "UPLOAD".
|
DALIUpload[] |
getUploadedTables()
Get the list of all tables uploaded and defined by the standard TAP parameter "UPLOAD".
|
java.lang.String |
getVersion()
Get the value of the standard TAP parameter "VERSION".
|
get, getAdditionalParameters, getController, getControllers, getDefaultControllers, getDestructionTime, getExecutionDuration, getFiles, getInputPhase, getNames, getParameters, getRunId, hasInputPhase, init, isEmpty, iterator, normalizeParamName, remove, set, size, update
protected static final java.util.List<java.lang.String> TAP_PARAMETERS
public TAPParameters(ServiceConnection service)
service
- Description of the TAP service in which the parameters are created and will be used.public TAPParameters(javax.servlet.http.HttpServletRequest request, ServiceConnection service) throws TAPException
TAPParameters
instance whose the parameters must be extracted from the given HttpServletRequest
.request
- HTTP request containing the parameters to gather inside this class.service
- Description of the TAP service in which the parameters are created and will be used.TAPException
- If any error occurs while extracting the DALIParameters OR while setting a parameter.UWSParameters.getParameters(HttpServletRequest)
public TAPParameters(javax.servlet.http.HttpServletRequest request, ServiceConnection service, java.util.Map<java.lang.String,InputParamController> controllers) throws TAPException
TAPParameters
instance whose the parameters must be extracted from the given HttpServletRequest
.request
- HTTP request containing the parameters to gather inside this class.service
- Description of the TAP service in which the parameters are created and will be used.controllers
- Additional/Replacing controllers to apply on some input parameters.
Ignored if NULL
.TAPException
- If any error occurs while extracting the DALIParameters OR while setting a parameter.UWSParameters.getParameters(HttpServletRequest)
public TAPParameters(ServiceConnection service, java.util.Map<java.lang.String,java.lang.Object> params) throws TAPException
TAPParameters
instance whose the parameters are given in parameter.service
- Description of the TAP service. Limits of the standard TAP parameters are listed in it.params
- List of parameters to load inside this object.TAPException
- If any error occurs while extracting the DALIParameters OR while setting a parameter.TAPParameters(ServiceConnection, Map, Map)
public TAPParameters(ServiceConnection service, java.util.Map<java.lang.String,java.lang.Object> params, java.util.Map<java.lang.String,InputParamController> controllers) throws TAPException
TAPParameters
instance whose the parameters are given in parameter.service
- Description of the TAP service. Limits of the standard TAP parameters are listed in it.params
- List of parameters to load inside this object.controllers
- Additional/Replacing controllers to apply on some input parameters.
Ignored if NULL
.TAPException
- If any error occurs while extracting the DALIParameters OR while setting a parameter.protected static final java.util.Map<java.lang.String,InputParamController> buildDefaultControllers(ServiceConnection service, java.util.Map<java.lang.String,InputParamController> customControllers)
Build a map containing all controllers for all standard TAP parameters.
Note: All standard parameters, except UPLOAD. Indeed, since this parameter can be provided in several times (in one HTTP request) and needs to be interpreted immediately after initialization, no controller has been set for it. Its value will be actually tested in the constructor while interpreting it.
service
- Description of the TAP service.customControllers
- Additional/Replacing controllers to apply on some input parameters.
Ignored if NULL
.protected final java.lang.String getStringParam(java.lang.String paramName)
Get the value of the given parameter, but as a String, whatever is its original type.
Basically, the different cases of conversion into String are the following:
paramName
- Name of the parameter whose the value must be returned as a String.public final java.lang.String getRequest()
public final java.lang.String getLang()
public final java.lang.String getVersion()
public final java.lang.String getFormat()
public final java.lang.String getQuery()
public final java.lang.String getUpload()
Get the value of the standard TAP parameter "UPLOAD".
Note: This parameter is generally a set of several Strings, each representing one table to upload. This function returns this set as a String in which each items are joined, semicolon separated, inside a single String.
public final DALIUpload[] getUploadedTables()
public final java.lang.Integer getMaxRec()
public void check() throws TAPException
Check the coherence between all TAP parameters.
This function does not test individually each parameters, but all of them as a coherent whole. Thus, the parameter REQUEST must be provided and if its value is "doQuery", the parameters LANG and QUERY must be also provided.
TAPException
- If one required parameter is missing.