Skip to content
Snippets Groups Projects
Commit d8328dc2 authored by brinn's avatar brinn
Browse files

fix: CommandQueueLister

SVN: 23263
parent 13fedb71
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@
package ch.systemsx.cisd.openbis.dss.generic.server;
/**
* A class that provides a lister for the commands in the command queue of the store.
*
......@@ -32,6 +31,7 @@ public final class CommandQueueLister
public static void listQueuedCommand()
{
final ConfigParameters configParams = DataStoreServer.getConfigParameters();
DataSetCommandExecutor.listQueuedCommands(configParams.getStorePath());
DataSetCommandExecutor.listQueuedCommands(configParams.getCommandQueueDir());
}
}
......@@ -65,6 +65,8 @@ public final class ConfigParameters implements IServletPropertiesManager
static final String AUTH_CACHE_EXPIRATION_TIME = "authorization-cache-expiration-time";
static final String COMMAND_QUEUE_DIR = "commandqueue-dir";
static final int DEFAULT_AUTH_CACHE_EXPIRATION_TIME_MINS = 5;
static final String AUTH_CACHE_CLEANUP_TIMER_PERIOD =
......@@ -130,6 +132,8 @@ public final class ConfigParameters implements IServletPropertiesManager
private final String webstartJarPath;
private final File commandQueueDir;
/**
* Creates an instance based on the specified properties.
*
......@@ -138,7 +142,9 @@ public final class ConfigParameters implements IServletPropertiesManager
ConfigParameters(final Properties properties)
{
this.properties = properties;
storePath = new File(PropertyUtils.getMandatoryProperty(properties, STOREROOT_DIR_KEY));
final String storeRootDir =
PropertyUtils.getMandatoryProperty(properties, STOREROOT_DIR_KEY);
storePath = new File(storeRootDir);
dssInternalTempDir = getInternalTempDirectory(properties);
rpcIncomingDirectory = getRpcIncomingDirectory(properties);
port = getMandatoryIntegerProperty(properties, PORT_KEY);
......@@ -146,6 +152,8 @@ public final class ConfigParameters implements IServletPropertiesManager
downloadURL = PropertyUtils.getMandatoryProperty(properties, DOWNLOAD_URL);
sessionTimeout = getMandatoryIntegerProperty(properties, SESSION_TIMEOUT_KEY) * 60;
useSSL = PropertyUtils.getBoolean(properties, USE_SSL, true);
commandQueueDir =
new File(PropertyUtils.getProperty(properties, COMMAND_QUEUE_DIR, storeRootDir));
if (useSSL == true)
{
keystorePath = PropertyUtils.getMandatoryProperty(properties, KEYSTORE_PATH_KEY);
......@@ -237,6 +245,11 @@ public final class ConfigParameters implements IServletPropertiesManager
return storePath;
}
public File getCommandQueueDir()
{
return commandQueueDir;
}
public final File getRpcIncomingDirectory()
{
return rpcIncomingDirectory;
......
......@@ -203,7 +203,15 @@ class DataSetCommandExecutor implements IDataSetCommandExecutor
System.out.println("Found " + commandQueue.size() + " items in command queue:");
for (final IDataSetCommand cmd : commandQueue)
{
System.out.println(cmd.getDescription());
try
{
System.out.println(cmd.getDescription());
} catch (RuntimeException ex)
{
System.err.printf("Error showing description of command '%s':\n", cmd
.getClass().getSimpleName());
ex.printStackTrace();
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment