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

[TAP] Remove the availability fields from the configuration file. The Service...

[TAP] Remove the availability fields from the configuration file. The Service will always start as available ; there is indeed no reason to start and leave it as unavailable.
parent dc41e553
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,6 @@ package tap.config;
import static tap.config.TAPConfiguration.DEFAULT_DIRECTORY_PER_USER;
import static tap.config.TAPConfiguration.DEFAULT_EXECUTION_DURATION;
import static tap.config.TAPConfiguration.DEFAULT_GROUP_USER_DIRECTORIES;
import static tap.config.TAPConfiguration.DEFAULT_IS_AVAILABLE;
import static tap.config.TAPConfiguration.DEFAULT_RETENTION_PERIOD;
import static tap.config.TAPConfiguration.DEFAULT_UPLOAD_MAX_FILE_SIZE;
import static tap.config.TAPConfiguration.KEY_DEFAULT_EXECUTION_DURATION;
......@@ -11,11 +10,9 @@ import static tap.config.TAPConfiguration.KEY_DEFAULT_OUTPUT_LIMIT;
import static tap.config.TAPConfiguration.KEY_DEFAULT_RETENTION_PERIOD;
import static tap.config.TAPConfiguration.KEY_DEFAULT_UPLOAD_LIMIT;
import static tap.config.TAPConfiguration.KEY_DIRECTORY_PER_USER;
import static tap.config.TAPConfiguration.KEY_DISABILITY_REASON;
import static tap.config.TAPConfiguration.KEY_FILE_MANAGER;
import static tap.config.TAPConfiguration.KEY_FILE_ROOT_PATH;
import static tap.config.TAPConfiguration.KEY_GROUP_USER_DIRECTORIES;
import static tap.config.TAPConfiguration.KEY_IS_AVAILABLE;
import static tap.config.TAPConfiguration.KEY_MAX_EXECUTION_DURATION;
import static tap.config.TAPConfiguration.KEY_MAX_OUTPUT_LIMIT;
import static tap.config.TAPConfiguration.KEY_MAX_RETENTION_PERIOD;
......@@ -69,7 +66,7 @@ public final class DefaultServiceConnection implements ServiceConnection {
private final String serviceDescription;
private boolean isAvailable = false; // the TAP service must be disabled until the end of its connection initialization
private String availability = null;
private String availability = "TAP service not yet initialized.";
private int[] executionDuration = new int[2];
private int[] retentionPeriod = new int[2];
......@@ -99,7 +96,6 @@ public final class DefaultServiceConnection implements ServiceConnection {
// 4. SET ALL GENERAL SERVICE CONNECTION INFORMATION:
providerName = getProperty(tapConfig, KEY_PROVIDER_NAME);
serviceDescription = getProperty(tapConfig, KEY_SERVICE_DESCRIPTION);
availability = getProperty(tapConfig, KEY_DISABILITY_REASON);
initRetentionPeriod(tapConfig);
initExecutionDuration(tapConfig);
......@@ -120,9 +116,8 @@ public final class DefaultServiceConnection implements ServiceConnection {
// set the maximum upload file size:
initMaxUploadSize(tapConfig);
// 7. MAKE THE SERVICE AVAILABLE (or not, depending on the property value):
String propValue = getProperty(tapConfig, KEY_IS_AVAILABLE);
isAvailable = (propValue == null) ? DEFAULT_IS_AVAILABLE : Boolean.parseBoolean(propValue);
// 7. MAKE THE SERVICE AVAILABLE:
setAvailable(true, "TAP service available.");
}
private void initFileManager(final Properties tapConfig) throws TAPException{
......@@ -357,17 +352,15 @@ public final class DefaultServiceConnection implements ServiceConnection {
return isAvailable;
}
public void setAvailability(final boolean isAvailable){
this.isAvailable = isAvailable;
}
@Override
public String getAvailability(){
return availability;
}
public void setDisabilityReason(final String disabilityReason){
availability = disabilityReason;
@Override
public void setAvailable(boolean isAvailable, String message){
this.isAvailable = isAvailable;
availability = message;
}
@Override
......@@ -561,12 +554,6 @@ public final class DefaultServiceConnection implements ServiceConnection {
return null;
}
@Override
public void setAvailable(boolean isAvailable, String message){
this.isAvailable = isAvailable;
availability = message;
}
@Override
public Collection<String> getGeometries(){
return null; // ALL GEOMETRIES ALLOWED
......
......@@ -57,11 +57,6 @@ public final class TAPConfiguration {
public final static String KEY_PROVIDER_NAME = "provider_name";
public final static String KEY_SERVICE_DESCRIPTION = "service_description";
/* AVAILABILITY KEYS */
public final static String KEY_IS_AVAILABLE = "is_available";
public final static boolean DEFAULT_IS_AVAILABLE = true;
public final static String KEY_DISABILITY_REASON = "disability_reason";
/* UPLOAD KEYS */
public final static String KEY_UPLOAD_ENABLED = "upload_enabled";
public final static String KEY_DEFAULT_UPLOAD_LIMIT = "upload_default_db_limit";
......
......@@ -110,26 +110,6 @@
<td></td>
</tr>
<tr><td colspan="5">Availability</td></tr>
<tr>
<td class="done">is_available</td>
<td></td>
<td>boolean</td>
<td>
<p>Tells whether the service is up or down.</p>
<p>If no value is provided, the service will be made available.</p>
<p>A value different from "true" (whatever is the case), will be considered as "false".</p>
</td>
<td><ul><li>true <i>(default)</i></li><li>false</li></ul></td>
</tr>
<tr>
<td class="done">disability_reason</td>
<td></td>
<td>text</td>
<td>Message returns to a client of this TAP Service when it is not available.</p></td>
<td>This TAP Service is temporarily unavailable for DB maintenance.</td>
</tr>
<tr><td colspan="5">Database</td></tr>
<tr>
<td class="done">jdbc_driver</td>
......
##########################################################
# FULL TAP CONFIGURATION FILE #
# #
# TAP Version: 1.1 #
# Date: 20 Dec. 2013 #
# TAP Version: 2.0 #
# Date: 27 Jan. 2015 #
# Author: Gregory Mantelet (ARI) #
# #
# See the TAP documentation for more details: ...TODO... #
......@@ -28,21 +28,6 @@ provider_name = ARI
# Description of the TAP Service.
tap_description = My TAP Service is so amazing! You should use it with your favorite TAP client.
################
# AVAILABILITY #
################
# [OPTIONAL]
# Tells whether the service is up or down.
# If no value is provided, the service will be made available.
# A value different from "true" (whatever is the case), will be considered as "false".
# Allowed values: true (default), false
is_available = true
# [OPTIONAL]
# Message returns to a client of this TAP Service when it is not available.
disability_reason =
############
# DATABASE #
############
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment