[UWS,TAP] Review the standard parameters checking. Particularly, because...
[UWS,TAP] Review the standard parameters checking. Particularly, because before, the default value was never used while no value was specified by the user.
@@ -91,7 +103,7 @@ public class MaxRecController implements InputParamController {
publicObjectcheck(Objectvalue)throwsUWSException{
// If no limit is provided by the TAP client, none is returned:
if(value==null)
returnnull;
returngetDefault();
// Parse the provided limit:
intmaxOutputLimit=getMaxOutputLimit();
@@ -109,11 +121,11 @@ public class MaxRecController implements InputParamController {
thrownewUWSException(UWSException.INTERNAL_SERVER_ERROR,"Wrong type for the parameter \"maxrec\": class \""+value.getClass().getName()+"\"! It should be an integer or a string containing only an integer value.");
// A negative output limit is considered as an unlimited output limit:
if(maxRec<TAPJob.UNLIMITED_MAX_REC)
if(maxRec<0)
maxRec=TAPJob.UNLIMITED_MAX_REC;
// If the limit is greater than the maximum one, an exception is thrown:
// If no maximum period is specified or if an exception occurs, NULL must be returned:
returnnull;
}
@Override
publicObjectcheck(Objectvalue)throwsUWSException{
// If NULL value, return the default value:
if(value==null)
returnnull;
returngetDefault();
// Parse the given date:
Datedate=null;
if(valueinstanceofDate)
date=(Date)value;
@@ -154,10 +171,12 @@ public class TAPDestructionTimeController implements InputParamController {
}else
thrownewUWSException(UWSException.INTERNAL_SERVER_ERROR,"Wrong type for the parameter \"destruction\": class \""+value.getClass().getName()+"\"! It should be a Date or a string containing a date formatted in ISO8601 (\"yyyy-MM-dd'T'hh:mm:ss[.sss]['Z'|[+|-]hh:mm]\", fields inside brackets are optional).");
// Ensure the date is before the maximum destruction time (from now):
DatemaxDate=getMaxDestructionTime();
if(maxDate!=null&&date.after(maxDate))
thrownewUWSException(UWSException.BAD_REQUEST,"The TAP service limits the destruction interval (since now) to "+getMaxRetentionPeriod()+" s !");