diff --git a/src/adql/db/DBCommonColumn.java b/src/adql/db/DBCommonColumn.java index fbbc73deaa2bf277b3a55ad77e25208f6dbb4274..cab30f6f86cf8be463679d0fbf78fdb1c8c22257 100644 --- a/src/adql/db/DBCommonColumn.java +++ b/src/adql/db/DBCommonColumn.java @@ -16,7 +16,7 @@ package adql.db; * You should have received a copy of the GNU Lesser General Public License * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2014 - Astronomishes Rechen Institute (ARI) + * Copyright 2014 - Astronomishes Rechen Institut (ARI) */ import java.util.ArrayList; diff --git a/src/adql/db/DefaultDBTable.java b/src/adql/db/DefaultDBTable.java index baf71400273ce0d32a193328d7b20833cf6aded6..35fcfc5caa73500e151735faac3bab3d5279314e 100644 --- a/src/adql/db/DefaultDBTable.java +++ b/src/adql/db/DefaultDBTable.java @@ -17,7 +17,7 @@ package adql.db; * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomisches Rechen Institute (ARI) + * Astronomisches Rechen Institut (ARI) */ import java.util.Collection; diff --git a/src/adql/db/SearchColumnList.java b/src/adql/db/SearchColumnList.java index 115e9d03ac56819caeff12dcfadf54c5e7144529..8411e4be31d939e6fc6670230eb1210b8fc33fcb 100644 --- a/src/adql/db/SearchColumnList.java +++ b/src/adql/db/SearchColumnList.java @@ -17,7 +17,7 @@ package adql.db; * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomishes Rechen Institute (ARI) + * Astronomishes Rechen Institut (ARI) */ import java.util.ArrayList; diff --git a/src/adql/db/SearchTableList.java b/src/adql/db/SearchTableList.java index 649b4fd60b6962c2d304353bada4506704506988..d025be90abefb496ffe208acb8c9df75935507f7 100644 --- a/src/adql/db/SearchTableList.java +++ b/src/adql/db/SearchTableList.java @@ -16,13 +16,14 @@ package adql.db; * You should have received a copy of the GNU Lesser General Public License * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2012 - UDS/Centre de Données astronomiques de Strasbourg (CDS) + * Copyright 2012,2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS) + * Astronomisches Rechen Institut (ARI) */ import java.util.ArrayList; import java.util.Collection; -import adql.query.IdentifierField; +import adql.query.IdentifierField; import adql.query.from.ADQLTable; import cds.utils.TextualSearchList; @@ -34,8 +35,8 @@ import cds.utils.TextualSearchList; * These last information will be used only if the ADQL table name is ambiguous, otherwise all matching elements are returned. * </p> * - * @author Grégory Mantelet (CDS) - * @version 09/2011 + * @author Grégory Mantelet (CDS;ARI) + * @version 1.3 (08/2014) */ public class SearchTableList extends TextualSearchList<DBTable> { private static final long serialVersionUID = 1L; @@ -58,7 +59,7 @@ public class SearchTableList extends TextualSearchList<DBTable> { * * @param collection Collection of {@link DBTable} to copy. */ - public SearchTableList(final Collection<DBTable> collection){ + public SearchTableList(final Collection<? extends DBTable> collection){ super(collection, new DBTableKeyExtractor()); } @@ -199,6 +200,7 @@ public class SearchTableList extends TextualSearchList<DBTable> { * @version 09/2011 */ private static class DBTableKeyExtractor implements KeyExtractor<DBTable> { + @Override public String getKey(DBTable obj){ return obj.getADQLName(); } diff --git a/src/adql/db/exception/UnresolvedJoin.java b/src/adql/db/exception/UnresolvedJoin.java index ac47cfdd4e24bc11658c1e456865139b6879bc91..c92440ece0b61b79c525f697c642783ccfc6049c 100644 --- a/src/adql/db/exception/UnresolvedJoin.java +++ b/src/adql/db/exception/UnresolvedJoin.java @@ -16,7 +16,7 @@ package adql.db.exception; * You should have received a copy of the GNU Lesser General Public License * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2013-2014 - Astronomishes Rechen Institute (ARI) + * Copyright 2013-2014 - Astronomishes Rechen Institut (ARI) */ import adql.parser.ParseException; diff --git a/src/adql/query/ADQLQuery.java b/src/adql/query/ADQLQuery.java index ffbc9971fe6504237e797d8bb6937d873b9af731..39a7e6b5afea25d88a684e44e42e9d4bc9bfa6d9 100644 --- a/src/adql/query/ADQLQuery.java +++ b/src/adql/query/ADQLQuery.java @@ -17,7 +17,7 @@ package adql.query; * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomishes Rechen Institute (ARI) + * Astronomishes Rechen Institut (ARI) */ import java.util.ArrayList; diff --git a/src/adql/query/ClauseADQL.java b/src/adql/query/ClauseADQL.java index 7116b41004d154947d4636ddf82cd1f763dc4004..30bf6abacbbd2f09f25eac70cc2b4c230c1efaa9 100644 --- a/src/adql/query/ClauseADQL.java +++ b/src/adql/query/ClauseADQL.java @@ -17,7 +17,7 @@ package adql.query; * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012-2013 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomisches Rechen Institute (ARI) + * Astronomisches Rechen Institut (ARI) */ /** diff --git a/src/adql/query/from/ADQLJoin.java b/src/adql/query/from/ADQLJoin.java index 9c9cb1420c09b01f41dad9e9491abc763772f7a8..c7199334473bda2086332fe453cacab2026a12b4 100644 --- a/src/adql/query/from/ADQLJoin.java +++ b/src/adql/query/from/ADQLJoin.java @@ -17,7 +17,7 @@ package adql.query.from; * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomishes Rechen Institute (ARI) + * Astronomishes Rechen Institut (ARI) */ import java.util.ArrayList; diff --git a/src/adql/query/from/FromContent.java b/src/adql/query/from/FromContent.java index e9157f8f273b04a4e0111e6c32aa9b229ef7b7f8..64da1e5220d2f434c807f7f1e26b2a3f43b9b62a 100644 --- a/src/adql/query/from/FromContent.java +++ b/src/adql/query/from/FromContent.java @@ -17,7 +17,7 @@ package adql.query.from; * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomishes Rechen Institute (ARI) + * Astronomishes Rechen Institut (ARI) */ import java.util.ArrayList; diff --git a/src/adql/query/operand/function/DefaultUDF.java b/src/adql/query/operand/function/DefaultUDF.java index 55cafc3057db3058532fffffdbfb22d74762f486..c08436508295c7a080a3151f2b74494607f9f382 100644 --- a/src/adql/query/operand/function/DefaultUDF.java +++ b/src/adql/query/operand/function/DefaultUDF.java @@ -16,7 +16,7 @@ package adql.query.operand.function; * You should have received a copy of the GNU Lesser General Public License * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), Astronomisches Rechen Institute (ARI) + * Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), Astronomisches Rechen Institut (ARI) */ import adql.query.ADQLList; diff --git a/src/adql/query/operand/function/MathFunction.java b/src/adql/query/operand/function/MathFunction.java index 0e89163424abaf080b407b71e5750ca5cba3f87d..15acf0a2f4a9689c483e22814477f150cc2d5631 100644 --- a/src/adql/query/operand/function/MathFunction.java +++ b/src/adql/query/operand/function/MathFunction.java @@ -17,7 +17,7 @@ package adql.query.operand.function; * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomisches Rechen Institute (ARI) + * Astronomisches Rechen Institut (ARI) */ import adql.query.ADQLObject; diff --git a/src/adql/query/operand/function/geometry/RegionFunction.java b/src/adql/query/operand/function/geometry/RegionFunction.java index 05ccf5e43200b9e238b64c25cfcd42b15289ef11..dea04a27d30356320f9e011fa7e9288d7c5878d1 100644 --- a/src/adql/query/operand/function/geometry/RegionFunction.java +++ b/src/adql/query/operand/function/geometry/RegionFunction.java @@ -17,7 +17,7 @@ package adql.query.operand.function.geometry; * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012,2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomisches Rechen Institute (ARI) + * Astronomisches Rechen Institut (ARI) */ import adql.query.ADQLObject; diff --git a/src/tap/error/DefaultTAPErrorWriter.java b/src/tap/error/DefaultTAPErrorWriter.java index 85236b914e9ded059ab07137abad0249916f8900..28c8602423691a108a7111138f68b2460f3c3e06 100644 --- a/src/tap/error/DefaultTAPErrorWriter.java +++ b/src/tap/error/DefaultTAPErrorWriter.java @@ -27,10 +27,10 @@ import javax.servlet.http.HttpServletResponse; import tap.ServiceConnection; import uws.UWSException; +import uws.job.ErrorType; import uws.job.user.JobOwner; import uws.service.error.AbstractServiceErrorWriter; import uws.service.error.ServiceErrorWriter; -import uws.service.log.UWSLog; /** * <p>Default implementation of {@link ServiceErrorWriter} for a TAP service.</p> @@ -52,7 +52,7 @@ import uws.service.log.UWSLog; * * @see AbstractServiceErrorWriter */ -public class DefaultTAPErrorWriter extends AbstractServiceErrorWriter { +public class DefaultTAPErrorWriter implements ServiceErrorWriter { protected final ServiceConnection service; @@ -60,11 +60,6 @@ public class DefaultTAPErrorWriter extends AbstractServiceErrorWriter { this.service = service; } - @Override - protected final UWSLog getLogger(){ - return service.getLogger(); - } - @Override public void writeError(Throwable t, HttpServletResponse response, HttpServletRequest request, JobOwner user, String action) throws IOException{ if (t instanceof UWSException){ @@ -73,8 +68,22 @@ public class DefaultTAPErrorWriter extends AbstractServiceErrorWriter { if (ue.getHttpErrorCode() == UWSException.INTERNAL_SERVER_ERROR) getLogger().error(ue); getLogger().httpRequest(request, user, action, ue.getHttpErrorCode(), ue.getMessage(), ue); - }else - super.writeError(t, response, request, user, action); + }else{ + if (t != null && response != null){ + formatError(t, true, ErrorType.FATAL, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, action, user, response, (request != null) ? request.getHeader("Accept") : null); + getLogger().error(t); + String errorMsg = t.getMessage(); + if (errorMsg == null || errorMsg.trim().isEmpty()) + errorMsg = t.getClass().getName() + " (no error message)"; + getLogger().httpRequest(request, user, action, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, errorMsg, t); + } + } + } + + @Override + public void writeError(String message, ErrorType type, int httpErrorCode, HttpServletResponse response, HttpServletRequest request, JobOwner user, String action) throws IOException{ + // TODO ServiceErrorWriter.writeError + } } diff --git a/src/tap/metadata/TAPType.java b/src/tap/metadata/TAPType.java index 90643543d9eee044730bb105c6b3984c1f129a33..1990d56b98206001bac4ee2c79076b368ed89aec 100644 --- a/src/tap/metadata/TAPType.java +++ b/src/tap/metadata/TAPType.java @@ -16,7 +16,7 @@ package tap.metadata; * You should have received a copy of the GNU Lesser General Public License * along with TAPLibrary. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2014 - Astronomishes Rechen Institute (ARI) + * Copyright 2014 - Astronomishes Rechen Institut (ARI) */ /** diff --git a/src/tap/metadata/VotType.java b/src/tap/metadata/VotType.java index 16332eb9be6938434cbfc8a7012f23271af93eee..203c01d0733c73c3797b883fa9b78fe7611c65f9 100644 --- a/src/tap/metadata/VotType.java +++ b/src/tap/metadata/VotType.java @@ -17,7 +17,7 @@ package tap.metadata; * along with TAPLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012,2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomishes Rechen Institute (ARI) + * Astronomishes Rechen Institut (ARI) */ import tap.TAPException; diff --git a/src/tap/parameters/MaxRecController.java b/src/tap/parameters/MaxRecController.java index 30851bc4d51456f1661b0f9a39a1512b362f8606..3dabe0ee58c12b2c99cfe8e4beef7934708ff50f 100644 --- a/src/tap/parameters/MaxRecController.java +++ b/src/tap/parameters/MaxRecController.java @@ -17,7 +17,7 @@ package tap.parameters; * along with TAPLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomisches Rechen Institute (ARI) + * Astronomisches Rechen Institut (ARI) */ import tap.ServiceConnection; diff --git a/src/tap/resource/ASync.java b/src/tap/resource/ASync.java index c23eb7253a19bb3e47b9707c449a864724476cf7..6d8746ac0836439ecd0817dadd1c1ad6bb3c1b7b 100644 --- a/src/tap/resource/ASync.java +++ b/src/tap/resource/ASync.java @@ -42,12 +42,10 @@ public class ASync implements TAPResource { public static final String RESOURCE_NAME = "async"; - @SuppressWarnings("unchecked") protected final ServiceConnection service; protected final UWSService uws; protected final JobList jobList; - @SuppressWarnings("unchecked") public ASync(ServiceConnection service) throws UWSException, TAPException{ this.service = service; diff --git a/src/uws/job/UWSJob.java b/src/uws/job/UWSJob.java index 9fe509a7a9f47a6f3f9cc0a8fb588c96160018f0..24b24e8bf235b2fe0c8536baed60d1969724281f 100644 --- a/src/uws/job/UWSJob.java +++ b/src/uws/job/UWSJob.java @@ -17,7 +17,7 @@ package uws.job; * along with UWSLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomisches Rechen Institute (ARI) + * Astronomisches Rechen Institut (ARI) */ import java.io.IOException; diff --git a/src/uws/job/manager/AbstractQueuedExecutionManager.java b/src/uws/job/manager/AbstractQueuedExecutionManager.java index a2e1d4082504debb196779d716f43293605f2b88..6a14c8febb20bf5c32a918c3ef59776c08a90994 100644 --- a/src/uws/job/manager/AbstractQueuedExecutionManager.java +++ b/src/uws/job/manager/AbstractQueuedExecutionManager.java @@ -26,7 +26,6 @@ import java.util.Vector; import uws.UWSException; import uws.UWSToolBox; - import uws.job.ErrorType; import uws.job.ExecutionPhase; import uws.job.UWSJob; @@ -72,18 +71,22 @@ public abstract class AbstractQueuedExecutionManager implements ExecutionManager /* ***************** */ /* GETTERS & SETTERS */ /* ***************** */ + @Override public final Iterator<UWSJob> getRunningJobs(){ return runningJobs.values().iterator(); } + @Override public final int getNbRunningJobs(){ return runningJobs.size(); } + @Override public final Iterator<UWSJob> getQueuedJobs(){ return queuedJobs.iterator(); } + @Override public final int getNbQueuedJobs(){ return queuedJobs.size(); } @@ -123,6 +126,7 @@ public abstract class AbstractQueuedExecutionManager implements ExecutionManager * * @see uws.job.manager.ExecutionManager#refresh() */ + @Override public synchronized final void refresh() throws UWSException{ // Return immediately if no queue: if (!hasQueue()) @@ -177,6 +181,7 @@ public abstract class AbstractQueuedExecutionManager implements ExecutionManager * * @see uws.job.manager.ExecutionManager#execute(AbstractJob) */ + @Override public synchronized final ExecutionPhase execute(final UWSJob jobToExecute) throws UWSException{ if (jobToExecute == null) return null; @@ -216,6 +221,7 @@ public abstract class AbstractQueuedExecutionManager implements ExecutionManager * * @see uws.job.manager.ExecutionManager#remove(uws.job.UWSJob) */ + @Override public final synchronized void remove(final UWSJob jobToRemove) throws UWSException{ if (jobToRemove != null){ runningJobs.remove(jobToRemove.getJobId()); diff --git a/src/uws/job/manager/QueuedExecutionManager.java b/src/uws/job/manager/QueuedExecutionManager.java index 9fd9de413af0de36bcbf935f32607e80a6e11112..4d750e431e396175fdb77ea9119d7714de580a88 100644 --- a/src/uws/job/manager/QueuedExecutionManager.java +++ b/src/uws/job/manager/QueuedExecutionManager.java @@ -20,7 +20,6 @@ package uws.job.manager; */ import uws.UWSException; - import uws.job.UWSJob; import uws.service.log.UWSLog; diff --git a/src/uws/service/UWSFactory.java b/src/uws/service/UWSFactory.java index 4cf384c1b5b4078879419414dfba1ff35123797a..e9b45c2260685c6f75259390001a276f4edf5710 100644 --- a/src/uws/service/UWSFactory.java +++ b/src/uws/service/UWSFactory.java @@ -25,12 +25,10 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import uws.UWSException; - import uws.job.ErrorSummary; import uws.job.JobThread; import uws.job.Result; import uws.job.UWSJob; - import uws.job.parameters.UWSParameters; import uws.job.user.JobOwner; diff --git a/src/uws/service/UWSUrl.java b/src/uws/service/UWSUrl.java index 932b2790d12e289d55eef3f5c6bf9dd343016466..2376fa777a700f1ac61ac48702458d27c18797ce 100644 --- a/src/uws/service/UWSUrl.java +++ b/src/uws/service/UWSUrl.java @@ -17,7 +17,7 @@ package uws.service; * along with UWSLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012,2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS), - * Astronomishes Rechen Institute (ARI) + * Astronomishes Rechen Institut (ARI) */ import java.io.Serializable;