Skip to content
Snippets Groups Projects
Commit bb84e64b authored by gmantele's avatar gmantele
Browse files

[TAP] Forbid query execution also in asynchronous mode IF the service is declared as not available.

parent 7613f228
Branches
No related tags found
No related merge requests found
...@@ -71,7 +71,7 @@ import uws.service.log.UWSLog.LogLevel; ...@@ -71,7 +71,7 @@ import uws.service.log.UWSLog.LogLevel;
* </ul> * </ul>
* *
* @author Gr&eacute;gory Mantelet (CDS;ARI) * @author Gr&eacute;gory Mantelet (CDS;ARI)
* @version 2.0 (09/2014) * @version 2.0 (12/2014)
* *
* @see UWSService * @see UWSService
*/ */
...@@ -181,7 +181,14 @@ public class ASync implements TAPResource { ...@@ -181,7 +181,14 @@ public class ASync implements TAPResource {
@Override @Override
public boolean executeResource(final HttpServletRequest request, final HttpServletResponse response) throws IOException, TAPException{ public boolean executeResource(final HttpServletRequest request, final HttpServletResponse response) throws IOException, TAPException{
try{ try{
// Ensure the service is currently available:
if (!service.isAvailable())
throw new TAPException("Can not execute a query: this TAP service is not available! " + service.getAvailability(), UWSException.SERVICE_UNAVAILABLE);
// Forward the request to the UWS service:
return uws.executeRequest(request, response); return uws.executeRequest(request, response);
}catch(UWSException ue){ }catch(UWSException ue){
throw new TAPException(ue); throw new TAPException(ue);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment