mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-15 15:02:20 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
104252: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud) 104183: Merged DEV to V5.0.N (5.0.2) 104081 : MNT-12874: FTP: 0kb file when uploading file via ftp (drop network connection) - Added timeout for server session. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@104394 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2015 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -108,8 +108,8 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean imp
|
||||
private SecurityConfigBean securityConfigBean;
|
||||
private CoreServerConfigBean coreServerConfigBean;
|
||||
|
||||
private ThreadRequestPool threadPool;
|
||||
protected ClusterConfigBean clusterConfigBean;
|
||||
private ThreadRequestPool threadPool;
|
||||
protected ClusterConfigBean clusterConfigBean;
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
@@ -1229,6 +1229,22 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean imp
|
||||
ftpConfig.setFTPPort(DefaultFTPServerPort);
|
||||
}
|
||||
|
||||
// Check for an FTP server timeout for connection to client
|
||||
Integer sessionTimeout = ftpConfigBean.getSessionTimeout();
|
||||
if (sessionTimeout != null)
|
||||
{
|
||||
ftpConfig.setFTPSrvSessionTimeout(sessionTimeout);
|
||||
if (ftpConfig.getFTPSrvSessionTimeout() < 0)
|
||||
throw new AlfrescoRuntimeException("FTP server session timeout must have positive value or zero");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Use the default timeout
|
||||
|
||||
ftpConfig.setFTPSrvSessionTimeout(DefaultFTPSrvSessionTimeout);
|
||||
}
|
||||
|
||||
// Check if anonymous login is allowed
|
||||
|
||||
if (ftpConfigBean.getAllowAnonymous())
|
||||
@@ -2305,40 +2321,40 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean imp
|
||||
}
|
||||
|
||||
// Create a ClusterConfigSection and attach it to 'this'.
|
||||
ClusterConfigSection clusterConf = new ClusterConfigSection(this);
|
||||
}
|
||||
ClusterConfigSection clusterConf = new ClusterConfigSection(this);
|
||||
}
|
||||
|
||||
|
||||
private GenericConfigElement createClusterConfig(String topicName) throws InvalidConfigurationException
|
||||
{
|
||||
GenericConfigElement config = new GenericConfigElement("hazelcastStateCache");
|
||||
GenericConfigElement clusterNameCfg = new GenericConfigElement("clusterName");
|
||||
clusterNameCfg.setValue(clusterConfigBean.getClusterName());
|
||||
config.addChild(clusterNameCfg);
|
||||
|
||||
GenericConfigElement topicNameCfg = new GenericConfigElement("clusterTopic");
|
||||
if(topicName == null || topicName.isEmpty())
|
||||
{
|
||||
topicName="default";
|
||||
}
|
||||
topicNameCfg.setValue(topicName);
|
||||
config.addChild(topicNameCfg);
|
||||
|
||||
if(clusterConfigBean.getDebugFlags() != null)
|
||||
{
|
||||
GenericConfigElement debugCfg = new GenericConfigElement("cacheDebug");
|
||||
debugCfg.addAttribute("flags", clusterConfigBean.getDebugFlags());
|
||||
config.addChild(debugCfg);
|
||||
}
|
||||
|
||||
if(clusterConfigBean.getNearCacheTimeout() > 0)
|
||||
{
|
||||
GenericConfigElement nearCacheCfg = new GenericConfigElement("nearCache");
|
||||
nearCacheCfg.addAttribute("disable", Boolean.FALSE.toString());
|
||||
nearCacheCfg.addAttribute("timeout", Integer.toString(clusterConfigBean.getNearCacheTimeout()));
|
||||
config.addChild(nearCacheCfg);
|
||||
}
|
||||
return config;
|
||||
private GenericConfigElement createClusterConfig(String topicName) throws InvalidConfigurationException
|
||||
{
|
||||
GenericConfigElement config = new GenericConfigElement("hazelcastStateCache");
|
||||
GenericConfigElement clusterNameCfg = new GenericConfigElement("clusterName");
|
||||
clusterNameCfg.setValue(clusterConfigBean.getClusterName());
|
||||
config.addChild(clusterNameCfg);
|
||||
|
||||
GenericConfigElement topicNameCfg = new GenericConfigElement("clusterTopic");
|
||||
if(topicName == null || topicName.isEmpty())
|
||||
{
|
||||
topicName="default";
|
||||
}
|
||||
topicNameCfg.setValue(topicName);
|
||||
config.addChild(topicNameCfg);
|
||||
|
||||
if(clusterConfigBean.getDebugFlags() != null)
|
||||
{
|
||||
GenericConfigElement debugCfg = new GenericConfigElement("cacheDebug");
|
||||
debugCfg.addAttribute("flags", clusterConfigBean.getDebugFlags());
|
||||
config.addChild(debugCfg);
|
||||
}
|
||||
|
||||
if(clusterConfigBean.getNearCacheTimeout() > 0)
|
||||
{
|
||||
GenericConfigElement nearCacheCfg = new GenericConfigElement("nearCache");
|
||||
nearCacheCfg.addAttribute("disable", Boolean.FALSE.toString());
|
||||
nearCacheCfg.addAttribute("timeout", Integer.toString(clusterConfigBean.getNearCacheTimeout()));
|
||||
config.addChild(nearCacheCfg);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user