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

Add property session-workspace-root-dir to service.properties.

Extract interface from PluginTaskInfoProvider for easier testing.

SVN: 26260
parent 9abb3970
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,9 @@ use-nio-selector-socket = false ...@@ -21,6 +21,9 @@ use-nio-selector-socket = false
# Session timeout in minutes # Session timeout in minutes
session-timeout = 720 session-timeout = 720
# The root directory for session workspace directories
session-workspace-root-dir = data/sessionWorkspace
# #
# Data set authorization cache # Data set authorization cache
# #
......
/*
* Copyright 2012 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.openbis.dss.generic.server.plugins.tasks;
import java.io.File;
import ch.systemsx.cisd.openbis.generic.shared.dto.DatastoreServiceDescriptions;
/**
* Info provider for plugin tasks.
*
* @author Bernd Rinn
*/
public interface IPluginTaskInfoProvider
{
/**
* Returns the root directory of the data store.
*/
public File getStoreRoot();
/**
* Returns the root directory of session workspaces.
*/
public File getSessionWorkspaceRootDir();
public PluginTaskProvider<IReportingPluginTask> getReportingPluginsProvider();
public PluginTaskProvider<IProcessingPluginTask> getProcessingPluginsProvider();
public ArchiverPluginFactory getArchiverPluginFactory();
public void logConfigurations();
public DatastoreServiceDescriptions getPluginTaskDescriptions();
}
\ No newline at end of file
...@@ -33,13 +33,13 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DatastoreServiceDescriptions; ...@@ -33,13 +33,13 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.DatastoreServiceDescriptions;
* *
* @author Tomasz Pylak * @author Tomasz Pylak
*/ */
public class PluginTaskInfoProvider public class PluginTaskInfoProvider implements IPluginTaskInfoProvider
{ {
public static final String STOREROOT_DIR_KEY = "storeroot-dir"; public static final String STOREROOT_DIR_KEY = "storeroot-dir";
private static final String SESSION_WORKSPACE_ROOT_DIR_KEY = "session-workspace-root-dir"; private static final String SESSION_WORKSPACE_ROOT_DIR_KEY = "session-workspace-root-dir";
private static final String SESSION_WORKSPACE_ROOT_DIR_DEFAULT = "sessionWorkspace"; private static final String SESSION_WORKSPACE_ROOT_DIR_DEFAULT = "data/sessionWorkspace";
/** name of archiver properties section */ /** name of archiver properties section */
@Private @Private
...@@ -56,7 +56,7 @@ public class PluginTaskInfoProvider ...@@ -56,7 +56,7 @@ public class PluginTaskInfoProvider
private final File sessionWorkspaceRootDir; private final File sessionWorkspaceRootDir;
/** for external injections */ /** for external injections */
public static PluginTaskInfoProvider create() public static IPluginTaskInfoProvider create()
{ {
IServletPropertiesManager servletPropertiesManager = DataStoreServer.getConfigParameters(); IServletPropertiesManager servletPropertiesManager = DataStoreServer.getConfigParameters();
Properties properties = DssPropertyParametersUtil.loadServiceProperties(); Properties properties = DssPropertyParametersUtil.loadServiceProperties();
...@@ -95,6 +95,7 @@ public class PluginTaskInfoProvider ...@@ -95,6 +95,7 @@ public class PluginTaskInfoProvider
/** /**
* Returns the root directory of the data store. * Returns the root directory of the data store.
*/ */
@Override
public final File getStoreRoot() public final File getStoreRoot()
{ {
return storeRoot; return storeRoot;
...@@ -103,21 +104,25 @@ public class PluginTaskInfoProvider ...@@ -103,21 +104,25 @@ public class PluginTaskInfoProvider
/** /**
* Returns the root directory of session workspaces. * Returns the root directory of session workspaces.
*/ */
@Override
public File getSessionWorkspaceRootDir() public File getSessionWorkspaceRootDir()
{ {
return sessionWorkspaceRootDir; return sessionWorkspaceRootDir;
} }
@Override
public PluginTaskProvider<IReportingPluginTask> getReportingPluginsProvider() public PluginTaskProvider<IReportingPluginTask> getReportingPluginsProvider()
{ {
return reportingPlugins; return reportingPlugins;
} }
@Override
public PluginTaskProvider<IProcessingPluginTask> getProcessingPluginsProvider() public PluginTaskProvider<IProcessingPluginTask> getProcessingPluginsProvider()
{ {
return processingPlugins; return processingPlugins;
} }
@Override
public ArchiverPluginFactory getArchiverPluginFactory() public ArchiverPluginFactory getArchiverPluginFactory()
{ {
return archiverTaskFactory; return archiverTaskFactory;
...@@ -129,6 +134,7 @@ public class PluginTaskInfoProvider ...@@ -129,6 +134,7 @@ public class PluginTaskInfoProvider
reportingPlugins.check(false); reportingPlugins.check(false);
} }
@Override
public void logConfigurations() public void logConfigurations()
{ {
processingPlugins.logConfigurations(); processingPlugins.logConfigurations();
...@@ -194,6 +200,7 @@ public class PluginTaskInfoProvider ...@@ -194,6 +200,7 @@ public class PluginTaskInfoProvider
sectionName, false); sectionName, false);
} }
@Override
public DatastoreServiceDescriptions getPluginTaskDescriptions() public DatastoreServiceDescriptions getPluginTaskDescriptions()
{ {
return new DatastoreServiceDescriptions(reportingPlugins.getPluginDescriptions(), return new DatastoreServiceDescriptions(reportingPlugins.getPluginDescriptions(),
......
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