From 5673597f3275644cb2edc192f3a3c7c5845d9220 Mon Sep 17 00:00:00 2001 From: gmantele <gmantele@ari.uni-heidelberg.de> Date: Wed, 22 Apr 2015 19:08:42 +0200 Subject: [PATCH] [ALL] Update Javadoc links and UWSService description --- src/adql/db/DBChecker.java | 7 +- src/adql/db/STCS.java | 2 - .../operand/function/UserDefinedFunction.java | 2 +- src/adql/translator/JDBCTranslator.java | 2 +- src/tap/ADQLExecutor.java | 2 +- src/tap/AbstractTAPFactory.java | 2 +- src/tap/ServiceConnection.java | 7 +- src/tap/TAPFactory.java | 3 +- src/tap/TAPSyncJob.java | 4 +- src/tap/config/ConfigurableTAPFactory.java | 4 +- src/tap/config/ConfigurableTAPServlet.java | 4 +- src/tap/config/TAPConfiguration.java | 14 +- src/tap/data/LimitedTableIterator.java | 2 +- src/tap/data/ResultSetTableIterator.java | 38 ++-- src/tap/data/VOTableIterator.java | 5 +- src/tap/db/DBConnection.java | 8 +- src/tap/db/JDBCConnection.java | 56 +++--- src/tap/formatter/JSONFormat.java | 2 +- src/tap/formatter/SVFormat.java | 12 +- src/tap/formatter/TextFormat.java | 5 +- src/tap/formatter/VOTableFormat.java | 8 +- src/tap/log/DefaultTAPLog.java | 8 +- src/tap/metadata/TAPColumn.java | 4 - src/tap/metadata/TAPMetadata.java | 4 +- src/tap/metadata/TAPSchema.java | 6 +- src/tap/metadata/TableSetParser.java | 2 +- src/tap/parameters/DALIUpload.java | 6 +- src/tap/parameters/FormatController.java | 2 +- .../TAPDestructionTimeController.java | 2 +- .../TAPExecutionDurationController.java | 2 +- src/tap/parameters/TAPParameters.java | 2 +- src/tap/resource/TAP.java | 16 +- src/uws/ISO8601Format.java | 2 +- src/uws/UWSToolBox.java | 8 +- src/uws/job/JobList.java | 12 +- src/uws/job/JobThread.java | 31 ++- src/uws/job/Result.java | 4 +- src/uws/job/SerializableUWSObject.java | 8 +- src/uws/job/UWSJob.java | 38 ++-- .../AbstractQueuedExecutionManager.java | 6 +- src/uws/job/parameters/UWSParameters.java | 29 ++- src/uws/job/serializer/UWSSerializer.java | 3 +- src/uws/service/UWS.java | 4 +- src/uws/service/UWSFactory.java | 2 +- src/uws/service/UWSService.java | 188 +++++++----------- src/uws/service/UWSServlet.java | 42 ++-- src/uws/service/UserIdentifier.java | 12 +- src/uws/service/actions/AddJob.java | 5 +- src/uws/service/actions/DestroyJob.java | 4 +- src/uws/service/actions/GetJobParam.java | 6 +- src/uws/service/actions/JobSummary.java | 6 +- src/uws/service/actions/ListJobs.java | 6 +- src/uws/service/actions/SetJobParam.java | 12 +- src/uws/service/actions/SetUWSParameter.java | 4 +- src/uws/service/actions/ShowHomePage.java | 4 +- src/uws/service/actions/UWSAction.java | 13 +- .../backup/DefaultUWSBackupManager.java | 9 +- src/uws/service/backup/UWSBackupManager.java | 2 +- .../service/error/DefaultUWSErrorWriter.java | 10 +- src/uws/service/error/ServiceErrorWriter.java | 4 +- src/uws/service/file/LocalUWSFileManager.java | 4 +- src/uws/service/log/DefaultUWSLog.java | 10 +- src/uws/service/log/UWSLog.java | 8 +- src/uws/service/request/UploadFile.java | 2 +- 64 files changed, 332 insertions(+), 409 deletions(-) diff --git a/src/adql/db/DBChecker.java b/src/adql/db/DBChecker.java index 31f1b16..14d8bba 100644 --- a/src/adql/db/DBChecker.java +++ b/src/adql/db/DBChecker.java @@ -991,7 +991,7 @@ public class DBChecker implements QueryChecker { * @param errors List of errors to complete in this function each time a coordinate system has a wrong syntax or is not supported. * * @see STCS#parseCoordSys(String) - * @see #checkCoordinateSystem(CoordSys, ADQLOperand, UnresolvedIdentifiersException) + * @see #checkCoordinateSystem(adql.db.STCS.CoordSys, ADQLOperand, UnresolvedIdentifiersException) * * @since 1.3 */ @@ -1034,7 +1034,7 @@ public class DBChecker implements QueryChecker { * @param errors List of errors to complete in this function each time the STC-S syntax is wrong or each time the declared coordinate system or region is not supported. * * @see STCS#parseRegion(String) - * @see #checkRegion(Region, RegionFunction, BinarySearch, UnresolvedIdentifiersException) + * @see #checkRegion(adql.db.STCS.Region, RegionFunction, BinarySearch, UnresolvedIdentifiersException) * * @since 1.3 */ @@ -1076,8 +1076,9 @@ public class DBChecker implements QueryChecker { * @param fct The REGION function containing the region to check. * @param errors List of errors to complete in this function if the given region or its inner regions are not supported. * - * @see #checkCoordinateSystem(CoordSys, ADQLOperand, UnresolvedIdentifiersException) + * @see #checkCoordinateSystem(adql.db.STCS.CoordSys, ADQLOperand, UnresolvedIdentifiersException) * @see #checkGeometryFunction(String, ADQLFunction, BinarySearch, UnresolvedIdentifiersException) + * @see #checkRegion(adql.db.STCS.Region, RegionFunction, BinarySearch, UnresolvedIdentifiersException) * * @since 1.3 */ diff --git a/src/adql/db/STCS.java b/src/adql/db/STCS.java index 55f4bd4..716ef58 100644 --- a/src/adql/db/STCS.java +++ b/src/adql/db/STCS.java @@ -1219,8 +1219,6 @@ public final class STCS { * @return The corresponding STC-S expression. * * @throws ParseException If the given object is NULL or not of the good type. - * - * @see {@link Region#Region(GeometryFunction)} */ public static String toSTCS(final GeometryFunction region) throws ParseException{ if (region == null) diff --git a/src/adql/query/operand/function/UserDefinedFunction.java b/src/adql/query/operand/function/UserDefinedFunction.java index f817832..53c2474 100644 --- a/src/adql/query/operand/function/UserDefinedFunction.java +++ b/src/adql/query/operand/function/UserDefinedFunction.java @@ -51,7 +51,7 @@ public abstract class UserDefinedFunction extends ADQLFunction implements Unknow /** * <p>Translate this User Defined Function into the language supported by the given translator.</p> * - * <p><b>VERY IMPORTANT:</b> This function <b>MUST NOT use</b> {@link ADQLTranslator#translate(UserDefinedFunction))} to translate itself. + * <p><b>VERY IMPORTANT:</b> This function <b>MUST NOT use</b> {@link ADQLTranslator#translate(UserDefinedFunction)} to translate itself. * The given {@link ADQLTranslator} <b>must be used ONLY</b> to translate UDF's operands.</p> * * <p>Implementation example (extract of {@link DefaultUDF#translate(ADQLTranslator)}):</p> diff --git a/src/adql/translator/JDBCTranslator.java b/src/adql/translator/JDBCTranslator.java index 4451dcc..d97b4c5 100644 --- a/src/adql/translator/JDBCTranslator.java +++ b/src/adql/translator/JDBCTranslator.java @@ -897,7 +897,7 @@ public abstract class JDBCTranslator implements ADQLTranslator { * If the given region is NULL, NULL will be returned. * </i></p> * - * @param stcs The region to store in the DB. + * @param region The region to store in the DB. * * @return The corresponding DB column object. * diff --git a/src/tap/ADQLExecutor.java b/src/tap/ADQLExecutor.java index f467013..27ec125 100644 --- a/src/tap/ADQLExecutor.java +++ b/src/tap/ADQLExecutor.java @@ -554,7 +554,7 @@ public class ADQLExecutor { * @throws InterruptedException If the thread has been interrupted. * @throws TAPException If the {@link DBConnection} has failed to deal with the given ADQL query. * - * @see {@link DBConnection#executeQuery(ADQLQuery)} + * @see DBConnection#executeQuery(ADQLQuery) */ protected TableIterator executeADQL(final ADQLQuery adql) throws InterruptedException, TAPException{ // Log the start of execution: diff --git a/src/tap/AbstractTAPFactory.java b/src/tap/AbstractTAPFactory.java index 74ac601..624b386 100644 --- a/src/tap/AbstractTAPFactory.java +++ b/src/tap/AbstractTAPFactory.java @@ -86,7 +86,7 @@ public abstract class AbstractTAPFactory extends TAPFactory { * * @throws NullPointerException If the given {@link ServiceConnection} is NULL. * - * @see {@link TAPFactory#TAPFactory(ServiceConnection)} + * @see TAPFactory#TAPFactory(ServiceConnection) */ protected AbstractTAPFactory(final ServiceConnection service, final ServiceErrorWriter errorWriter) throws NullPointerException{ super(service); diff --git a/src/tap/ServiceConnection.java b/src/tap/ServiceConnection.java index 1a6571e..dfa9473 100644 --- a/src/tap/ServiceConnection.java +++ b/src/tap/ServiceConnection.java @@ -114,7 +114,7 @@ public interface ServiceConnection { * * @throws TAPException If the two given units are not compatible. * - * @see #isCompatibleWith(LimitUnit) + * @see tap.ServiceConnection.LimitUnit#isCompatibleWith(tap.ServiceConnection.LimitUnit) * @see #bytesFactor() * @see Integer#compare(int, int) * @see Long#compare(long, long) @@ -604,8 +604,9 @@ public interface ServiceConnection { * * <p><i>Piece of advice: * The {@link TAPFactory} is an interface which contains a lot of functions to implement. - * It is rather recommended to extend {@link AbstractTAPFactory}: just 3 functions ({@link AbstractTAPFactory#countFreeConnections()}, - * {@link AbstractTAPFactory#freeConnection()}, {@link AbstractTAPFactory#getConnection(String)}) will have to be implemented. + * It is rather recommended to extend {@link AbstractTAPFactory}: just 2 functions + * ({@link AbstractTAPFactory#freeConnection(DBConnection)} and {@link AbstractTAPFactory#getConnection(String)}) + * will have to be implemented. * </i></p> * * @return An instance of {@link TAPFactory}. diff --git a/src/tap/TAPFactory.java b/src/tap/TAPFactory.java index 19624ff..f4f6b7a 100644 --- a/src/tap/TAPFactory.java +++ b/src/tap/TAPFactory.java @@ -362,7 +362,7 @@ public abstract class TAPFactory implements UWSFactory { * A default implementation is provided in {@link AbstractTAPFactory}. * </i></p> * - * @param jobID ID of the job (NOT NULL). + * @param jobId ID of the job (NOT NULL). * @param owner Owner of the job. * @param params List of all input job parameters. * @param quote Its quote (in seconds). @@ -409,7 +409,6 @@ public abstract class TAPFactory implements UWSFactory { * that the returned object is always a {@link TAPParameters}. * </p> * - * @see uws.service.AbstractUWSFactory#extractParameters(javax.servlet.http.HttpServletRequest, uws.service.UWS) * @see #createTAPParameters(HttpServletRequest) */ @Override diff --git a/src/tap/TAPSyncJob.java b/src/tap/TAPSyncJob.java index 7b65a01..01421a3 100644 --- a/src/tap/TAPSyncJob.java +++ b/src/tap/TAPSyncJob.java @@ -105,8 +105,8 @@ public class TAPSyncJob { * * <p><i><b>By default:</b> "S"+System.currentTimeMillis()+UpperCharacter (UpperCharacter: one upper-case character: A, B, C, ....)</i></p> * - * <p><i><u>note: </u> DO NOT USE in this function any of the following functions: {@link #getLogger()}, - * {@link #getFileManager()} and {@link #getFactory()}. All of them will return NULL, because this job does not + * <p><i><u>note: </u> DO NOT USE in this function any of the following functions: {@link ServiceConnection#getLogger()}, + * {@link ServiceConnection#getFileManager()} and {@link ServiceConnection#getFactory()}. All of them will return NULL, because this job does not * yet know its jobs list (which is needed to know the UWS and so, all of the objects returned by these functions).</i></p> * * @return A unique job identifier. diff --git a/src/tap/config/ConfigurableTAPFactory.java b/src/tap/config/ConfigurableTAPFactory.java index 66385d8..02432f7 100644 --- a/src/tap/config/ConfigurableTAPFactory.java +++ b/src/tap/config/ConfigurableTAPFactory.java @@ -263,8 +263,8 @@ public final class ConfigurableTAPFactory extends AbstractTAPFactory { * Build a {@link JDBCConnection} thanks to the database parameters specified * in the TAP configuration file (the properties: jdbc_driver_path, db_url, db_user, db_password). * - * @see tap.TAPFactory#createDBConnection(java.lang.String) - * @see JDBCConnection + * @see JDBCConnection#JDBCConnection(java.sql.Connection, JDBCTranslator, String, tap.log.TAPLog) + * @see JDBCConnection#JDBCConnection(String, String, String, String, JDBCTranslator, String, tap.log.TAPLog) */ @Override public DBConnection getConnection(String jobID) throws TAPException{ diff --git a/src/tap/config/ConfigurableTAPServlet.java b/src/tap/config/ConfigurableTAPServlet.java index 7ea593b..83f217d 100644 --- a/src/tap/config/ConfigurableTAPServlet.java +++ b/src/tap/config/ConfigurableTAPServlet.java @@ -50,8 +50,8 @@ import tap.resource.TAPResource; * <p>HTTP servlet fully configured with a TAP configuration file.</p> * * <p> - * This configuration file may be specified in the initial parameter named {@value TAPConfiguration#TAP_CONF_PARAMETER} - * of this servlet inside the WEB-INF/web.xml file. If none is specified, the file {@value TAPConfiguration#DEFAULT_TAP_CONF_FILE} + * This configuration file may be specified in the initial parameter named {@link TAPConfiguration#TAP_CONF_PARAMETER} + * of this servlet inside the WEB-INF/web.xml file. If none is specified, the file {@link TAPConfiguration#DEFAULT_TAP_CONF_FILE} * will be searched inside the directories of the classpath, and inside WEB-INF and META-INF. * </p> * diff --git a/src/tap/config/TAPConfiguration.java b/src/tap/config/TAPConfiguration.java index 5b355c7..11934ed 100644 --- a/src/tap/config/TAPConfiguration.java +++ b/src/tap/config/TAPConfiguration.java @@ -325,7 +325,7 @@ public final class TAPConfiguration { * * @throws TAPException If the class name is incorrect or if its type is not compatible with the parameterized type C (represented by the parameter "expectedType"). * - * @see {@link #isClassName(String)} + * @see #isClassName(String) */ @SuppressWarnings("unchecked") public final static < C > Class<? extends C> fetchClass(final String value, final String propertyName, final Class<C> expectedType) throws TAPException{ @@ -354,8 +354,8 @@ public final class TAPConfiguration { * * <p>The instance is created using the empty constructor of the specified class.</p> * - * @param value Value which is supposed to contain the class name between brackets (see {@link #isClassName(String)} for more details) - * @param propertyName Name of the property associated with the parameter "value". + * @param propValue Value which is supposed to contain the class name between brackets (see {@link #isClassName(String)} for more details) + * @param propName Name of the property associated with the parameter "value". * @param expectedType Type of the class expected to be returned ; it is also the type which parameterizes this function: C. * * @return The corresponding instance. @@ -365,7 +365,7 @@ public final class TAPConfiguration { * or if the specified class has no empty constructor * or if an error occurred while calling this constructor. * - * @see {@link #isClassName(String)} + * @see #isClassName(String) * @see #fetchClass(String, String, Class) */ public final static < C > C newInstance(final String propValue, final String propName, final Class<C> expectedType) throws TAPException{ @@ -380,8 +380,8 @@ public final class TAPConfiguration { * The number and types of given parameters MUST match exactly to the list of parameter types. * </p> * - * @param value Value which is supposed to contain the class name between brackets (see {@link #isClassName(String)} for more details) - * @param propertyName Name of the property associated with the parameter "value". + * @param propValue Value which is supposed to contain the class name between brackets (see {@link #isClassName(String)} for more details) + * @param propName Name of the property associated with the parameter "value". * @param expectedType Type of the class expected to be returned ; it is also the type which parameterizes this function: C. * @param pTypes List of each constructor parameter type. Each type MUST be exactly the type declared in the class constructor to select. <i>NULL or empty array if no parameter.</i> * @param parameters List of all constructor parameters. The number of object MUST match exactly the number of classes provided in the parameter pTypes. <i>NULL or empty array if no parameter.</i> @@ -393,7 +393,7 @@ public final class TAPConfiguration { * or if the constructor with the specified parameters can not be found * or if an error occurred while calling this constructor. * - * @see {@link #isClassName(String)} + * @see #isClassName(String) * @see #fetchClass(String, String, Class) */ public final static < C > C newInstance(final String propValue, final String propName, final Class<C> expectedType, final Class<?>[] pTypes, final Object[] parameters) throws TAPException{ diff --git a/src/tap/data/LimitedTableIterator.java b/src/tap/data/LimitedTableIterator.java index a5b9c64..9a98d94 100644 --- a/src/tap/data/LimitedTableIterator.java +++ b/src/tap/data/LimitedTableIterator.java @@ -76,7 +76,7 @@ public class LimitedTableIterator implements TableIterator { * Wrap the given {@link TableIterator} so that limiting the number of rows to read. * * @param it The iterator to wrap. <i>MUST NOT be NULL</i> - * @param maxNbRows Maximum number of rows that can be read. There is overflow if more than this number of rows is asked. <i>A negative value means "no limit".</i> + * @param nbMaxRows Maximum number of rows that can be read. There is overflow if more than this number of rows is asked. <i>A negative value means "no limit".</i> */ public LimitedTableIterator(final TableIterator it, final int nbMaxRows) throws DataReadException{ if (it == null) diff --git a/src/tap/data/ResultSetTableIterator.java b/src/tap/data/ResultSetTableIterator.java index eb51075..9c906a1 100644 --- a/src/tap/data/ResultSetTableIterator.java +++ b/src/tap/data/ResultSetTableIterator.java @@ -72,13 +72,13 @@ public class ResultSetTableIterator implements TableIterator { * * <p> * In order to provide the metadata through {@link #getMetadata()}, this constructor is trying to guess the datatype - * from the DBMS column datatype (using {@link #convertType(String, String)}). + * from the DBMS column datatype (using {@link #convertType(int, String, String)}). * </p> * * <h3>Type guessing</h3> * * <p> - * In order to guess a TAP type from a DBMS type, this constructor will call {@link #convertType(String, String)} + * In order to guess a TAP type from a DBMS type, this constructor will call {@link #convertType(int, String, String)} * which deals with the most common standard datatypes known in Postgres, SQLite, MySQL, Oracle and JavaDB/Derby. * This conversion is therefore not as precise as the one expected by a translator. That's why it is recommended * to use one of the constructor having a {@link JDBCTranslator} in parameter. @@ -89,8 +89,8 @@ public class ResultSetTableIterator implements TableIterator { * @throws NullPointerException If NULL is given in parameter. * @throws DataReadException If the given ResultSet is closed or if the metadata (columns count and types) can not be fetched. * - * @see #convertType(String, String) - * @see ResultSetTableIterator#ResultSetTableIterator(ResultSet, String, DBColumn[]) + * @see #convertType(int, String, String) + * @see #ResultSetTableIterator(ResultSet, JDBCTranslator, String, DBColumn[]) */ public ResultSetTableIterator(final ResultSet dataSet) throws NullPointerException, DataReadException{ this(dataSet, null, null, null); @@ -101,20 +101,20 @@ public class ResultSetTableIterator implements TableIterator { * * <p> * In order to provide the metadata through {@link #getMetadata()}, this constructor is trying to guess the datatype - * from the DBMS column datatype (using {@link #convertType(String, String)}). + * from the DBMS column datatype (using {@link #convertType(int, String, String)}). * </p> * * <h3>Type guessing</h3> * * <p> - * In order to guess a TAP type from a DBMS type, this constructor will call {@link #convertType(String, String)} + * In order to guess a TAP type from a DBMS type, this constructor will call {@link #convertType(int, String, String)} * which deals with the most common standard datatypes known in Postgres, SQLite, MySQL, Oracle and JavaDB/Derby. * This conversion is therefore not as precise as the one expected by a translator. That's why it is recommended * to use one of the constructor having a {@link JDBCTranslator} in parameter. * </p> * * <p><i><b>Important</b>: - * The second parameter of this constructor is given as second parameter of {@link #convertType(String, String)}. + * The second parameter of this constructor is given as second parameter of {@link #convertType(int, String, String)}. * <b>This parameter is really used ONLY when the DBMS is SQLite ("sqlite").</b> * Indeed, SQLite has so many datatype restrictions that it is absolutely needed to know it is the DBMS from which the * ResultSet is coming. Without this information, type guessing will be unpredictable! @@ -126,7 +126,7 @@ public class ResultSetTableIterator implements TableIterator { * @throws NullPointerException If NULL is given in parameter. * @throws DataReadException If the given ResultSet is closed or if the metadata (columns count and types) can not be fetched. * - * @see #convertType(String, String) + * @see #convertType(int, String, String) * @see ResultSetTableIterator#ResultSetTableIterator(ResultSet, JDBCTranslator, String, DBColumn[]) */ public ResultSetTableIterator(final ResultSet dataSet, final String dbms) throws NullPointerException, DataReadException{ @@ -138,13 +138,13 @@ public class ResultSetTableIterator implements TableIterator { * * <p> * In order to provide the metadata through {@link #getMetadata()}, this constructor is trying to guess the datatype - * from the DBMS column datatype (using {@link #convertType(String, String)}). + * from the DBMS column datatype (using {@link #convertType(int, String, String)}). * </p> * * <h3>Type guessing</h3> * * <p> - * In order to guess a TAP type from a DBMS type, this constructor will call {@link #convertType(String, String)} + * In order to guess a TAP type from a DBMS type, this constructor will call {@link #convertType(int, String, String)} * which will ask to the given translator ({@link JDBCTranslator#convertTypeFromDB(int, String, String, String[])}) * if not NULL. However if no translator is provided, this function will proceed to a default conversion * using the most common standard datatypes known in Postgres, SQLite, MySQL, Oracle and JavaDB/Derby. @@ -158,7 +158,7 @@ public class ResultSetTableIterator implements TableIterator { * @throws NullPointerException If NULL is given in parameter. * @throws DataReadException If the given ResultSet is closed or if the metadata (columns count and types) can not be fetched. * - * @see #convertType(String, String) + * @see #convertType(int, String, String) * @see ResultSetTableIterator#ResultSetTableIterator(ResultSet, JDBCTranslator, String, DBColumn[]) */ public ResultSetTableIterator(final ResultSet dataSet, final JDBCTranslator translator) throws NullPointerException, DataReadException{ @@ -170,13 +170,13 @@ public class ResultSetTableIterator implements TableIterator { * * <p> * In order to provide the metadata through {@link #getMetadata()}, this constructor is trying to guess the datatype - * from the DBMS column datatype (using {@link #convertType(String, String)}). + * from the DBMS column datatype (using {@link #convertType(int, String, String)}). * </p> * * <h3>Type guessing</h3> * * <p> - * In order to guess a TAP type from a DBMS type, this constructor will call {@link #convertType(String, String)} + * In order to guess a TAP type from a DBMS type, this constructor will call {@link #convertType(int, String, String)} * which will ask to the given translator ({@link JDBCTranslator#convertTypeFromDB(int, String, String, String[])}) * if not NULL. However if no translator is provided, this function will proceed to a default conversion * using the most common standard datatypes known in Postgres, SQLite, MySQL, Oracle and JavaDB/Derby. @@ -184,7 +184,7 @@ public class ResultSetTableIterator implements TableIterator { * </p> * * <p><i><b>Important</b>: - * The third parameter of this constructor is given as second parameter of {@link #convertType(String, String)}. + * The third parameter of this constructor is given as second parameter of {@link #convertType(int, String, String)}. * <b>This parameter is really used ONLY when the translator conversion failed and when the DBMS is SQLite ("sqlite").</b> * Indeed, SQLite has so many datatype restrictions that it is absolutely needed to know it is the DBMS from which the * ResultSet is coming. Without this information, type guessing will be unpredictable! @@ -198,7 +198,7 @@ public class ResultSetTableIterator implements TableIterator { * @throws NullPointerException If NULL is given in parameter. * @throws DataReadException If the given ResultSet is closed or if the metadata (columns count and types) can not be fetched. * - * @see #convertType(String, String) + * @see #convertType(int, String, String) * @see ResultSetTableIterator#ResultSetTableIterator(ResultSet, JDBCTranslator, String, DBColumn[]) */ public ResultSetTableIterator(final ResultSet dataSet, final JDBCTranslator translator, final String dbms) throws NullPointerException, DataReadException{ @@ -210,7 +210,7 @@ public class ResultSetTableIterator implements TableIterator { * * <p> * In order to provide the metadata through {@link #getMetadata()}, this constructor is reading first the given metadata (if any), - * and then, try to guess the datatype from the DBMS column datatype (using {@link #convertType(String, String)}). + * and then, try to guess the datatype from the DBMS column datatype (using {@link #convertType(int, String, String)}). * </p> * * <h3>Provided metadata</h3> @@ -232,7 +232,7 @@ public class ResultSetTableIterator implements TableIterator { * <h3>Type guessing</h3> * * <p> - * In order to guess a TAP type from a DBMS type, this constructor will call {@link #convertType(String, String)} + * In order to guess a TAP type from a DBMS type, this constructor will call {@link #convertType(int, String, String)} * which will ask to the given translator ({@link JDBCTranslator#convertTypeFromDB(int, String, String, String[])}) * if not NULL. However if no translator is provided, this function will proceed to a default conversion * using the most common standard datatypes known in Postgres, SQLite, MySQL, Oracle and JavaDB/Derby. @@ -240,7 +240,7 @@ public class ResultSetTableIterator implements TableIterator { * </p> * * <p><i><b>Important</b>: - * The third parameter of this constructor is given as second parameter of {@link #convertType(String, String)}. + * The third parameter of this constructor is given as second parameter of {@link #convertType(int, String, String)}. * <b>This parameter is really used ONLY when the translator conversion failed and when the DBMS is SQLite ("sqlite").</b> * Indeed, SQLite has so many datatype restrictions that it is absolutely needed to know it is the DBMS from which the * ResultSet is coming. Without this information, type guessing will be unpredictable! @@ -255,7 +255,7 @@ public class ResultSetTableIterator implements TableIterator { * @throws NullPointerException If NULL is given in parameter. * @throws DataReadException If the metadata (columns count and types) can not be fetched. * - * @see #convertType(String, String) + * @see #convertType(int, String, String) */ public ResultSetTableIterator(final ResultSet dataSet, final JDBCTranslator translator, final String dbms, final DBColumn[] resultMeta) throws NullPointerException, DataReadException{ // A dataset MUST BE provided: diff --git a/src/tap/data/VOTableIterator.java b/src/tap/data/VOTableIterator.java index 1f332df..95d2d56 100644 --- a/src/tap/data/VOTableIterator.java +++ b/src/tap/data/VOTableIterator.java @@ -214,7 +214,8 @@ public class VOTableIterator implements TableIterator { * A Thread interruption will also make this function returning. * </i></p> * - * @return + * @return The last accepted row, + * or <i>NULL</i> if no more rows are available or if the iteration has been interrupted/canceled. */ public synchronized Object[] getRow(){ try{ @@ -324,7 +325,7 @@ public class VOTableIterator implements TableIterator { /** The last read row. Column iteration is done on this array. */ protected Object[] row; - /** Index of the last read column (=0 just after {@link #nextRow()} and before {@link #nextCol()}, ={@link #nbColumns} after the last column has been read). */ + /** Index of the last read column (=0 just after {@link #nextRow()} and before {@link #nextCol()}, ={@link #nbCol} after the last column has been read). */ protected int indCol = -1; /** Number of columns available according to the metadata. */ protected int nbCol = 0; diff --git a/src/tap/db/DBConnection.java b/src/tap/db/DBConnection.java index 929d80a..e836211 100644 --- a/src/tap/db/DBConnection.java +++ b/src/tap/db/DBConnection.java @@ -27,7 +27,6 @@ import tap.metadata.TAPColumn; import tap.metadata.TAPMetadata; import tap.metadata.TAPTable; import adql.query.ADQLQuery; -import adql.translator.ADQLTranslator; /** * <p>Connection to the "database" (whatever is the type or whether it is linked to a true DBMS connection).</p> @@ -64,7 +63,7 @@ public interface DBConnection { * to get the published schemas, tables and columns. The other way is to build a {@link TAPMetadata} object * yourself in function of the schemas/tables/columns you want to publish (i.e. which can be done by reading * metadata from a XML document - following the same schema - XSD- as for the TAP resource <i>tables</i>) - * and then to load them in the DB (see {@link #setTAPSchema(TAPMetadata, boolean)} for more details). + * and then to load them in the DB (see {@link #setTAPSchema(TAPMetadata)} for more details). * </p> * * <p><b>CAUTION: @@ -124,8 +123,7 @@ public interface DBConnection { * DB names provided in the given TAPMetadata (see {@link TAPTable#getDBSchemaName()}, {@link TAPTable#getDBName()} and {@link TAPColumn#getDBName()}) * are used for the creation and filling of the tables. * - * Whether these requests must be case sensitive or not SHOULD be managed by ADQLTranslator (see {@link ADQLTranslator#getQualifiedSchemaName(adql.db.DBTable)}, - * {@link ADQLTranslator#getQualifiedTableName(adql.db.DBTable)} and {@link ADQLTranslator#getColumnName(adql.db.DBColumn)}). + * Whether these requests must be case sensitive or not SHOULD be managed by ADQLTranslator. * </i></p> * * <h3>TAPMetadata PARAMETER</h3> @@ -183,7 +181,7 @@ public interface DBConnection { * <p>If the TAP_UPLOAD schema does not already exist, it will be created.</p> * * <p><i>note: A table of TAP_UPLOAD MUST be transient and persistent only for the lifetime of the query. - * So, this function should always be used with {@link #dropUploadedTable(String)}, which is called at + * So, this function should always be used with {@link #dropUploadedTable(TAPTable)}, which is called at * the end of each query execution.</i></p> * * @param tableDef Definition of the table to upload (list of all columns and of their type). diff --git a/src/tap/db/JDBCConnection.java b/src/tap/db/JDBCConnection.java index 100b3a1..c596f26 100644 --- a/src/tap/db/JDBCConnection.java +++ b/src/tap/db/JDBCConnection.java @@ -83,8 +83,7 @@ import adql.translator.TranslationException; * and that already done modification will remain in the database.</li> * * <li><b>schemas</b>: when the DBMS does not have the notion of schema (like SQLite), no schema creation or dropping will be obviously processed. - * Besides, if not already done, database name of all tables will be prefixed by the schema name. - * The prefix to apply is returned by {@link #getTablePrefix(String)}.</li> + * Besides, if not already done, database name of all tables will be prefixed by the schema name.</li> * * <li><b>batch updates</b>: when not supported, updates will just be done, "normally, one by one. * In one word, there will be merely no optimization. @@ -247,7 +246,7 @@ public class JDBCConnection implements DBConnection { * <p><i><b>Warning:</b> * This constructor really creates a new SQL connection. Creating a SQL connection is time consuming! * That's why it is recommended to use a pool of connections. When doing so, you should use the other constructor of this class - * ({@link #JDBCConnection(Connection, String, TAPLog)}). + * ({@link #JDBCConnection(Connection, JDBCTranslator, String, TAPLog)}). * </i></p> * * @param driverPath Full class name of the JDBC driver. @@ -523,7 +522,7 @@ public class JDBCConnection implements DBConnection { * * <p><i>Note: * If schemas are not supported by this DBMS connection, the DB name of all tables will be set to NULL - * and the DB name of all tables will be prefixed by the ADQL name of their respective schema (using {@link #getTablePrefix(String)}). + * and the DB name of all tables will be prefixed by the ADQL name of their respective schema. * </i></p> * * @see tap.db.DBConnection#getTAPSchema() @@ -580,7 +579,7 @@ public class JDBCConnection implements DBConnection { * If schemas are not supported by this DBMS connection, the DB name of the loaded schemas is set to NULL. * </i></p> * - * @param tablesDef Definition of the table TAP_SCHEMA.schemas. + * @param tableDef Definition of the table TAP_SCHEMA.schemas. * @param metadata Metadata to fill with all found schemas. * @param stmt Statement to use in order to interact with the database. * @@ -635,19 +634,17 @@ public class JDBCConnection implements DBConnection { * </i></p> * * <p><i>Note: - * If schemas are not supported by this DBMS connection, the DB name of the loaded {@link TAPTable}s is prefixed by the ADQL name of their respective schema. - * The table prefix is built by {@link #getTablePrefix(String)}. + * If schemas are not supported by this DBMS connection, the DB name of the loaded + * {@link TAPTable}s is prefixed by the ADQL name of their respective schema. * </i></p> * - * @param tablesDef Definition of the table TAP_SCHEMA.tables. + * @param tableDef Definition of the table TAP_SCHEMA.tables. * @param metadata Metadata (containing already all schemas listed in TAP_SCHEMA.schemas). * @param stmt Statement to use in order to interact with the database. * * @return The complete list of all loaded tables. <i>note: this list is required by {@link #loadColumns(TAPTable, List, Statement)}.</i> * * @throws DBException If a schema can not be found, or if any other error occurs while interacting with the database. - * - * @see #getTablePrefix(String) */ protected List<TAPTable> loadTables(final TAPTable tableDef, final TAPMetadata metadata, final Statement stmt) throws DBException{ ResultSet rs = null; @@ -730,7 +727,7 @@ public class JDBCConnection implements DBConnection { * If they can not be found a {@link DBException} is thrown. * </i></p> * - * @param columnsDef Definition of the table TAP_SCHEMA.columns. + * @param tableDef Definition of the table TAP_SCHEMA.columns. * @param lstTables List of all published tables (= all tables listed in TAP_SCHEMA.tables). * @param stmt Statement to use in order to interact with the database. * @@ -996,15 +993,15 @@ public class JDBCConnection implements DBConnection { * * <p><i>Note: * If schemas are not supported by this DBMS connection, the DB name of schemas is set to NULL and - * the DB name of tables is prefixed by the schema name (using {@link #getTablePrefix(String)}). + * the DB name of tables is prefixed by the schema name. * </i></p> * * @param metadata Metadata (with or without TAP_SCHEMA schema or some of its table). <i>Must not be NULL</i> * - * @return The list of all standard TAP_SCHEMA tables, ordered by creation order (see {@link #getCreationOrder(STDTable)}). + * @return The list of all standard TAP_SCHEMA tables, ordered by creation order (see {@link #getCreationOrder(tap.metadata.TAPMetadata.STDTable)}). * * @see TAPMetadata#resolveStdTable(String) - * @see TAPMetadata#getStdSchema() + * @see TAPMetadata#getStdSchema(boolean) * @see TAPMetadata#getStdTable(STDTable) */ protected TAPTable[] mergeTAPSchemaDefs(final TAPMetadata metadata){ @@ -1115,7 +1112,7 @@ public class JDBCConnection implements DBConnection { * * @throws SQLException If any error occurs while querying or updating the database. * - * @see ADQLTranslator#isCaseSensitive(IdentifierField) + * @see JDBCTranslator#isCaseSensitive(IdentifierField) */ private void dropTAPSchemaTables(final TAPTable[] stdTables, final Statement stmt, final DatabaseMetaData dbMeta) throws SQLException{ String[] stdTablesToDrop = new String[]{null,null,null,null,null}; @@ -1631,8 +1628,8 @@ public class JDBCConnection implements DBConnection { * * <p><i><b>Important note:</b> * This function may modify the given {@link TAPTable} object if schemas are not supported by this connection. - * In this case, this function will prefix the table's DB name by the schema's DB name directly inside the given {@link TAPTable} object - * (building the prefix with {@link #getTablePrefix(String)}). Then the DB name of the schema will be set to NULL. + * In this case, this function will prefix the table's DB name by the schema's DB name directly inside the given + * {@link TAPTable} object. Then the DB name of the schema will be set to NULL. * </i></p> * * <p><i>Note: @@ -1831,8 +1828,8 @@ public class JDBCConnection implements DBConnection { * * <p><i><b>Important note:</b> * This function may modify the given {@link TAPTable} object if schemas are not supported by this connection. - * In this case, this function will prefix the table's DB name by the schema's DB name directly inside the given {@link TAPTable} object - * (building the prefix with {@link #getTablePrefix(String)}). Then the DB name of the schema will be set to NULL. + * In this case, this function will prefix the table's DB name by the schema's DB name directly inside the given + * {@link TAPTable} object. Then the DB name of the schema will be set to NULL. * </i></p> * * <p><i>Note: @@ -1894,8 +1891,7 @@ public class JDBCConnection implements DBConnection { * </li> * <li> * If schemas are not supported by this connection, this function will prefix the table DB name by the schema DB name directly - * inside the given {@link TAPTable} object (building the prefix with {@link #getTablePrefix(String)}). Then the DB name - * of the schema will be set to NULL. + * inside the given {@link TAPTable} object. Then the DB name of the schema will be set to NULL. * </li> * </ul> * @@ -2187,7 +2183,8 @@ public class JDBCConnection implements DBConnection { * <p>If the given {@link ResultSet} is NULL, nothing (even exception/error) happens.</p> * * <p> - * If any {@link SQLException} occurs during this operation, it is caught and just logged (see {@link #log(int, String, Exception)}). + * If any {@link SQLException} occurs during this operation, it is caught and just logged + * (see {@link TAPLog#logDB(uws.service.log.UWSLog.LogLevel, DBConnection, String, String, Throwable)}). * No error is thrown and nothing else is done. * </p> * @@ -2209,11 +2206,12 @@ public class JDBCConnection implements DBConnection { * <p>If the given {@link Statement} is NULL, nothing (even exception/error) happens.</p> * * <p> - * If any {@link SQLException} occurs during this operation, it is caught and just logged (see {@link #log(int, String, Exception)}). + * If any {@link SQLException} occurs during this operation, it is caught and just logged + * (see {@link TAPLog#logDB(uws.service.log.UWSLog.LogLevel, DBConnection, String, String, Throwable)}). * No error is thrown and nothing else is done. * </p> * - * @param rs {@link Statement} to close. + * @param stmt {@link Statement} to close. */ protected final void close(final Statement stmt){ try{ @@ -2329,7 +2327,7 @@ public class JDBCConnection implements DBConnection { * * <p><i>Note: * Test on the schema name is done considering the case sensitivity indicated by the translator - * (see {@link ADQLTranslator#isCaseSensitive(IdentifierField)}). + * (see {@link JDBCTranslator#isCaseSensitive(IdentifierField)}). * </i></p> * * <p><i>Note: @@ -2369,13 +2367,13 @@ public class JDBCConnection implements DBConnection { * * <p><i><b>Important note:</b> * If schemas are not supported by this connection but a schema name is even though provided in parameter, - * the table name will be prefixed by the schema name using {@link #getTablePrefix(String)}. + * the table name will be prefixed by the schema name. * The research will then be done with NULL as schema name and this prefixed table name. * </i></p> * * <p><i>Note: * Test on the schema name is done considering the case sensitivity indicated by the translator - * (see {@link ADQLTranslator#isCaseSensitive(IdentifierField)}). + * (see {@link JDBCTranslator#isCaseSensitive(IdentifierField)}). * </i></p> * * <p><i>Note: @@ -2441,13 +2439,13 @@ public class JDBCConnection implements DBConnection { * * <p><i><b>Important note:</b> * If schemas are not supported by this connection but a schema name is even though provided in parameter, - * the table name will be prefixed by the schema name using {@link #getTablePrefix(String)}. + * the table name will be prefixed by the schema name. * The research will then be done with NULL as schema name and this prefixed table name. * </i></p> * * <p><i>Note: * Test on the schema name is done considering the case sensitivity indicated by the translator - * (see {@link ADQLTranslator#isCaseSensitive(IdentifierField)}). + * (see {@link JDBCTranslator#isCaseSensitive(IdentifierField)}). * </i></p> * * <p><i>Note: diff --git a/src/tap/formatter/JSONFormat.java b/src/tap/formatter/JSONFormat.java index 439008d..4e80889 100644 --- a/src/tap/formatter/JSONFormat.java +++ b/src/tap/formatter/JSONFormat.java @@ -192,7 +192,7 @@ public class JSONFormat implements OutputFormat { /** * Formats in JSON and writes the given {@link TAPColumn} in the given output. * - * @param col The column metadata to format/write in JSON. + * @param tapCol The column metadata to format/write in JSON. * @param out The stream in which the formatted column metadata must be written. * * @throws IOException If there is an error while writing the field metadata. diff --git a/src/tap/formatter/SVFormat.java b/src/tap/formatter/SVFormat.java index 89adf09..5c0c19d 100644 --- a/src/tap/formatter/SVFormat.java +++ b/src/tap/formatter/SVFormat.java @@ -297,11 +297,11 @@ public class SVFormat implements OutputFormat { * * @param result Result to write. * @param selectedColumns All columns' metadata. - * @param out Output stream in which the data must be written. + * @param writer Writer in which the data must be written. * @param execReport Execution report (which contains the maximum allowed number of records to output). * @param thread Thread which has asked for this formatting (it must be used in order to test the {@link Thread#isInterrupted()} flag and so interrupt everything if need). * - * @throws IOException If there is an error while writing something in the output stream. + * @throws IOException If there is an error while writing something in the given writer. * @throws InterruptedException If the thread has been interrupted. * @throws TAPException If any other error occurs. */ @@ -327,9 +327,9 @@ public class SVFormat implements OutputFormat { writer.write(separator); } writer.newLine(); - + execReport.nbRows++; - + // flush the writer every 30 lines: if (execReport.nbRows % 30 == 0) writer.flush(); @@ -338,7 +338,7 @@ public class SVFormat implements OutputFormat { } /** - * <p>Writes the given field value in the given PrintWriter.</p> + * <p>Writes the given field value in the given Writer.</p> * * <p> * A String value will be delimited if {@link #delimitStr} is true, otherwise this type of value will @@ -347,7 +347,7 @@ public class SVFormat implements OutputFormat { * * @param value The value to write. * @param column The corresponding column metadata. - * @param out The stream in which the field value must be written. + * @param writer The stream in which the field value must be written. * * @throws IOException If there is an error while writing the given field value in the given stream. * @throws TAPException If there is any other error (by default: never happen). diff --git a/src/tap/formatter/TextFormat.java b/src/tap/formatter/TextFormat.java index 9849d15..7b6f513 100644 --- a/src/tap/formatter/TextFormat.java +++ b/src/tap/formatter/TextFormat.java @@ -128,13 +128,12 @@ public class TextFormat implements OutputFormat { * Get the whole header (one row whose columns are just the columns' name). * * @param result Result to write later (but it contains also metadata that was extracted from the result itself). - * @param writer Output in which the metadata must be written. * @param execReport Execution report (which contains the metadata extracted/guessed from the ADQL query). * @param thread Thread which has asked for this formatting (it must be used in order to test the {@link Thread#isInterrupted()} flag and so interrupt everything if need). * * @return All the written metadata. * - * @throws TAPException If any other error occurs. + * @throws TAPException If any other error occurs. */ protected String getHeader(final TableIterator result, final TAPExecutionReport execReport, final Thread thread) throws TAPException{ // Get the columns meta: @@ -159,7 +158,7 @@ public class TextFormat implements OutputFormat { /** * Write all the data rows into the given {@link AsciiTable} object. * - * @param result Result to write. + * @param queryResult Result to write. * @param asciiTable Output in which the rows (as string) must be written. * @param execReport Execution report (which contains the maximum allowed number of records to output). * @param thread Thread which has asked for this formatting (it must be used in order to test the {@link Thread#isInterrupted()} flag and so interrupt everything if need). diff --git a/src/tap/formatter/VOTableFormat.java b/src/tap/formatter/VOTableFormat.java index 994c367..f38b17e 100644 --- a/src/tap/formatter/VOTableFormat.java +++ b/src/tap/formatter/VOTableFormat.java @@ -265,7 +265,7 @@ public class VOTableFormat implements OutputFormat { * * @param message Error message to display to the user. * @param otherInfo List of other additional information to display. <i>optional</i> - * @param out Stream in which the VOTable error must be written. + * @param writer Stream in which the VOTable error must be written. * * @throws IOException If any error occurs while writing in the given output. * @@ -410,17 +410,15 @@ public class VOTableFormat implements OutputFormat { } /** - * <p>Writes fields' metadata of the given query result in the given Writer.</p> - * <p><b><u>Important:</u> To write write metadata of a given field you can use {@link #writeFieldMeta(TAPColumn, PrintWriter)}.</b></p> + * Writes fields' metadata of the given query result. * * @param result The query result from whose fields' metadata must be written. - * @param output Writer in which fields' metadata must be written. * @param execReport The report of the query execution. * @param thread The thread which asked for the result writing. * * @return Extracted field's metadata, or NULL if no metadata have been found (theoretically, it never happens). * - * @throws IOException If there is an error while writing the metadata in the given Writer. + * @throws IOException If there is an error while writing the metadata. * @throws TAPException If there is any other error. * @throws InterruptedException If the given thread has been interrupted. */ diff --git a/src/tap/log/DefaultTAPLog.java b/src/tap/log/DefaultTAPLog.java index 90cbeba..2750fed 100644 --- a/src/tap/log/DefaultTAPLog.java +++ b/src/tap/log/DefaultTAPLog.java @@ -45,10 +45,10 @@ public class DefaultTAPLog extends DefaultUWSLog implements TAPLog { /** * <p>Builds a {@link TAPLog} which will use the given file - * manager to get the log output (see {@link UWSFileManager#getLogOutput(LogLevel, String)}).</p> + * manager to get the log output (see {@link UWSFileManager#getLogOutput(uws.service.log.UWSLog.LogLevel, String)}).</p> * * <p><i><u>note 1</u>: This constructor is particularly useful if the way of managing log output may change in the given file manager. - * Indeed, the output may change in function of the type of message to log ({@link LogLevel}).</i></p> + * Indeed, the output may change in function of the type of message to log ({@link uws.service.log.UWSLog.LogLevel}).</i></p> * * <p><i><u>note 2</u> If no output can be found in the file manager the standard error output ({@link System#err}) * will be chosen automatically for all log messages.</i></p> @@ -65,7 +65,7 @@ public class DefaultTAPLog extends DefaultUWSLog implements TAPLog { * <p>Builds a {@link TAPLog} which will print all its * messages into the given stream.</p> * - * <p><i><u>note</u>: the given output will be used whatever is the type of message to log ({@link LogLevel}).</i></p> + * <p><i><u>note</u>: the given output will be used whatever is the type of message to log ({@link uws.service.log.UWSLog.LogLevel}).</i></p> * * @param output An output stream. * @@ -79,7 +79,7 @@ public class DefaultTAPLog extends DefaultUWSLog implements TAPLog { * <p>Builds a {@link TAPLog} which will print all its * messages into the given stream.</p> * - * <p><i><u>note</u>: the given output will be used whatever is the type of message to log ({@link LogLevel}).</i></p> + * <p><i><u>note</u>: the given output will be used whatever is the type of message to log ({@link uws.service.log.UWSLog.LogLevel}).</i></p> * * @param writer A print writer. * diff --git a/src/tap/metadata/TAPColumn.java b/src/tap/metadata/TAPColumn.java index a8eaa61..30d4d1d 100644 --- a/src/tap/metadata/TAPColumn.java +++ b/src/tap/metadata/TAPColumn.java @@ -668,8 +668,6 @@ public class TAPColumn implements DBColumn { * For consistency reasons, this function SHOULD be called only by the {@link TAPTable} * that owns this column or that is part of the foreign key. * </i></p> - * - * @param key Foreign key in which this column was targeting another column. */ protected void removeAllTargets(){ lstTargets.clear(); @@ -739,8 +737,6 @@ public class TAPColumn implements DBColumn { * For consistency reasons, this function SHOULD be called only by the {@link TAPTable} * that owns this column or that is part of the foreign key. * </i></p> - * - * @param key Foreign key in which this column was targeted by another column. */ protected void removeAllSources(){ lstSources.clear(); diff --git a/src/tap/metadata/TAPMetadata.java b/src/tap/metadata/TAPMetadata.java index 11cad6c..580b966 100644 --- a/src/tap/metadata/TAPMetadata.java +++ b/src/tap/metadata/TAPMetadata.java @@ -86,7 +86,7 @@ public class TAPMetadata implements Iterable<TAPSchema>, VOSIResource, TAPResour * By default, a TAP service must have at least a TAP_SCHEMA schema which contains a set of 5 tables * (schemas, tables, columns, keys and key_columns). This schema is not created here by default * because it can be customized by the service implementor. Besides, the DB name may be different. - * However, you can easily get this schema thanks to the function {@link #getStdSchema()} + * However, you can easily get this schema thanks to the function {@link #getStdSchema(boolean)} * which returns the standard definition of this schema (including all tables and columns described * by the standard). For a standard definition of this schema, you can then write the following: * </i></p> @@ -774,7 +774,7 @@ public class TAPMetadata implements Iterable<TAPSchema>, VOSIResource, TAPResour * <p>Get the definition of the specified standard TAP table.</p> * * <p><i><b>Important note:</b> - * The returned table is not linked at all with a schema, on the contrary of {@link #getStdSchema()} which returns tables linked with the returned schema. + * The returned table is not linked at all with a schema, on the contrary of {@link #getStdSchema(boolean)} which returns tables linked with the returned schema. * So, you may have to linked this table to schema (by using {@link TAPSchema#addTable(TAPTable)}) whose the ADQL name is TAP_SCHEMA after calling this function. * </i></p> * diff --git a/src/tap/metadata/TAPSchema.java b/src/tap/metadata/TAPSchema.java index a763443..182c421 100644 --- a/src/tap/metadata/TAPSchema.java +++ b/src/tap/metadata/TAPSchema.java @@ -323,15 +323,13 @@ public class TAPSchema implements Iterable<TAPTable> { * @param tableName ADQL name (and indirectly also the DB name) of the table to create and add. * @param tableType Type of the new table. <i>If NULL, "table" will be the type of the created table.</i> * @param description Description of the new table. <i>MAY be NULL</i> - * @param unit Unit of the new table's values. <i>MAY be NULL</i> - * @param ucd UCD describing the scientific content of the new column. <i>MAY be NULL</i> * @param utype UType associating the new column with a data-model. <i>MAY be NULL</i> * * @return The created and added {@link TAPTable} object, * or NULL if the given name is NULL or an empty string. * - * @see TAPTable#TAPTable(String, TableType, String, String, String, String) - * @see #addTable(TAPSchema) + * @see TAPTable#TAPTable(String, TableType, String, String) + * @see #addTable(TAPTable) */ public TAPTable addTable(String tableName, TableType tableType, String description, String utype){ if (tableName == null) diff --git a/src/tap/metadata/TableSetParser.java b/src/tap/metadata/TableSetParser.java index 987bb0b..0d6e1a5 100644 --- a/src/tap/metadata/TableSetParser.java +++ b/src/tap/metadata/TableSetParser.java @@ -322,7 +322,7 @@ public class TableSetParser extends DefaultHandler { * </ul> * * @param reader XML reader. - * @param allForeignKeys List to fill with all encountered foreign keys. + * @param keys List to fill with all encountered foreign keys. * <i>note: these keys are not the final TAP meta, but a collection of all information found in the XML document. * The final TAP meta will be created later, once all available tables and columns are available.</i> * diff --git a/src/tap/parameters/DALIUpload.java b/src/tap/parameters/DALIUpload.java index e55c74a..fdf001d 100644 --- a/src/tap/parameters/DALIUpload.java +++ b/src/tap/parameters/DALIUpload.java @@ -284,7 +284,7 @@ public class DALIUpload { * Because of the possible presence of a semicolon in a URI (which is also used as separator of uploads in the TAP syntax), * there could be a problem while splitting the uploads specified in "UPLOAD". In that case, it is strongly recommended to * either encode the URI (in UTF-8) (i.e. ";" becomes "%3B") or to merely restrict the syntax to the DALI one. In this last case, - * the parameter {@link #allowTAPSyntax} should be set to <i>false</i> and then all parameters should be submitted individually. + * the parameter "allowTAPSyntax" should be set to <i>false</i> and then all parameters should be submitted individually. * </i></p> * * @param requestParams All parameters extracted from an HTTP request by a {@link RequestParser}. @@ -298,7 +298,7 @@ public class DALIUpload { * * @throws TAPException If the syntax of an "UPLOAD" parameter is wrong. * - * @see {@link RequestParser#parse(javax.servlet.http.HttpServletRequest)} + * @see RequestParser#parse(javax.servlet.http.HttpServletRequest) */ public final static List<DALIUpload> getDALIUploads(final Map<String,Object> requestParams, final boolean allowTAPSyntax, final UWSFileManager fileManager) throws TAPException{ @@ -404,8 +404,6 @@ public class DALIUpload { * <i>(a link to the file manager will be set in the {@link DALIUpload} object in order to open it * whenever it will asked after its creation)</i> * - * @return The corresponding {@link DALIUpload} objects. - * * @throws TAPException If the syntax of the given "UPLOAD" parameter is incorrect. */ protected static void fetchDALIUploads(final ArrayList<DALIUpload> uploads, final ArrayList<String> usedFiles, String uploadParam, final Map<String,Object> parameters, final boolean allowTAPSyntax, final UWSFileManager fileManager) throws TAPException{ diff --git a/src/tap/parameters/FormatController.java b/src/tap/parameters/FormatController.java index a48339a..0092251 100644 --- a/src/tap/parameters/FormatController.java +++ b/src/tap/parameters/FormatController.java @@ -64,7 +64,7 @@ public class FormatController implements InputParamController { /** * Lets indicating whether the format parameter can be modified. * - * @param allowModification <i>true</i> if the format can be modified, <i>false</i> otherwise. + * @param allowModif <i>true</i> if the format can be modified, <i>false</i> otherwise. */ public final void allowModification(final boolean allowModif){ this.allowModification = allowModif; diff --git a/src/tap/parameters/TAPDestructionTimeController.java b/src/tap/parameters/TAPDestructionTimeController.java index e5742ed..076cc05 100644 --- a/src/tap/parameters/TAPDestructionTimeController.java +++ b/src/tap/parameters/TAPDestructionTimeController.java @@ -74,7 +74,7 @@ public class TAPDestructionTimeController implements InputParamController { /** * Let indicate whether the destruction time of any managed job can be modified. * - * @param allowModification <i>true</i> if the destruction time can be modified, <i>false</i> otherwise. + * @param allowModif <i>true</i> if the destruction time can be modified, <i>false</i> otherwise. */ public final void allowModification(final boolean allowModif){ allowModification = allowModif; diff --git a/src/tap/parameters/TAPExecutionDurationController.java b/src/tap/parameters/TAPExecutionDurationController.java index dde16d4..0f3985c 100644 --- a/src/tap/parameters/TAPExecutionDurationController.java +++ b/src/tap/parameters/TAPExecutionDurationController.java @@ -69,7 +69,7 @@ public class TAPExecutionDurationController implements InputParamController { /** * Let indicate whether the execution duration of any managed job can be modified. * - * @param allowModification <i>true</i> if the execution duration can be modified, <i>false</i> otherwise. + * @param allowModif <i>true</i> if the execution duration can be modified, <i>false</i> otherwise. */ public final void allowModification(final boolean allowModif){ allowModification = allowModif; diff --git a/src/tap/parameters/TAPParameters.java b/src/tap/parameters/TAPParameters.java index 2f29578..e591092 100644 --- a/src/tap/parameters/TAPParameters.java +++ b/src/tap/parameters/TAPParameters.java @@ -75,7 +75,7 @@ public class TAPParameters extends UWSParameters { /** * Create a {@link TAPParameters} instance whose the parameters are given in parameter. * - * @param request HTTP request containing the parameters to gather inside this class. + * @param service Description of the TAP service. Limits of the standard TAP parameters are listed in it. * @param params List of parameters to load inside this object. * * @throws TAPException If any error occurs while extracting the DALIParameters OR while setting a parameter. diff --git a/src/tap/resource/TAP.java b/src/tap/resource/TAP.java index b8a399b..2bc876f 100644 --- a/src/tap/resource/TAP.java +++ b/src/tap/resource/TAP.java @@ -749,17 +749,13 @@ public class TAP implements VOSIResource { * * <h3>Home page</h3> * <p> - * If the appropriate resource is the home page, the request is not propagated and - * this class/resource displays directly the home page in the given response by calling {@link #writeHomePage(HttpServletResponse, JobOwner)}. - * The default implementation of this function takes 2 cases into account: + * If the appropriate resource is the home page, the request is propagated to a {@link TAPResource} + * (by default {@link HomePage}) whose the resource name is "HOME PAGE". Once called, this resource + * displays directly the home page in the given response by calling. + * The default implementation of the default implementation ({@link HomePage}) takes several cases into account. + * Those are well documented in the Javadoc of {@link HomePage}. What you should know, is that sometimes it is + * using the following attributes of this class: {@link #getHomePage()}, {@link #getHomePageURI()}, {@link #getHomePageMimeType()}. * </p> - * <ol> - * <li><b>A custom home page has been specified</b> using {@link #setHomePageURI(String)}. In this case, the content of the URL or file path will - * be directly copied into the HTTP response. The content type of the response must be specified by - * {@link #setHomePageMimeType(String)} ; by default, it is "text/html".</li> - * <li><b>Default home page.</b> When no custom home page has been specified, a default content is displayed. It is an HTML document which merely - * lists all resources available in this TAP service.</li> - * </ol> * * <h3>Error/Exception management</h3> * <p> diff --git a/src/uws/ISO8601Format.java b/src/uws/ISO8601Format.java index 61fa2d5..fab1cc0 100644 --- a/src/uws/ISO8601Format.java +++ b/src/uws/ISO8601Format.java @@ -23,7 +23,7 @@ import java.util.regex.Pattern; * <p> * As said previously, it is possible to display or to hide the time zone and the milliseconds. This can be easily done by changing * the value of the static attributes {@link #displayTimeZone} and {@link #displayMilliseconds}. By default {@link #displayTimeZone} is <i>true</i> - * and {@value #displayMilliseconds} is <i>false</i>. + * and {@link #displayMilliseconds} is <i>false</i>. * </i> * * <p> diff --git a/src/uws/UWSToolBox.java b/src/uws/UWSToolBox.java index b582178..34bb155 100644 --- a/src/uws/UWSToolBox.java +++ b/src/uws/UWSToolBox.java @@ -121,7 +121,7 @@ public class UWSToolBox { * <p>Builds a map of strings with all parameters of the given HTTP request.</p> * * <p><i>Note: - * If the request attribute {@value UWS#REQ_ATTRIBUTE_PARAMETERS} has been already set by the UWS library, + * If the request attribute {@link UWS#REQ_ATTRIBUTE_PARAMETERS} has been already set by the UWS library, * this map (after conversion into a Map<String,String>) is returned. * Otherwise, the parameters identified automatically by the Servlet are returned (just the last occurrence of each parameter is kept). * </i></p> @@ -369,7 +369,7 @@ public class UWSToolBox { * * <p> * These files have been stored on the file system - * if there is a request attribute named {@value UWS#REQ_ATTRIBUTE_PARAMETERS}. + * if there is a request attribute named {@link UWS#REQ_ATTRIBUTE_PARAMETERS}. * </p> * * @param req Request in which files have been uploaded. @@ -531,7 +531,7 @@ public class UWSToolBox { /** * Writes the stack trace of the given exception in the file whose the name and the parent directory are given in parameters. * If the specified file already exists, it will be overwritten if the parameter <i>overwrite</i> is equal to <i>true</i>, otherwise - * no file will not be changed <i>(default behavior of {@link UWSToolBox#writeErrorFile(Exception, String, String)})</i>. + * no file will not be changed <i>(default behavior of {@link UWSToolBox#writeErrorFile(Exception, ErrorSummary, UWSJob, OutputStream)})</i>. * * @param ex The exception which has to be used to generate the error file. * @param error The error description. @@ -660,7 +660,7 @@ public class UWSToolBox { /** * Gets the file extension corresponding to the given MIME type. * - * @param MIME type A MIME type (i.e. text/plain, application/json, application/xml, text/xml, application/x-votable+xml, ....) + * @param mimeType A MIME type (i.e. text/plain, application/json, application/xml, text/xml, application/x-votable+xml, ....) * * @return The corresponding file extension or <i>null</i> if not known. */ diff --git a/src/uws/job/JobList.java b/src/uws/job/JobList.java index fcab5d3..90e43f4 100644 --- a/src/uws/job/JobList.java +++ b/src/uws/job/JobList.java @@ -92,8 +92,7 @@ import uws.service.log.UWSLog.LogLevel; * </p> * * <p> - * To use a custom destruction manager, you can use the method {@link #setDestructionManager(DestructionManager)} - * if the jobs list is not managed by a UWS or {@link UWSService#setDestructionManager(DestructionManager)} otherwise. + * To use a custom destruction manager, you can use the method {@link #setDestructionManager(DestructionManager)}. * </p> * * @author Grégory Mantelet (CDS;ARI) @@ -231,7 +230,7 @@ public class JobList extends SerializableUWSObject implements Iterable<UWSJob> { * @return A logger. * * @see #getUWS() - * @see UWS#getLogger(); + * @see UWS#getLogger() * @see UWSToolBox#getDefaultLogger() */ public UWSLog getLogger(){ @@ -359,7 +358,7 @@ public class JobList extends SerializableUWSObject implements Iterable<UWSJob> { * Gets the job whose the ID is given in parameter ONLY IF it is the one of the specified user OR IF the specified job is owned by an anonymous user. * * @param jobID ID of the job to get. - * @param userID ID of the user who asks this job (<i>null</i> means no particular owner => cf {@link #getJob(String)}). + * @param user The user who asks this job (<i>null</i> means no particular owner => cf {@link #getJob(String)}). * * @return The requested job or <i>null</i> if there is no job with the given ID or if the user is not allowed to get the given job. * @@ -396,7 +395,7 @@ public class JobList extends SerializableUWSObject implements Iterable<UWSJob> { /** * Gets an iterator on the jobs list of the specified user. * - * @param ownerId The ID of the owner/user (may be <i>null</i>). + * @param user The owner/user who asks for this operation (may be <i>null</i>). * * @return An iterator on all jobs which have been created by the specified owner/user * or a NullIterator if the specified owner/user has no job @@ -517,7 +516,6 @@ public class JobList extends SerializableUWSObject implements Iterable<UWSJob> { * * @throws UWSException If the owner of the given job is not allowed to add any job into this jobs list. * - * @see UWSJob#loadAdditionalParams() * @see UWSJob#setJobList(JobList) * @see UWSService#getBackupManager() * @see UWSBackupManager#saveOwner(JobOwner) @@ -691,7 +689,7 @@ public class JobList extends SerializableUWSObject implements Iterable<UWSJob> { /** * Destroys all jobs owned by the specified user. * - * @param ownerId The ID of the owner/user. + * @param owner The owner/user who asks for this operation. * * @throws UWSException If the given user is not allowed to update of the content of this jobs list. * diff --git a/src/uws/job/JobThread.java b/src/uws/job/JobThread.java index 1413501..28e9dcf 100644 --- a/src/uws/job/JobThread.java +++ b/src/uws/job/JobThread.java @@ -80,7 +80,7 @@ public abstract class JobThread extends Thread { * @since 4.1 */ protected boolean fatalError = false; - /** Indicates whether the {@link UWSJob#jobWork()} has been called and finished, or not. */ + /** Indicates whether the {@link #jobWork()} has been called and finished, or not. */ protected boolean finished = false; /** Description of what is done by this thread. */ @@ -209,7 +209,7 @@ public abstract class JobThread extends Thread { } /** - * Indicates whether the {@link UWSJob#jobWork()} method has been called or not. + * Indicates whether the {@link #jobWork()} method has been called or not. * * @return <i>true</i> if the job work is done, <i>false</i> otherwise. */ @@ -240,7 +240,7 @@ public abstract class JobThread extends Thread { * * @throws UWSException If there is an error while publishing the error. * - * @see {@link UWSJob#error(ErrorSummary)} + * @see UWSJob#error(ErrorSummary) */ public void setError(final ErrorSummary error) throws UWSException{ job.error(error); @@ -261,8 +261,8 @@ public abstract class JobThread extends Thread { * * @throws UWSException If there is an error while publishing the given exception. * - * {@link ServiceErrorWriter#writeError(UWSJob, Throwable, String, ErrorType, OutputStream)} - * {@link UWSToolBox#writeErrorFile(Exception, ErrorSummary, UWSJob, OutputStream)} + * @see #setError(ErrorSummary) + * @see UWSToolBox#writeErrorFile(Exception, ErrorSummary, UWSJob, OutputStream) */ public void setError(final UWSException ue) throws UWSException{ if (ue == null) @@ -295,8 +295,6 @@ public abstract class JobThread extends Thread { /** * Creates a default result description. * - * @param job The job which will contains this result. - * * @return The created result. * * @see #createResult(String) @@ -318,7 +316,6 @@ public abstract class JobThread extends Thread { /** * Creates a default result description but by precising its name/ID. * - * @param job The job which will contains this result. * @param name The name/ID of the result to create. * * @return The created result. @@ -367,7 +364,7 @@ public abstract class JobThread extends Thread { * * @throws IOException If there is an error while getting the result file size. * - * @see {@link UWSFileManager#getResultSize(Result, UWSJob)} + * @see UWSFileManager#getResultSize(Result, UWSJob) */ public long getResultSize(final Result result) throws IOException{ return getFileManager().getResultSize(result, job); @@ -380,14 +377,14 @@ public abstract class JobThread extends Thread { * <ul> * <li>This method does the job work but it MUST also fill the associated job with the execution results and/or errors.</li> * <li>Do not forget to check the interrupted flag of the thread ({@link Thread#isInterrupted()}) and then to send an {@link InterruptedException}. - * Otherwise the {@link UWSJob#stop()} method will have no effect, as for {@link #abort()} and {@link #error(ErrorSummary)}.</li> + * Otherwise the {@link UWSJob#stop()} method will have no effect, as for {@link UWSJob#abort()} and {@link #setError(ErrorSummary)}.</li> * </ul></b></p> * * <p><i><u>Notes</u>: * <ul> * <li>The "setPhase(COMPLETED)" and the "endTime=new Date()" are automatically applied just after the call to jobWork.</li> - * <li>If an {@link UWSException} is thrown the {@link JobThread} will automatically publish the exception in this job - * thanks to the {@link UWSJob#error(UWSException)} method or the {@link #setErrorSummary(ErrorSummary)} method, + * <li>If a {@link UWSException} is thrown the {@link JobThread} will automatically publish the exception in this job + * thanks to the {@link UWSJob#error(ErrorSummary)} method or the {@link UWSJob#setErrorSummary(ErrorSummary)} method, * and so it will set its phase to {@link ExecutionPhase#ERROR}.</li> * <li>If an {@link InterruptedException} is thrown the {@link JobThread} will automatically set the phase to {@link ExecutionPhase#ABORTED}</li> * </ul></i></p> @@ -400,19 +397,19 @@ public abstract class JobThread extends Thread { /** * <ol> * <li>Tests the execution phase of the job: if not {@link ExecutionPhase#EXECUTING EXECUTING}, nothing is done...the thread ends immediately.</li> - * <li>Calls the {@link UWSJob#jobWork()} method.</li> + * <li>Calls the {@link #jobWork()} method.</li> * <li>Sets the <i>finished</i> flag to <i>true</i>.</li> * <li>Changes the job phase to {@link ExecutionPhase#COMPLETED COMPLETED} if not interrupted, else {@link ExecutionPhase#ABORTED ABORTED}. * </ol> * <P>If any {@link InterruptedException} occurs the job phase is only set to {@link ExecutionPhase#ABORTED ABORTED}.</P> * <P>If any {@link UWSException} occurs while the phase is {@link ExecutionPhase#EXECUTING EXECUTING} the job phase * is set to {@link ExecutionPhase#ERROR ERROR} and an error summary is created.</P> - * <P>Whatever is the exception, it will always be available thanks to the {@link JobThread#getError()} after execution.</P> + * <P>Whatever is the exception, it will always be available thanks to the {@link #getError()} after execution.</P> * - * @see UWSJob#jobWork() + * @see #jobWork() * @see UWSJob#setPhase(ExecutionPhase) - * @see UWSJob#publishExecutionError(UWSException) - * @see UWSToolBox#publishErrorSummary(UWSJob, String, ErrorType) + * @see #setError(UWSException) + * @see #setError(ErrorSummary) */ @Override public final void run(){ diff --git a/src/uws/job/Result.java b/src/uws/job/Result.java index aa4386c..fa45a75 100644 --- a/src/uws/job/Result.java +++ b/src/uws/job/Result.java @@ -244,9 +244,7 @@ public class Result extends SerializableUWSObject { } /** - * Sets the size of the corresponding result file. - * - * @return size Result file size (in bytes). + * Sets the size (in bytes) of the corresponding result file. */ public final void setSize(long size){ this.size = size; diff --git a/src/uws/job/SerializableUWSObject.java b/src/uws/job/SerializableUWSObject.java index f0c45d8..878d9ce 100644 --- a/src/uws/job/SerializableUWSObject.java +++ b/src/uws/job/SerializableUWSObject.java @@ -51,7 +51,7 @@ public abstract class SerializableUWSObject implements Serializable { * * @throws Exception If there is an unexpected error during the serialization. * - * @see #serialize(UWSSerializer, String) + * @see #serialize(UWSSerializer, JobOwner) */ public String serialize(UWSSerializer serializer) throws Exception{ return serialize(serializer, null); @@ -79,7 +79,7 @@ public abstract class SerializableUWSObject implements Serializable { * * @throws UWSException If there is an error during the serialization. * - * @see #serialize(ServletOutputStream, UWSSerializer, String) + * @see #serialize(ServletOutputStream, UWSSerializer, JobOwner) */ public void serialize(ServletOutputStream output, UWSSerializer serializer) throws Exception{ serialize(output, serializer, null); @@ -91,13 +91,13 @@ public abstract class SerializableUWSObject implements Serializable { * * @param output The ouput stream in which this object must be serialized. * @param serializer The serializer to use. - * @param ownerId The ID of the current ID. + * @param owner The user who asks for the serialization. * * @throws UWSException If the owner is not allowed to see the content of the serializable object. * @throws IOException If there is an error while writing in the given stream. * @throws Exception If there is any other error during the serialization. * - * @see #serialize(UWSSerializer, String) + * @see #serialize(UWSSerializer, JobOwner) */ public void serialize(ServletOutputStream output, UWSSerializer serializer, JobOwner owner) throws UWSException, IOException, Exception{ if (output == null) diff --git a/src/uws/job/UWSJob.java b/src/uws/job/UWSJob.java index 872b714..b2a28c9 100644 --- a/src/uws/job/UWSJob.java +++ b/src/uws/job/UWSJob.java @@ -59,8 +59,8 @@ import uws.service.request.UploadFile; * <ul> * <li> * The job attributes <i>startTime</i> and <i>endTime</i> are automatically managed by {@link UWSJob}. You don't have to do anything ! - * However you can customize the used date/time format thanks to the function {@link #setDateFormat(DateFormat)}. The default date/time format is: - * <i>yyyy-MM-dd'T'HH:mm:ss.SSSZ</i> + * The date/time format is managed automatically by the library and can not be customized since it is imposed by the UWS + * protocol definition: ISO-8601. * </li> * <br /> * <li>Once set, the <i>destruction</i> and the <i>executionDuration</i> attributes are automatically managed. That is to say: @@ -93,13 +93,6 @@ import uws.service.request.UploadFile; * </li> * <br /> * <li> - * <b>{@link #loadAdditionalParams()}:</b> - * All parameters that are not managed by default are automatically stored in the job attribute {@link #additionalParameters} (a map). - * However if you want manage yourself some or all of these additional parameters (i.e. task parameters), you must override this method. - * <i>(By default nothing is done.)</i> - * </li> - * <br /> - * <li> * <b>{@link #clearResources()}:</b> * This method is called <u>only at the destruction of the job</u>. * By default, the job is stopped (if running), thread resources are freed, @@ -278,7 +271,7 @@ public class UWSJob extends SerializableUWSObject { * * @param params UWS standard and non-standard parameters. * - * @see UWSJob#AbstractJob(String, Map) + * @see UWSJob#UWSJob(JobOwner, UWSParameters) */ public UWSJob(final UWSParameters params){ this(null, params); @@ -293,8 +286,7 @@ public class UWSJob extends SerializableUWSObject { * @param owner Job.owner ({@link #PARAM_OWNER}). * @param params UWS standard and non-standard parameters. * - * @see #loadDefaultParams(Map) - * @see #loadAdditionalParams() + * @see UWSParameters#init() */ public UWSJob(JobOwner owner, final UWSParameters params){ this.owner = owner; @@ -446,9 +438,9 @@ public class UWSJob extends SerializableUWSObject { /** * <p>Looks for an additional parameters which corresponds to the Execution Phase. If it exists and:</p> * <ul> - * <li> is equals to {@link UWSJob#PHASE_RUN RUN} => remove it from the attribute {@link #additionalParameters} and start the job.</li> - * <li> is equals to {@link UWSJob#PHASE_ABORT ABORT} => remove it from the attribute {@link #additionalParameters} and abort the job.</li> - * <li> is another value => the attribute stays in the attribute {@link #additionalParameters} and nothing is done.</li> + * <li> is equals to {@link UWSJob#PHASE_RUN RUN} => remove it from the attribute {@link #inputParams} and start the job.</li> + * <li> is equals to {@link UWSJob#PHASE_ABORT ABORT} => remove it from the attribute {@link #inputParams} and abort the job.</li> + * <li> is another value => the attribute is though removed from the attribute {@link #inputParams} but nothing is done.</li> * </ul> * * @param user The user who asks to apply the phase parameter (start/abort). (may be NULL) @@ -935,11 +927,11 @@ public class UWSJob extends SerializableUWSObject { /** * <p>Adds or updates the given parameters ONLY IF the job can be updated (considering its current execution phase, see {@link JobPhase#isJobUpdatable()}).</p> * - * <p>Whatever is the result of {@link #loadDefaultParams(Map)} the method {@link #applyPhaseParam()} is called so that if there is an additional parameter {@link #PARAM_PHASE} with the value: + * <p>At the end of this function, the method {@link #applyPhaseParam(JobOwner)} is called so that if there is an additional parameter {@link #PARAM_PHASE} with the value: * <ul> * <li>{@link UWSJob#PHASE_RUN RUN} then the job is starting and the phase goes to {@link ExecutionPhase#EXECUTING EXECUTING}.</li> * <li>{@link UWSJob#PHASE_ABORT ABORT} then the job is aborting.</li> - * <li>otherwise the parameter {@link UWSJob#PARAM_PHASE PARAM_PHASE} remains in the {@link UWSJob#additionalParameters additionalParameters} list.</li> + * <li>otherwise the parameter {@link UWSJob#PARAM_PHASE PARAM_PHASE} is removed from {@link UWSJob#inputParams inputParams} and nothing is done.</li> * </ul></p> * * @param params A list of parameters to add/update. @@ -957,11 +949,11 @@ public class UWSJob extends SerializableUWSObject { /** * <p>Adds or updates the given parameters ONLY IF the job can be updated (considering its current execution phase, see {@link JobPhase#isJobUpdatable()}).</p> * - * <p>Whatever is the result of {@link #loadDefaultParams(Map)} the method {@link #applyPhaseParam()} is called so that if there is an additional parameter {@link #PARAM_PHASE} with the value: + * <p>At the end of this function, the method {@link #applyPhaseParam(JobOwner)} is called so that if there is an additional parameter {@link #PARAM_PHASE} with the value: * <ul> * <li>{@link UWSJob#PHASE_RUN RUN} then the job is starting and the phase goes to {@link ExecutionPhase#EXECUTING EXECUTING}.</li> * <li>{@link UWSJob#PHASE_ABORT ABORT} then the job is aborting.</li> - * <li>otherwise the parameter {@link UWSJob#PARAM_PHASE PARAM_PHASE} remains in the {@link UWSJob#additionalParameters additionalParameters} list.</li> + * <li>otherwise the parameter {@link UWSJob#PARAM_PHASE PARAM_PHASE} is removed from {@link UWSJob#inputParams inputParams} and nothing is done.</li> * </ul></p> * * @param params The UWS parameters to update. @@ -972,10 +964,8 @@ public class UWSJob extends SerializableUWSObject { * * @throws UWSException If a parameter value is incorrect or if the given user can not update or execute this job. * - * @see #loadDefaultParams(Map) * @see JobPhase#isJobUpdatable() - * @see #loadAdditionalParams() - * @see #applyPhaseParam() + * @see #applyPhaseParam(JobOwner) */ public boolean addOrUpdateParameters(UWSParameters params, final JobOwner user) throws UWSException{ // The job can be modified ONLY IF in PENDING phase: @@ -1310,7 +1300,7 @@ public class UWSJob extends SerializableUWSObject { * <p>Stops immediately the job, sets its phase to {@link ExecutionPhase#ABORTED ABORTED} and sets its end time.</p> * * <p><b><u>IMPORTANT:</u> If the thread does not stop immediately the phase and the end time are not modified. However it can be done by calling one more time {@link #abort()}. - * Besides you should check that you test regularly the interrupted flag of the thread in {@link #jobWork()} !</b></p> + * Besides you should check that you test regularly the interrupted flag of the thread in {@link JobThread#jobWork()} !</b></p> * * @throws UWSException If there is an error while changing the execution phase. * @@ -1341,7 +1331,7 @@ public class UWSJob extends SerializableUWSObject { * * <p><b><u>IMPORTANT:</u> If the thread does not stop immediately the phase, the error summary and the end time are not modified. * However it can be done by calling one more time {@link #error(ErrorSummary)}. - * Besides you should check that you test regularly the interrupted flag of the thread in {@link #jobWork()} !</b></p> + * Besides you should check that you test regularly the interrupted flag of the thread in {@link JobThread#jobWork()} !</b></p> * * @param error The error that has interrupted this job. * diff --git a/src/uws/job/manager/AbstractQueuedExecutionManager.java b/src/uws/job/manager/AbstractQueuedExecutionManager.java index 3fa56c2..41f84a8 100644 --- a/src/uws/job/manager/AbstractQueuedExecutionManager.java +++ b/src/uws/job/manager/AbstractQueuedExecutionManager.java @@ -123,7 +123,7 @@ public abstract class AbstractQueuedExecutionManager implements ExecutionManager /* **************************** */ /** * <p>Removes the first queued job(s) from the queue and executes it (them) - * <b>ONLY IF</b> it (they) can be executed (see {@link #isReadyForExecution(AbstractJob)}).</p> + * <b>ONLY IF</b> it (they) can be executed (see {@link #isReadyForExecution(UWSJob)}).</p> * * <p><i>Note: * Nothing is done if there is no queue. @@ -187,11 +187,11 @@ public abstract class AbstractQueuedExecutionManager implements ExecutionManager * @return The resulting execution phase of the given job ({@link ExecutionPhase#EXECUTING EXECUTING} or {@link ExecutionPhase#QUEUED QUEUED} or <i>null</i> if the given job is <i>null</i>). * * @see #refresh() - * @see AbstractJob#isRunning() + * @see UWSJob#isRunning() * @see #isReadyForExecution(UWSJob) * @see UWSJob#setPhase(ExecutionPhase) * - * @see uws.job.manager.ExecutionManager#execute(AbstractJob) + * @see uws.job.manager.ExecutionManager#execute(UWSJob) */ @Override public synchronized final ExecutionPhase execute(final UWSJob jobToExecute){ diff --git a/src/uws/job/parameters/UWSParameters.java b/src/uws/job/parameters/UWSParameters.java index 3609e1e..734a79f 100644 --- a/src/uws/job/parameters/UWSParameters.java +++ b/src/uws/job/parameters/UWSParameters.java @@ -48,7 +48,7 @@ import uws.service.request.UploadFile; * <p> * It is possible to check the value of some or all parameters by calling the function {@link InputParamController#check(Object)} * of an {@link InputParamController} associated with the name of the parameter. Input parameter controllers can be - * provided at the creation of a {@link UWSParameters}. If none are given, default ones are used (see {@link #getDefaultUWSParamControllers()}) + * provided at the creation of a {@link UWSParameters}. If none are given, default ones are used (see {@link #getDefaultControllers()}) * for the standard UWS parameters (e.g. destruction time, duration, etc...). * </p> * @@ -177,14 +177,14 @@ public class UWSParameters implements Iterable<Entry<String,Object>> { * <p>Builds an empty list of UWS parameters.</p> * * <p><i><u>note:</u> Even if no controllers is provided, this constructor sets the default - * input parameter controllers (see {@link #getDefaultUWSParamControllers()}).</i></p> + * input parameter controllers (see {@link #getDefaultControllers()}).</i></p> * * @param expectedAdditionalParams The names of all expected additional parameters (MAY BE NULL). * <i><u>note:</u> they will be identified with no case sensitivity * and stored with the same case as in this collection.</i> * @param inputParamControllers Controllers of the input parameters (MAY BE NULL). * - * @see #getDefaultUWSParamControllers() + * @see #getDefaultControllers() */ public UWSParameters(final Collection<String> expectedAdditionalParams, final Map<String,InputParamController> inputParamControllers){ // Set the input parameter controllers: @@ -199,7 +199,7 @@ public class UWSParameters implements Iterable<Entry<String,Object>> { /** * <p>Extracts and identifies all UWS standard and non-standard parameters from the given {@link HttpServletRequest}.</p> * - * <p><i><u>note:</u> The default input parameter controllers are set by default (see {@link #getDefaultUWSParamControllers()}).</i></p> + * <p><i><u>note:</u> The default input parameter controllers are set by default (see {@link #getDefaultControllers()}).</i></p> * * @param request The request to parse to extract the parameters. * @@ -215,7 +215,7 @@ public class UWSParameters implements Iterable<Entry<String,Object>> { * <p>Extracts and identifies all UWS standard and non-standard parameters from the given {@link HttpServletRequest}.</p> * * <p><i><u>note:</u> Even if no controllers is provided, this constructor sets the default - * input parameter controllers (see {@link #getDefaultUWSParamControllers()}).</i></p> + * input parameter controllers (see {@link #getDefaultControllers()}).</i></p> * * @param request The request to parse to extract the parameters. * @param expectedAdditionalParams The names of all expected additional parameters. @@ -236,7 +236,7 @@ public class UWSParameters implements Iterable<Entry<String,Object>> { * * <p> * Since the version 4.1, parameters are extracted immediately when the request is received. They are then stored in an attribute - * under the name of {@value UWS#REQ_ATTRIBUTE_PARAMETERS}. Thus, the map of parameters can be got in that way. However, if this attribute + * under the name of {@link UWS#REQ_ATTRIBUTE_PARAMETERS}. Thus, the map of parameters can be got in that way. However, if this attribute * does not exist, this function will ask for the parameters extracted by {@link HttpServletRequest} ({@link HttpServletRequest#getParameterNames()} * and {@link HttpServletRequest#getParameter(String)}). In this last case only the last non-null occurrence of any parameter will be kept. * </p> @@ -284,7 +284,7 @@ public class UWSParameters implements Iterable<Entry<String,Object>> { /** * <p>Extracts and identifies all UWS standard and non-standard parameters from the map.</p> * - * <p><i><u>note:</u> The default input parameter controllers are set by default (see {@link #getDefaultUWSParamControllers()}).</i></p> + * <p><i><u>note:</u> The default input parameter controllers are set by default (see {@link #getDefaultControllers()}).</i></p> * * @param params A map of parameters. * @@ -300,7 +300,7 @@ public class UWSParameters implements Iterable<Entry<String,Object>> { * <p>Extracts and identifies all UWS standard and non-standard parameters from the map.</p> * * <p><i><u>note:</u> Even if no controllers is provided, this constructor sets the default - * input parameter controllers (see {@link #getDefaultUWSParamControllers()}).</i></p> + * input parameter controllers (see {@link #getDefaultControllers()}).</i></p> * * @param params A map of parameters. * @param expectedAdditionalParams The names of all expected additional parameters. @@ -341,25 +341,20 @@ public class UWSParameters implements Iterable<Entry<String,Object>> { /** * <p>Must return the input parameter controller of the specified parameter.</p> * - * <p><i><u>note 1:</u> This function is supposed to be case sensitive !</i></p> - * <p><i><u>note 2:</u> By default, this function just asks to the {@link UWS} thanks to the function {@link UWS#getInputParamController(String)}.</i></p> + * <p><i><u>note:</u> This function is supposed to be case sensitive !</i></p> * * @param inputParamName The name of the parameter whose the controller is asked. * - * @return The corresponding controller or <i>null</i> if there is no controller for the specified parameter - * or if this {@link UWSParameters} instance doesn't know a {@link UWS}. + * @return The corresponding controller or <i>null</i> if there is no controller for the specified parameter. */ protected InputParamController getController(final String inputParamName){ return mapParamControllers.get(inputParamName); } /** - * <p>Must return the list of all available input parameter controllers.</p> + * Must return the list of all available input parameter controllers. * - * <p><i><u>note:</u> By default, this function just asks to the {@link UWS} thanks to the function {@link UWS#getInputParamControllers()}.</i></p> - * - * @return The list of all available controllers or <i>null</i> if there is no controller - * or if this {@link UWSParameters} instance doesn't know a {@link UWS}. + * @return An iterator over all available controllers. */ protected Iterator<Entry<String,InputParamController>> getControllers(){ return mapParamControllers.entrySet().iterator(); diff --git a/src/uws/job/serializer/UWSSerializer.java b/src/uws/job/serializer/UWSSerializer.java index aa06abb..6a191d7 100644 --- a/src/uws/job/serializer/UWSSerializer.java +++ b/src/uws/job/serializer/UWSSerializer.java @@ -30,7 +30,6 @@ import uws.job.Result; import uws.job.UWSJob; import uws.job.user.JobOwner; import uws.service.UWS; -import uws.service.UWSService; import uws.service.UWSUrl; /** @@ -177,7 +176,7 @@ public abstract class UWSSerializer implements Serializable { * * @throws Exception If there is an error during the serialization. * - * @see UWSSerializer#getUWS(UWSService, String) + * @see UWSSerializer#getUWS(UWS, JobOwner) */ public String getUWS(final UWS uws) throws Exception{ return getUWS(uws, null); diff --git a/src/uws/service/UWS.java b/src/uws/service/UWS.java index 4820444..09d5e24 100644 --- a/src/uws/service/UWS.java +++ b/src/uws/service/UWS.java @@ -59,7 +59,7 @@ import uws.service.request.UWSRequestParser; * </p> * * <p><b>IMPORTANT: - * All implementations of this interface should implement properly the function {@link #closeService()} and should call it + * All implementations of this interface should implement properly the function {@link #destroy()} and should call it * when the JVM or the HTTP server application is closing. * </b></p> * @@ -123,7 +123,7 @@ public interface UWS extends Iterable<JobList> { /** * Adds a jobs list to this UWS. * - * @param jl The jobs list to add. + * @param newJL The jobs list to add. * * @return <i>true</i> if the jobs list has been successfully added, * <i>false</i> if the given jobs list is <i>null</i> or if a jobs list with this name already exists diff --git a/src/uws/service/UWSFactory.java b/src/uws/service/UWSFactory.java index 6860f5f..73507c2 100644 --- a/src/uws/service/UWSFactory.java +++ b/src/uws/service/UWSFactory.java @@ -96,7 +96,7 @@ public interface UWSFactory { /** * Lets extracting all parameters from the given request. * - * @param req The request from which parameters must be extracted. + * @param request The request from which parameters must be extracted. * * @return The extracted parameters. * diff --git a/src/uws/service/UWSService.java b/src/uws/service/UWSService.java index c0e65dc..2cfac56 100644 --- a/src/uws/service/UWSService.java +++ b/src/uws/service/UWSService.java @@ -29,17 +29,15 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Vector; +import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import uws.AcceptHeader; import uws.UWSException; import uws.UWSToolBox; -import uws.job.ExecutionPhase; import uws.job.JobList; import uws.job.JobThread; -import uws.job.UWSJob; -import uws.job.manager.DefaultExecutionManager; import uws.job.serializer.JSONSerializer; import uws.job.serializer.UWSSerializer; import uws.job.serializer.XMLSerializer; @@ -63,127 +61,81 @@ import uws.service.log.UWSLog.LogLevel; import uws.service.request.RequestParser; /** - * <h3>General description</h3> + * <p>This class implements directly the interface {@link UWS} and so, it represents the core of a UWS service.</p> * - * <p>An abstract facility to implement the <b>U</b>niversal <b>W</b>orker <b>S</b>ervice pattern.</p> + * <h3>Usage</h3> * - * <p>It can manage several jobs lists (create new, get and remove).</p> - * - * <p>It also interprets {@link HttpServletRequest}, applies the action specified in its given URL and parameters - * <i>(according to the <a href="http://www.ivoa.net/Documents/UWS/20100210">IVOA Proposed Recommendation of 2010-02-10</a>)</i> - * and returns the corresponding response in a {@link HttpServletResponse}.</p> - * - * <h3>The UWS URL interpreter</h3> - * - * <p>Any subclass of {@link UWSService} has one object called the UWS URL interpreter. It is stored in the field {@link #urlInterpreter}. - * It lets interpreting the URL of any received request. Thus you can know on which jobs list, job and/or job attribute(s) - * the request applies.</p> - * - * <p>This interpreter must be initialized with the base URL/URI of this UWS. By using the default constructor (the one with no parameter), - * the URL interpreter will be built at the first request (see {@link UWSUrl#UWSUrl(HttpServletRequest)}) and so the base URI is - * extracted directly from the request).</p> - * - * <p>You want to set another base URI or to use a custom URL interpreter, you have to set yourself the interpreter - * by using the method {@link #setUrlInterpreter(UWSUrl)}.</p> + * <p> + * Using this class is very simple! An instance must be created by providing at a factory - {@link UWSFactory} - and a file manager - {@link UWSFileManager}. + * This creation must be done in the init() function of a {@link HttpServlet}. Then, still in init(), at least one job list must be created. + * Finally, in order to ensure that all requests are interpreted by the UWS service, they must be sent to the created {@link UWSService} in the function + * {@link #executeRequest(HttpServletRequest, HttpServletResponse)}. + * </p> + * <p>Here is an example of what should look like the servlet class:</p> + * <pre> + * public class MyUWSService extends HttpServlet { + * private UWS uws; * - * <h3>Create a job</h3> + * public void init(ServletConfig config) throws ServletException { + * try{ + * // Create the UWS service: + * uws = new UWSService(new MyUWSFactory(), new LocalUWSFileManager(new File(config.getServletContext().getRealPath("UWSFiles")))); + * // Create at least one job list (otherwise no job can be started): + * uws.addJobList("jobList"); + * }catch(UWSException ue){ + * throw new ServletException("Can not initialize the UWS service!", ue); + * } + * } * - * <p>The most important abstract function of this class is {@link UWSService#createJob(Map)}. It allows to create an instance - * of the type of job which is managed by this UWS. The only parameter is a map of a job attributes. It is the same map that - * take the functions {@link UWSJob#UWSJob(Map)} and {@link UWSJob#addOrUpdateParameters(Map)}.</p> + * public void destroy(){ + * if (uws != null) + * uws.destroy(); + * } * - * <p>There are two convenient implementations of this abstract method in {@link BasicUWS} and {@link ExtendedUWS}. These two implementations - * are based on the Java Reflection.</p> + * public void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException{ + * try{ + * service.executeRequest(request, response); + * }catch(UWSException ue){ + * response.sendError(ue.getHttpErrorCode(), ue.getMessage()); + * } + * } + * } + * </pre> * * <h3>UWS actions</h3> * - * <p>All the actions described in the IVOA recommendation are already managed. Each of these actions are defined in - * an instance of {@link UWSAction}:</p> + * <p> + * All standard UWS actions are already implemented in this class. However, it is still possible to modify their implementation and/or to + * add or remove some actions. + * </p> + * <p> + * A UWS action is actually implemented here by a class extending the abstract class {@link UWSAction}. Here is the full list of all + * the available and already implemented actions: + * </p> * <ul> - * <li>{@link UWSAction#LIST_JOBS LIST_JOBS}: see the class {@link ListJobs}</li> - * <li>{@link UWSAction#ADD_JOB ADD_JOB}: see the class {@link AddJob}</li> - * <li>{@link UWSAction#DESTROY_JOB DESTROY_JOB}: see the class {@link DestroyJob}</li> - * <li>{@link UWSAction#JOB_SUMMARY JOB_SUMMARY}: see the class {@link JobSummary}</li> - * <li>{@link UWSAction#GET_JOB_PARAM GET_JOB_PARAM}: see the class {@link GetJobParam}</li> - * <li>{@link UWSAction#SET_JOB_PARAM SET_JOB_PARAM}: see the class {@link SetJobParam}</li> - * <li>{@link UWSAction#HOME_PAGE HOME_PAGE}: see the class {@link ShowHomePage}</li> + * <li>{@link AddJob}</li> + * <li>{@link DestroyJob}</li> + * <li>{@link JobSummary}</li> + * <li>{@link GetJobParam}</li> + * <li>{@link SetJobParam}</li> + * <li>{@link ListJobs}</li> * </ul> - * - * <p><b>However you can add your own UWS actions !</b> To do that you just need to implement the abstract class {@link UWSAction} - * and to call the method {@link #addUWSAction(UWSAction)} with an instance of this implementation.</p> - * - * <p><b><u>IMPORTANT:</u> You must be careful when you override the function {@link UWSAction#match(UWSUrl, String, HttpServletRequest)} - * so that your test is as precise as possible ! Indeed the order in which the actions of a UWS are evaluated is very important !<br /> - * <u>If you want to be sure your custom UWS action is always evaluated before any other UWS action you can use the function - * {@link #addUWSAction(int, UWSAction)} with 0 as first parameter !</u></b></p> - * - * <p><i><u>Note:</u> You can also replace an existing UWS action thanks to the method {@link #replaceUWSAction(UWSAction)} or - * {@link #setUWSAction(int, UWSAction)} !</i></p> - * - * <h3>User identification</h3> - * - * <p>Some UWS actions need to know the current user so that they can adapt their response (i.e. LIST_JOBS must return the jobs of only - * one user: the current one). Thus, before executing a UWS action (and even before choosing the good action in function of the request) - * the function {@link UserIdentifier#extractUserId(UWSUrl, HttpServletRequest)} is called. Its goal - * is to identify the current user in function of the received request.</p> - * * <p> - * <i><u>Notes:</u> - * <ul> - * <li>If this function returns NULL, the UWS actions must be executed on all jobs, whatever is their owner !</li> - * <li>{@link UserIdentifier} is an interface. So you must implement it and then set its extension to this UWS - * by using {@link #setUserIdentifier(UserIdentifier)}.</li> - * </ul> - * </i></p> + * To add an action, you should use the function {@link #addUWSAction(UWSAction)}, to remove one {@link #removeUWSAction(int)} or {@link #removeUWSAction(String)}. + * Note that this last function takes a String parameter. This parameter is the name of the UWS action to remove. Indeed, each UWS action must have an internal + * name representing the action. Thus, it is possible to replace a UWS action implementation by using the function {@link #replaceUWSAction(UWSAction)} ; this + * function will replace the action having the same name as the given action. * </p> * - * <h3>Queue management</h3> - * - * <p>One of the goals of a UWS is to manage an execution queue for all managed jobs. This task is given to an instance - * of {@link DefaultExecutionManager}, stored in the field {@link #executionManager}. Each time a job is created, - * the UWS sets it the execution manager (see {@link AddJob}). Thus the {@link UWSJob#start()} method will ask to the manager - * whether it can execute now or whether it must be put in a {@link ExecutionPhase#QUEUED QUEUED} phase until enough resources are available for its execution.</p> - * - * <p>By extending the class {@link DefaultExecutionManager} and by overriding {@link DefaultExecutionManager#isReadyForExecution(UWSJob)} - * you can change the condition which puts a job in the {@link ExecutionPhase#EXECUTING EXECUTING} or in the {@link ExecutionPhase#QUEUED QUEUED} phase. By default, a job is put - * in the {@link ExecutionPhase#QUEUED QUEUED} phase if there are more running jobs than a given number.</p> - * - * <p>With this manager it is also possible to list all running jobs in addition of all queued jobs, thanks to the methods: - * {@link DefaultExecutionManager#getRunningJobs()}, {@link DefaultExecutionManager#getQueuedJobs()}, {@link DefaultExecutionManager#getNbRunningJobs()} - * and {@link DefaultExecutionManager#getNbQueuedJobs()}.</p> - * - * <h3>Serializers & MIME types</h3> - * - * <p>According to the IVOA recommendation, the XML format is the default format in which each UWS resource must be returned. However it - * is told that other formats can also be managed. To allow that, {@link UWSService} manages a list of {@link UWSSerializer} and - * lets define which is the default one to use. <i>By default, there are two serializers: {@link XMLSerializer} (the default choice) - * and {@link JSONSerializer}.</i></p> - * - * <p>One proposed way to choose automatically the format to use is to look at the Accept header of a HTTP-Request. This header field is - * a list of MIME types (each one with a quality - a sort of priority). Thus each {@link UWSSerializer} is associated with a MIME type so - * that {@link UWSService} can choose automatically the preferred format and so, the serializer to use.</p> + * <h3>Home page</h3> * - * <p><b><u>WARNING:</u> Only one {@link UWSSerializer} can be associated with a given MIME type in an {@link UWSService} instance ! - * Thus, if you add a {@link UWSSerializer} to a UWS, and this UWS has already a serializer for the same MIME type, - * it will be replaced by the added one.</b></p> - * - * <p><i><u>Note:</u> A XML document can be linked to a XSLT style-sheet. By using the method {@link XMLSerializer#setXSLTPath(String)} - * you can define the path/URL of the XLST to link to each UWS resource. <br /> - * <u>Since the {@link XMLSerializer} is the default format for a UWS resource you can also use the function - * {@link UWSService#setXsltURL(String)} !</u></i></p> - * - * <h3>The UWS Home page</h3> - * - * <p>As for a job or a jobs list, a UWS is also a UWS resource. That's why it can also be serialized !</p> - * - * <p>However in some cases it could more interesting to substitute this resource by a home page of the whole UWS by using the function: - * {@link #setHomePage(String)} or {@link #setHomePage(URL, boolean)}. + * <p> + * In addition of all the actions listed above, a last action is automatically added: {@link ShowHomePage}. This is the action which will display the home page of + * the UWS service. It is called when the root resource of the web service is asked. To change it, you can either overwrite this action + * (see {@link #replaceUWSAction(UWSAction)}) or set an home page URL with the function {@link #setHomePage(String)} <i>(the parameter is a URI pointing on either + * a local or a remote resource)</i> or {@link #setHomePage(URL, boolean)}. * </p> * - * <p><i><u>Note:</u> To go back to the UWS serialization (that is to say to abort a call to {@link #setHomePage(String)}), - * use the method {@link #setDefaultHomePage()} !</i></p> - * - * * @author Grégory Mantelet (CDS;ARI) * @version 4.1 (04/2015) */ @@ -571,7 +523,7 @@ public class UWSService implements UWS { /** * <p> * Sets its backup manager. - * This manager will be called at each user action to save only its own jobs list by calling {@link UWSBackupManager#saveOwner(String)}. + * This manager will be called at each user action to save only its own jobs list by calling {@link UWSBackupManager#saveOwner(JobOwner)}. * </p> * * @param backupManager Its new backup manager. @@ -826,7 +778,7 @@ public class UWSService implements UWS { * <i>false</i> if the given jobs list is <i>null</i> or if a jobs list with this name already exists * or if a UWS is already associated with another UWS. * - * @see JobList#setUWS(AbstractUWS) + * @see JobList#setUWS(UWS) * @see UWS#addJobList(JobList) */ @Override @@ -860,7 +812,7 @@ public class UWSService implements UWS { * @return <i>true</i> if the given jobs list has been destroyed, <i>false</i> otherwise. * * @see JobList#clear() - * @see JobList#setUWS(UWSService) + * @see JobList#setUWS(UWS) */ public boolean destroyJobList(JobList jl){ if (jl == null) @@ -896,7 +848,7 @@ public class UWSService implements UWS { * <p>Lets adding the given action to this UWS.</p> * * <p><b><u>WARNING:</u> The action will be added at the end of the actions list of this UWS. That means, it will be evaluated (call of - * the method {@link UWSAction#match(UWSUrl, String, HttpServletRequest)}) lastly !</b></p> + * the method {@link UWSAction#match(UWSUrl, JobOwner, HttpServletRequest)}) lastly !</b></p> * * @param action The UWS action to add. * @@ -1070,7 +1022,7 @@ public class UWSService implements UWS { * <li>Load the request in the UWS URL interpreter (see {@link UWSUrl#load(HttpServletRequest)})</li> * <li>Extract the user ID (see {@link UserIdentifier#extractUserId(UWSUrl, HttpServletRequest)})</li> * <li>Iterate - in order - on all available actions and apply the first which matches. - * (see {@link UWSAction#match(UWSUrl, String, HttpServletRequest)} and {@link UWSAction#apply(UWSUrl, String, HttpServletRequest, HttpServletResponse)})</li> + * (see {@link UWSAction#match(UWSUrl, JobOwner, HttpServletRequest)} and {@link UWSAction#apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse)})</li> * </ol> * * @param request The UWS request. @@ -1084,8 +1036,8 @@ public class UWSService implements UWS { * @see UWSUrl#UWSUrl(HttpServletRequest) * @see UWSUrl#load(HttpServletRequest) * @see UserIdentifier#extractUserId(UWSUrl, HttpServletRequest) - * @see UWSAction#match(UWSUrl, String, HttpServletRequest) - * @see UWSAction#apply(UWSUrl, String, HttpServletRequest, HttpServletResponse) + * @see UWSAction#match(UWSUrl, JobOwner, HttpServletRequest) + * @see UWSAction#apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse) */ public boolean executeRequest(HttpServletRequest request, HttpServletResponse response) throws UWSException, IOException{ if (request == null || response == null) @@ -1240,10 +1192,10 @@ public class UWSService implements UWS { * @param response The response in which the error must be published. * * @throws IOException If there is an error when calling {@link #redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse)} or {@link HttpServletResponse#sendError(int, String)}. - * @throws UWSException If there is an error when calling {@link #redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse))}. + * @throws UWSException If there is an error when calling {@link #redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse)}. * * @see #redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse) - * @see {@link ServiceErrorWriter#writeError(Throwable, HttpServletResponse, HttpServletRequest, JobOwner, String)} + * @see #sendError(Throwable, HttpServletRequest, String, JobOwner, String, HttpServletResponse) */ public final void sendError(UWSException error, HttpServletRequest request, String reqID, JobOwner user, String uwsAction, HttpServletResponse response) throws IOException, UWSException{ if (error.getHttpErrorCode() == UWSException.SEE_OTHER){ @@ -1273,7 +1225,7 @@ public class UWSService implements UWS { * * @throws IOException If there is an error when calling {@link HttpServletResponse#sendError(int, String)}. * - * @see {@link ServiceErrorWriter#writeError(Throwable, HttpServletResponse, HttpServletRequest, String, JobOwner, String)} + * @see ServiceErrorWriter#writeError(Throwable, HttpServletResponse, HttpServletRequest, String, JobOwner, String) */ public final void sendError(Throwable error, HttpServletRequest request, String reqID, JobOwner user, String uwsAction, HttpServletResponse response) throws IOException{ // Write the error in the response and return the appropriate HTTP status code: diff --git a/src/uws/service/UWSServlet.java b/src/uws/service/UWSServlet.java index 1f62ca7..d1bc01e 100644 --- a/src/uws/service/UWSServlet.java +++ b/src/uws/service/UWSServlet.java @@ -80,7 +80,7 @@ import uws.service.request.UploadFile; * <h3>UWS Definition</h3> * <p> * To create a such servlet, you have to extend this class. Once done, only two functions must be - * implemented: {@link #createJob(Map, JobOwner)} and {@link #initUWS()}. + * implemented: {@link #createJob(HttpServletRequest, JobOwner)} and {@link #initUWS()}. * </p> * <p> * The first one will be called by the library each time a job must be created. All the job parameters @@ -93,6 +93,24 @@ import uws.service.request.UploadFile; * <code> * addJobList(new JobList<MyJob>("jlName")); * </code> + * <p>The below code show an example of usage of this class:</p> + * <pre> + * public class MyUWSServlet extends UWSServlet { + * + * // Initialize the UWS service by creating at least one job list. + * public void initUWS() throws UWSException { + * addJobList(new JobList("jobList")); + * } + * + * // Create the job process corresponding to the job to execute ; generally, the process identification can be merely done by checking the job list name. + * public JobThread createJobThread(UWSJob job) throws UWSException { + * if (job.getJobList().getName().equals("jobList")) + * return new MyJobThread(job); + * else + * throw new UWSException("Impossible to create a job inside the jobs list \"" + job.getJobList().getName() + "\" !"); + * } + * } + * </pre> * <p> * The name and the description of the UWS may be specified in the web.xml file as init-param of the servlet: * <code>name</code> and <code>description</code>. The other way is to directly set the corresponding @@ -113,12 +131,12 @@ import uws.service.request.UploadFile; * These functions are: * </p> * <ul> - * <li>{@link #doAddJob(HttpServletRequest, HttpServletResponse, JobOwner)}</li> - * <li>{@link #doDestroyJob(HttpServletRequest, HttpServletResponse, JobOwner)}</li> - * <li>{@link #doGetJobParam(HttpServletRequest, HttpServletResponse, JobOwner)}</li> - * <li>{@link #doJobSummary(HttpServletRequest, HttpServletResponse, JobOwner)}</li> - * <li>{@link #doListJob(HttpServletRequest, HttpServletResponse, JobOwner)}</li> - * <li>{@link #doSetJobParam(HttpServletRequest, HttpServletResponse, JobOwner)}</li> + * <li>{@link #doAddJob(UWSUrl, HttpServletRequest, HttpServletResponse, JobOwner)}</li> + * <li>{@link #doDestroyJob(UWSUrl, HttpServletRequest, HttpServletResponse, JobOwner)}</li> + * <li>{@link #doGetJobParam(UWSUrl, HttpServletRequest, HttpServletResponse, JobOwner)}</li> + * <li>{@link #doJobSummary(UWSUrl, HttpServletRequest, HttpServletResponse, JobOwner)}</li> + * <li>{@link #doListJob(UWSUrl, HttpServletRequest, HttpServletResponse, JobOwner)}</li> + * <li>{@link #doSetJobParam(UWSUrl, HttpServletRequest, HttpServletResponse, JobOwner)}</li> * </ul> * <p> * They are all already implemented following their definition in the IVOA document. However, @@ -796,10 +814,10 @@ public abstract class UWSServlet extends HttpServlet implements UWS, UWSFactory * @param response The response in which the error must be published. * * @throws IOException If there is an error when calling {@link #redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse)} or {@link HttpServletResponse#sendError(int, String)}. - * @throws UWSException If there is an error when calling {@link #redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse))}. + * @throws UWSException If there is an error when calling {@link #redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse)}. * * @see #redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse) - * @see {@link ServiceErrorWriter#writeError(Throwable, HttpServletResponse, HttpServletRequest, JobOwner, String)} + * @see #sendError(Throwable, HttpServletRequest, String, JobOwner, String, HttpServletResponse) */ public final void sendError(UWSException error, HttpServletRequest request, String reqID, JobOwner user, String uwsAction, HttpServletResponse response) throws ServletException{ if (error.getHttpErrorCode() == UWSException.SEE_OTHER){ @@ -835,7 +853,7 @@ public abstract class UWSServlet extends HttpServlet implements UWS, UWSFactory * @throws IOException If there is an error when calling {@link HttpServletResponse#sendError(int, String)}. * @throws UWSException * - * @see {@link ServiceErrorWriter#writeError(Throwable, HttpServletResponse, HttpServletRequest, String, JobOwner, String)} + * @see ServiceErrorWriter#writeError(Throwable, HttpServletResponse, HttpServletRequest, String, JobOwner, String) */ public final void sendError(Throwable error, HttpServletRequest request, String reqID, JobOwner user, String uwsAction, HttpServletResponse response) throws ServletException{ // Write the error in the response and return the appropriate HTTP status code: @@ -1118,7 +1136,7 @@ public abstract class UWSServlet extends HttpServlet implements UWS, UWSFactory * @return <i>true</i> if the given jobs list has been destroyed, <i>false</i> otherwise. * * @see JobList#clear() - * @see JobList#setUWS(AbstractUWS) + * @see JobList#setUWS(UWS) */ public boolean destroyJobList(JobList jl){ if (jl == null) @@ -1275,7 +1293,7 @@ public abstract class UWSServlet extends HttpServlet implements UWS, UWSFactory /** * Sets the UWS URL interpreter to use in this UWS. * - * @param urlInterpreter Its new UWS URL interpreter (may be <i>null</i>. In this case, it will be created from the next request ; see {@link #executeRequest(HttpServletRequest, HttpServletResponse)}). + * @param urlInterpreter Its new UWS URL interpreter (may be <i>null</i>. In this case, it will be created from the next request ; see {@link #service(HttpServletRequest, HttpServletResponse)}). */ public final void setUrlInterpreter(UWSUrl urlInterpreter){ this.urlInterpreter = urlInterpreter; diff --git a/src/uws/service/UserIdentifier.java b/src/uws/service/UserIdentifier.java index 5ec66dc..af08b47 100644 --- a/src/uws/service/UserIdentifier.java +++ b/src/uws/service/UserIdentifier.java @@ -22,15 +22,13 @@ package uws.service; import java.io.Serializable; import java.util.Map; -import uws.job.user.JobOwner; - -import uws.service.UWSUrl; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import uws.UWSException; +import uws.job.user.JobOwner; import uws.service.actions.UWSAction; import uws.service.backup.DefaultUWSBackupManager; -import uws.UWSException; - -import javax.servlet.http.HttpServletRequest; /** * <p>Lets defining how identifying a user thanks to a HTTP request.</p> @@ -67,7 +65,7 @@ public interface UserIdentifier extends Serializable { * * @param id ID of the user. * @param pseudo Pseudo of the user (may be NULL). - * @param otherdata Other data about the user (may be NULL or empty). + * @param otherData Other data about the user (may be NULL or empty). * * @return The corresponding user. * diff --git a/src/uws/service/actions/AddJob.java b/src/uws/service/actions/AddJob.java index 2d5853e..3d00f3d 100644 --- a/src/uws/service/actions/AddJob.java +++ b/src/uws/service/actions/AddJob.java @@ -73,7 +73,7 @@ public class AddJob extends UWSAction { * <li>the UWS URL does not make a reference to a job (so: no job ID),</li> * <li>the HTTP method is HTTP-POST.</li> * </ul> - * @see uws.service.actions.UWSAction#match(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest) + * @see uws.service.actions.UWSAction#match(UWSUrl, JobOwner, HttpServletRequest) */ @Override public boolean match(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request) throws UWSException{ @@ -86,11 +86,10 @@ public class AddJob extends UWSAction { * * @see #getJobsList(UWSUrl) * @see uws.service.UWSFactory#createJob(HttpServletRequest, JobOwner) - * @see UWSService#setExecutionManager(uws.job.manager.ExecutionManager) * @see JobList#addNewJob(UWSJob) * @see UWSService#redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse) * - * @see uws.service.actions.UWSAction#apply(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + * @see uws.service.actions.UWSAction#apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse) */ @Override public boolean apply(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request, HttpServletResponse response) throws UWSException, IOException{ diff --git a/src/uws/service/actions/DestroyJob.java b/src/uws/service/actions/DestroyJob.java index de75e20..f2629e1 100644 --- a/src/uws/service/actions/DestroyJob.java +++ b/src/uws/service/actions/DestroyJob.java @@ -75,7 +75,7 @@ public class DestroyJob extends UWSAction { * <li>...<b>or</b> the HTTP method is HTTP-POST <b>and</b> there is the parameter {@link UWSJob#PARAM_ACTION PARAM_ACTION} (=ACTION) with the value {@link UWSJob#ACTION_DELETE ACTION_DELETE} (=DELETE).</li> * </ul> * - * @see uws.service.actions.UWSAction#match(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest) + * @see uws.service.actions.UWSAction#match(UWSUrl, JobOwner, HttpServletRequest) */ @Override public boolean match(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request) throws UWSException{ @@ -92,7 +92,7 @@ public class DestroyJob extends UWSAction { * @see JobList#destroyJob(String,JobOwner) * @see UWSService#redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse) * - * @see uws.service.actions.UWSAction#apply(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + * @see uws.service.actions.UWSAction#apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse) */ @Override public boolean apply(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request, HttpServletResponse response) throws UWSException, IOException{ diff --git a/src/uws/service/actions/GetJobParam.java b/src/uws/service/actions/GetJobParam.java index 37b23ba..be56b1a 100644 --- a/src/uws/service/actions/GetJobParam.java +++ b/src/uws/service/actions/GetJobParam.java @@ -82,7 +82,7 @@ public class GetJobParam extends UWSAction { * <li>the HTTP method is HTTP-GET.</li> * </ul> * - * @see uws.service.actions.UWSAction#match(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest) + * @see uws.service.actions.UWSAction#match(UWSUrl, JobOwner, HttpServletRequest) */ @Override public boolean match(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request) throws UWSException{ @@ -96,11 +96,11 @@ public class GetJobParam extends UWSAction { * <p><i><u>Note:</u> if the specified attribute is simple (i.e. jobID, runID, startTime, ...) it will not serialized ! The response will * merely be the job attribute value (so, the content type will be: text/plain).</i></p> * - * @see #getJob(UWSUrl, String) + * @see #getJob(UWSUrl) * @see UWSService#getSerializer(String) * @see UWSJob#serialize(ServletOutputStream, UWSSerializer) * - * @see uws.service.actions.UWSAction#apply(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + * @see uws.service.actions.UWSAction#apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse) */ @Override public boolean apply(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request, HttpServletResponse response) throws UWSException, IOException{ diff --git a/src/uws/service/actions/JobSummary.java b/src/uws/service/actions/JobSummary.java index e6cdee2..e35e1d8 100644 --- a/src/uws/service/actions/JobSummary.java +++ b/src/uws/service/actions/JobSummary.java @@ -76,7 +76,7 @@ public class JobSummary extends UWSAction { * <li>the HTTP method is HTTP-GET.</li> * </ul> * - * @see uws.service.actions.UWSAction#match(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest) + * @see uws.service.actions.UWSAction#match(UWSUrl, JobOwner, HttpServletRequest) */ @Override public boolean match(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request) throws UWSException{ @@ -87,11 +87,11 @@ public class JobSummary extends UWSAction { * Gets the specified job <i>(and throw an error if not found)</i>, * chooses the serializer and write the serialization of the job in the given response. * - * @see #getJob(UWSUrl, String) + * @see #getJob(UWSUrl) * @see UWSService#getSerializer(String) * @see UWSJob#serialize(ServletOutputStream, UWSSerializer) * - * @see uws.service.actions.UWSAction#apply(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + * @see uws.service.actions.UWSAction#apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse) */ @Override public boolean apply(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request, HttpServletResponse response) throws UWSException, IOException{ diff --git a/src/uws/service/actions/ListJobs.java b/src/uws/service/actions/ListJobs.java index 83a7a71..2ce5c85 100644 --- a/src/uws/service/actions/ListJobs.java +++ b/src/uws/service/actions/ListJobs.java @@ -75,7 +75,7 @@ public class ListJobs extends UWSAction { * <li>the HTTP method is HTTP-GET.</li> * </ul> * - * @see uws.service.actions.UWSAction#match(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest) + * @see uws.service.actions.UWSAction#match(UWSUrl, JobOwner, HttpServletRequest) */ @Override public boolean match(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request) throws UWSException{ @@ -88,9 +88,9 @@ public class ListJobs extends UWSAction { * * @see #getJobsList(UWSUrl) * @see UWSService#getSerializer(String) - * @see JobList#serialize(ServletOutputStream, UWSSerializer, String) + * @see JobList#serialize(ServletOutputStream, UWSSerializer, JobOwner) * - * @see uws.service.actions.UWSAction#apply(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + * @see uws.service.actions.UWSAction#apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse) */ @Override public boolean apply(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request, HttpServletResponse response) throws UWSException, IOException{ diff --git a/src/uws/service/actions/SetJobParam.java b/src/uws/service/actions/SetJobParam.java index df67887..51d848b 100644 --- a/src/uws/service/actions/SetJobParam.java +++ b/src/uws/service/actions/SetJobParam.java @@ -30,6 +30,7 @@ import uws.UWSToolBox; import uws.job.UWSJob; import uws.job.parameters.UWSParameters; import uws.job.user.JobOwner; +import uws.service.UWSFactory; import uws.service.UWSService; import uws.service.UWSUrl; import uws.service.log.UWSLog.LogLevel; @@ -75,7 +76,7 @@ public class SetJobParam extends UWSAction { * <li>if the HTTP method is HTTP-PUT: there are at least two attributes ({@link UWSJob#PARAM_PARAMETERS}/{parameter_name}) <b>and</b> there are at least two parameters</li> * </ul> * - * @see uws.service.actions.UWSAction#match(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest) + * @see uws.service.actions.UWSAction#match(UWSUrl, JobOwner, HttpServletRequest) */ @Override public boolean match(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request) throws UWSException{ @@ -87,12 +88,11 @@ public class SetJobParam extends UWSAction { * changes the value of the specified job attribute * and makes a redirection to the job summary.</p> * - * @see #getJob(UWSUrl, String) - * @see UWSService#createUWSParameters(HttpServletRequest) - * @see UWSJob#addOrUpdateParameters(java.util.Map) + * @see #getJob(UWSUrl) + * @see UWSFactory#createUWSParameters(HttpServletRequest) + * @see UWSJob#addOrUpdateParameters(UWSParameters, JobOwner) * @see UWSService#redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse) - * - * @see uws.service.actions.UWSAction#apply(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + * @see uws.service.actions.UWSAction#apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse) */ @Override public boolean apply(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request, HttpServletResponse response) throws UWSException, IOException{ diff --git a/src/uws/service/actions/SetUWSParameter.java b/src/uws/service/actions/SetUWSParameter.java index 832823a..5364b3e 100644 --- a/src/uws/service/actions/SetUWSParameter.java +++ b/src/uws/service/actions/SetUWSParameter.java @@ -72,7 +72,7 @@ public class SetUWSParameter extends UWSAction { * <li>the job attribute "phase", "runID", "executionduration" or "destruction" is used in the UWS URL, * <li>the HTTP method is HTTP-POST or HTTP-PUT.</li> * </ul> - * @see uws.service.actions.UWSAction#match(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest) + * @see uws.service.actions.UWSAction#match(UWSUrl, JobOwner, HttpServletRequest) */ @Override public boolean match(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request) throws UWSException{ @@ -87,7 +87,7 @@ public class SetUWSParameter extends UWSAction { * @see UWSJob#addOrUpdateParameter(String, Object) * @see UWSService#redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse) * - * @see uws.service.actions.UWSAction#apply(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + * @see uws.service.actions.UWSAction#apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse) */ @Override public boolean apply(UWSUrl urlInterpreter, JobOwner user, HttpServletRequest request, HttpServletResponse response) throws UWSException, IOException{ diff --git a/src/uws/service/actions/ShowHomePage.java b/src/uws/service/actions/ShowHomePage.java index bba81eb..d40c892 100644 --- a/src/uws/service/actions/ShowHomePage.java +++ b/src/uws/service/actions/ShowHomePage.java @@ -83,7 +83,7 @@ public class ShowHomePage extends UWSAction { * <ul> * <li><b>Default home page ({@link UWSService#isDefaultHomePage()} returns <i>true</i>):</b> * write the appropriate (considering the Accept header of the HTTP-Request) serialization of this UWS.</li> - * <li><b>Home redirection ({@link UWSService#isHomePageRedirection()} = <i>true</i>):</b> call {@link UWSService#redirect(String, HttpServletRequest, HttpServletResponse)} with the {@link UWSService#getHomePage()} URL.</li> + * <li><b>Home redirection ({@link UWSService#isHomePageRedirection()} = <i>true</i>):</b> call {@link UWSService#redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse)} with the {@link UWSService#getHomePage()} URL.</li> * <li><b>Otherwise (({@link UWSService#isHomePageRedirection()} = <i>false</i>)):</b> read the content of the resource at the {@link UWSService#getHomePage()} URL and copy it in the given {@link HttpServletResponse}.</li> * </ul> * @@ -92,7 +92,7 @@ public class ShowHomePage extends UWSAction { * @throws IOException If there is an error while reading at a custom home page URL * or while writing in the given HttpServletResponse. * - * @see uws.service.actions.UWSAction#apply(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + * @see uws.service.actions.UWSAction#apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse) * @see UWSService#redirect(String, HttpServletRequest, JobOwner, String, HttpServletResponse) */ @Override diff --git a/src/uws/service/actions/UWSAction.java b/src/uws/service/actions/UWSAction.java index ed78cfb..5cd0344 100644 --- a/src/uws/service/actions/UWSAction.java +++ b/src/uws/service/actions/UWSAction.java @@ -162,7 +162,7 @@ public abstract class UWSAction implements Serializable { * <p>Extracts the job ID from the given UWS URL * and gets the corresponding job from the UWS.</p> * - * <p><i><u>Note:</u> This function calls {@link #getJob(UWSUrl, String, boolean)} with userId=null and checkUser=false !</i></p> + * <p><i><u>Note:</u> This function calls {@link #getJob(UWSUrl, JobOwner)} with userId=null and checkUser=false !</i></p> * * @param urlInterpreter The UWS URL which contains the ID of the job to get. * @@ -172,7 +172,7 @@ public abstract class UWSAction implements Serializable { * or if there are no corresponding jobs list and/or job in the UWS * or if the specified user has not enough rights to get the specified job. * - * @see #getJob(UWSUrl, String, boolean) + * @see #getJob(UWSUrl, JobOwner) */ protected final UWSJob getJob(UWSUrl urlInterpreter) throws UWSException{ return getJob(urlInterpreter, (JobOwner)null); @@ -193,7 +193,7 @@ public abstract class UWSAction implements Serializable { * * @see UWSUrl#getJobId() * @see #getJobsList(UWSUrl) - * @see JobList#getJob(String,String) + * @see JobList#getJob(String, JobOwner) * * @since 3.1 */ @@ -215,7 +215,7 @@ public abstract class UWSAction implements Serializable { /** * <p>Extracts the job ID from the given UWS URL and gets the corresponding job from the given jobs list.</p> * - * <p><i><u>Note:</u> This function calls {@link #getJob(UWSUrl, JobList, String, boolean)} with userId=null and checkUser=false !</i></p> + * <p><i><u>Note:</u> This function calls {@link #getJob(UWSUrl, JobList, JobOwner)} with userId=null and checkUser=false !</i></p> * * @param urlInterpreter The UWS URL which contains the ID of the job to get. * @param jobsList The jobs list which is supposed to contain the job to get. @@ -225,7 +225,7 @@ public abstract class UWSAction implements Serializable { * @throws UWSException If no job ID can be found in the given UWS URL * or if there are no corresponding job in the UWS. * - * @see #getJob(UWSUrl, JobList, String, boolean) + * @see #getJob(UWSUrl, JobList, JobOwner) */ protected final UWSJob getJob(UWSUrl urlInterpreter, JobList jobsList) throws UWSException{ return getJob(urlInterpreter, jobsList, null); @@ -246,8 +246,7 @@ public abstract class UWSAction implements Serializable { * or if the specified user has not enough rights. * * @see UWSUrl#getJobId() - * @see JobList#getJob(String) - * @see JobList#getJob(String,String) + * @see JobList#getJob(String, JobOwner) * * @since 3.1 */ diff --git a/src/uws/service/backup/DefaultUWSBackupManager.java b/src/uws/service/backup/DefaultUWSBackupManager.java index 3081bed..22393f8 100644 --- a/src/uws/service/backup/DefaultUWSBackupManager.java +++ b/src/uws/service/backup/DefaultUWSBackupManager.java @@ -50,7 +50,6 @@ import uws.job.JobList; import uws.job.Result; import uws.job.UWSJob; import uws.job.parameters.UWSParameters; -import uws.job.serializer.JSONSerializer; import uws.job.user.JobOwner; import uws.service.UWS; import uws.service.file.UWSFileManager; @@ -114,7 +113,7 @@ public class DefaultUWSBackupManager implements UWSBackupManager { * * @param uws The UWS to save/restore. * - * @see #DefaultBackupManager(UWS, long) + * @see #DefaultUWSBackupManager(UWS, long) */ public DefaultUWSBackupManager(final UWS uws){ this(uws, DEFAULT_FREQUENCY); @@ -157,7 +156,7 @@ public class DefaultUWSBackupManager implements UWSBackupManager { * * @throws UWSException If the user identification is disabled (that's to say, if the given UWS has no UserIdentifier) while the parameter <i>byUser</i> is <i>true</i>. * - * @see #DefaultBackupManager(UWS, boolean, long) + * @see #DefaultUWSBackupManager(UWS, boolean, long) */ public DefaultUWSBackupManager(final UWS uws, final boolean byUser) throws UWSException{ this(uws, byUser, byUser ? AT_USER_ACTION : DEFAULT_FREQUENCY); @@ -525,7 +524,7 @@ public class DefaultUWSBackupManager implements UWSBackupManager { * * <p> * <i><u>note</u>: - * the structure of the returned JSON object is decided by {@link JSONSerializer#getJson(UWSJob)}. + * the structure of the returned JSON object is decided by {@link Json4Uws#getJson(UWSJob)}. * Only one attribute is added: "jobListName". * </i></p> * @@ -1051,7 +1050,7 @@ public class DefaultUWSBackupManager implements UWSBackupManager { * * @throws UWSException If there is an error while restoring one of the result. * - * @see {@link #getResult(JSONObject)} + * @see #getResult(JSONObject) */ protected ArrayList<Result> getResults(final JSONArray array) throws UWSException{ if (array == null || array.length() == 0) diff --git a/src/uws/service/backup/UWSBackupManager.java b/src/uws/service/backup/UWSBackupManager.java index 52ae168..6e50956 100644 --- a/src/uws/service/backup/UWSBackupManager.java +++ b/src/uws/service/backup/UWSBackupManager.java @@ -32,7 +32,7 @@ public interface UWSBackupManager { /** * Enables/Disables the backup of the associated UWS. * - * @param enableBackup <i>true</i> to enable the backup, <i>false</i> otherwise. + * @param enabled <i>true</i> to enable the backup, <i>false</i> otherwise. */ public void setEnabled(final boolean enabled); diff --git a/src/uws/service/error/DefaultUWSErrorWriter.java b/src/uws/service/error/DefaultUWSErrorWriter.java index 345d1c2..71ec87e 100644 --- a/src/uws/service/error/DefaultUWSErrorWriter.java +++ b/src/uws/service/error/DefaultUWSErrorWriter.java @@ -165,7 +165,7 @@ public class DefaultUWSErrorWriter implements ServiceErrorWriter { * <p>The format is chosen thanks to the Accept header of the HTTP request. * If unknown, the HTML output is chosen.</p> * - * @param t Exception to format and to write. + * @param message Error message to write. * @param type Type of the error: FATAL or TRANSIENT. * @param httpErrorCode HTTP error code (i.e. 404, 500). * @param reqID ID of the request at the origin of the specified error. @@ -176,8 +176,8 @@ public class DefaultUWSErrorWriter implements ServiceErrorWriter { * * @throws IOException If there is an error while writing the given exception. * - * @see #formatHTMLError(Throwable, boolean, ErrorType, int, String, JobOwner, HttpServletResponse) - * @see #formatJSONError(Throwable, boolean, ErrorType, int, String, JobOwner, HttpServletResponse) + * @see #formatHTMLError(String, ErrorType, int, String, String, JobOwner, HttpServletResponse) + * @see #formatJSONError(String, ErrorType, int, String, String, JobOwner, HttpServletResponse) */ protected void formatError(final String message, final ErrorType type, final int httpErrorCode, final String reqID, final String action, final JobOwner user, final HttpServletResponse response, final String acceptHeader) throws IOException{ String format = chooseFormat(acceptHeader); @@ -191,7 +191,7 @@ public class DefaultUWSErrorWriter implements ServiceErrorWriter { * <p>Formats and writes the given error in the HTTP servlet response.</p> * <p>A full HTML response is printed with: the HTTP error code, the error type, the name of the exception, the message and the full stack trace.</p> * - * @param t Exception to format and to write. + * @param message Error message to write. * @param type Type of the error: FATAL or TRANSIENT. * @param httpErrorCode HTTP error code (i.e. 404, 500). * @param reqID ID of the request at the origin of the specified error. @@ -274,7 +274,7 @@ public class DefaultUWSErrorWriter implements ServiceErrorWriter { * <p>Formats and writes the given error in the HTTP servlet response.</p> * <p>A JSON response is printed with: the HTTP error code, the error type, the name of the exception, the message and the list of all causes' message.</p> * - * @param t Exception to format and to write. + * @param message Error message to write. * @param type Type of the error: FATAL or TRANSIENT. * @param httpErrorCode HTTP error code (i.e. 404, 500). * @param reqID ID of the request at the origin of the specified error. diff --git a/src/uws/service/error/ServiceErrorWriter.java b/src/uws/service/error/ServiceErrorWriter.java index a1cea7d..04c2936 100644 --- a/src/uws/service/error/ServiceErrorWriter.java +++ b/src/uws/service/error/ServiceErrorWriter.java @@ -120,7 +120,7 @@ public interface ServiceErrorWriter { public void writeError(final Throwable t, final ErrorSummary error, final UWSJob job, final OutputStream output) throws IOException; /** - * <p>Get the MIME type of the error details written by {@link #writeError(UWSJob, Throwable, ErrorSummary, OutputStream)} in the error summary.</p> + * <p>Get the MIME type of the error details written by {@link #writeError(Throwable, ErrorSummary, UWSJob, OutputStream)} in the error summary.</p> * * <p><i><b>Important note:</b> * If NULL is returned, the MIME type will be considered as <i>text/plain</i>. @@ -128,7 +128,7 @@ public interface ServiceErrorWriter { * * @return MIME type of the error details document. If NULL, it will be considered as text/plain. * - * @see #writeError(UWSJob, Throwable, ErrorSummary, OutputStream) + * @see #writeError(Throwable, ErrorSummary, UWSJob, OutputStream) * * @since 4.1 */ diff --git a/src/uws/service/file/LocalUWSFileManager.java b/src/uws/service/file/LocalUWSFileManager.java index c3f25fa..0bbb628 100644 --- a/src/uws/service/file/LocalUWSFileManager.java +++ b/src/uws/service/file/LocalUWSFileManager.java @@ -54,7 +54,7 @@ import uws.service.request.UploadFile; * * <p> * The name of the log file, the result files and the backup files may be customized by overriding the following functions: - * {@link #getLogFileName(LogLevel, String)}, {@link #getResultFileName(Result, UWSJob)}, {@link #getBackupFileName(JobOwner)} and {@link #getBackupFileName()}. + * {@link #getLogFileName(uws.service.log.UWSLog.LogLevel, String)}, {@link #getResultFileName(Result, UWSJob)}, {@link #getBackupFileName(JobOwner)} and {@link #getBackupFileName()}. * </p> * * <p> @@ -337,7 +337,7 @@ public class LocalUWSFileManager implements UWSFileManager { * * @return The UWS log file. * - * @see #getLogFileName(LogLevel, String) + * @see #getLogFileName(uws.service.log.UWSLog.LogLevel, String) */ protected File getLogFile(final LogLevel level, final String context){ return new File(rootDirectory, getLogFileName(level, context)); diff --git a/src/uws/service/log/DefaultUWSLog.java b/src/uws/service/log/DefaultUWSLog.java index 637b022..f0ff54c 100644 --- a/src/uws/service/log/DefaultUWSLog.java +++ b/src/uws/service/log/DefaultUWSLog.java @@ -68,7 +68,7 @@ public class DefaultUWSLog implements UWSLog { /** * <p>Builds a {@link UWSLog} which will use the file manager - * of the given UWS to get the log output (see {@link UWSFileManager#getLogOutput(UWSLogType)}).</p> + * of the given UWS to get the log output (see {@link UWSFileManager#getLogOutput(uws.service.log.UWSLog.LogLevel, String)}).</p> * * <p><i><u>note 1</u>: This constructor is particularly useful if the file manager of the given UWS may change.</i></p> * <p><i><u>note 2</u>: If no output can be found in the file manager (or if there is no file manager), @@ -84,10 +84,10 @@ public class DefaultUWSLog implements UWSLog { /** * <p>Builds a {@link UWSLog} which will use the given file - * manager to get the log output (see {@link UWSFileManager#getLogOutput(UWSLogType)}).</p> + * manager to get the log output (see {@link UWSFileManager#getLogOutput(uws.service.log.UWSLog.LogLevel, String)}).</p> * * <p><i><u>note 1</u>: This constructor is particularly useful if the way of managing log output may change in the given file manager. - * Indeed, the output may change in function of the type of message to log ({@link UWSLogType}).</i></p> + * Indeed, the output may change in function of the type of message to log ({@link uws.service.log.UWSLog.LogLevel}).</i></p> * * <p><i><u>note 2</u> If no output can be found in the file manager the standard error output ({@link System#err}) * will be chosen automatically for all log messages.</i></p> @@ -104,7 +104,7 @@ public class DefaultUWSLog implements UWSLog { * <p>Builds a {@link UWSLog} which will print all its * messages into the given stream.</p> * - * <p><i><u>note</u>: the given output will be used whatever is the type of message to log ({@link UWSLogType}).</i></p> + * <p><i><u>note</u>: the given output will be used whatever is the type of message to log ({@link uws.service.log.UWSLog.LogLevel}).</i></p> * * @param output An output stream. */ @@ -118,7 +118,7 @@ public class DefaultUWSLog implements UWSLog { * <p>Builds a {@link UWSLog} which will print all its * messages into the given stream.</p> * - * <p><i><u>note</u>: the given output will be used whatever is the type of message to log ({@link UWSLogType}).</i></p> + * <p><i><u>note</u>: the given output will be used whatever is the type of message to log ({@link uws.service.log.UWSLog.LogLevel}).</i></p> * * @param writer A print writer. */ diff --git a/src/uws/service/log/UWSLog.java b/src/uws/service/log/UWSLog.java index 94a901b..0448234 100644 --- a/src/uws/service/log/UWSLog.java +++ b/src/uws/service/log/UWSLog.java @@ -210,7 +210,7 @@ public interface UWSLog { * * <p><i>Note: * When a request is received, this function is called, and then, when the response has been written and sent to the client, - * {@link #logHttp(LogLevel, HttpServletResponse, String, Throwable)} should be called. + * {@link #logHttp(LogLevel, HttpServletResponse, String, JobOwner, String, Throwable)} should be called. * These functions should always work together. * </i></p> * @@ -220,7 +220,7 @@ public interface UWSLog { * @param message Message to log. <i>MAY be NULL</i> * @param error Error/Exception to log. <i>MAY be NULL</i> * - * @see #logHttp(LogLevel, HttpServletResponse, String, Throwable) + * @see #logHttp(LogLevel, HttpServletResponse, String, JobOwner, String, Throwable) * * @since 4.1 */ @@ -231,7 +231,7 @@ public interface UWSLog { * This log function is called when a response is sent to the client by the service. Consequently, the event is: RESPONSE_SENT.</p> * * <p><i>Note: - * When a request is received, {@link #logHttp(LogLevel, HttpServletRequest, String, Throwable)} is called, and then, + * When a request is received, {@link #logHttp(LogLevel, HttpServletRequest, String, String, Throwable)} is called, and then, * when the response has been written and sent to the client, this function should be called. * These functions should always work together. * </i></p> @@ -243,7 +243,7 @@ public interface UWSLog { * @param message Message to log. <i>MAY be NULL</i> * @param error Error/Exception to log. <i>MAY be NULL</i> * - * @see #logHttp(LogLevel, HttpServletRequest, String, Throwable) + * @see #logHttp(LogLevel, HttpServletRequest, String, String, Throwable) * * @since 4.1 */ diff --git a/src/uws/service/request/UploadFile.java b/src/uws/service/request/UploadFile.java index 2808fe9..0ea800e 100644 --- a/src/uws/service/request/UploadFile.java +++ b/src/uws/service/request/UploadFile.java @@ -179,7 +179,7 @@ public class UploadFile { * directory (e.g. /tmp on Unix/Linux systems).</p> * * <p> - * This function calls {@link UWSFileManager#move(UploadFile,UWSJob} to process to the physical + * This function calls {@link UWSFileManager#moveUpload(UploadFile, UWSJob)} to process to the physical * moving of the file, but it then, it updates its location in this {@link UploadFile} instance. * <b>The file manager does NOT update this location! That's why it must not be called directly, but * through {@link #move(UWSJob)}.</b> -- GitLab