From 961623f6e6e04da11b0025858cdb920b1508caca Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Sat, 31 Jan 2015 10:45:07 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud) 89958: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud) 89872: Merged V4.1-BUG-FIX (4.1.10) to V4.2-BUG-FIX (4.2.4) 89708: MNT-12290: Merged PATCHES/V3.4.14 to V4.1-BUG-FIX 88898 : MNT-12291 : CLONE - disconnectClientSessions assumptions don't work on Terminal Servers Added a couple of new configuration values for the CIFS server. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94649 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../default/file-servers-context.xml | 2 + .../default/file-servers.properties | 4 ++ .../filesys/config/CIFSConfigBean.java | 57 +++++++++++++++++++ .../config/ServerConfigurationBean.java | 32 +++++++++++ 4 files changed, 95 insertions(+) diff --git a/config/alfresco/subsystems/fileServers/default/file-servers-context.xml b/config/alfresco/subsystems/fileServers/default/file-servers-context.xml index af6d079d2d..08ab97bfc3 100644 --- a/config/alfresco/subsystems/fileServers/default/file-servers-context.xml +++ b/config/alfresco/subsystems/fileServers/default/file-servers-context.xml @@ -89,6 +89,8 @@ + + ${cifs.enabled} diff --git a/config/alfresco/subsystems/fileServers/default/file-servers.properties b/config/alfresco/subsystems/fileServers/default/file-servers.properties index 88c615f1fe..1d21189da9 100644 --- a/config/alfresco/subsystems/fileServers/default/file-servers.properties +++ b/config/alfresco/subsystems/fileServers/default/file-servers.properties @@ -25,6 +25,10 @@ cifs.enabled=true cifs.serverName=${localname}A cifs.domain= cifs.broadcast=255.255.255.255 + +cifs.terminalServerList= +cifs.loadBalancerList= + # An empty value indicates bind to all available network adapters cifs.bindto= cifs.ipv6.enabled=false diff --git a/source/java/org/alfresco/filesys/config/CIFSConfigBean.java b/source/java/org/alfresco/filesys/config/CIFSConfigBean.java index 5a4d85a2a0..2b799492d3 100644 --- a/source/java/org/alfresco/filesys/config/CIFSConfigBean.java +++ b/source/java/org/alfresco/filesys/config/CIFSConfigBean.java @@ -18,6 +18,10 @@ */ package org.alfresco.filesys.config; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.jlan.server.auth.ICifsAuthenticator; import org.alfresco.jlan.smb.server.VirtualCircuitList; @@ -97,6 +101,59 @@ public class CIFSConfigBean private int m_maxVC = VirtualCircuitList.DefMaxCircuits; + /** The terminal server list address. */ + private List terminalServerList; + + /** The load balancer list address. */ + private List loadBalancerList; + + public CIFSConfigBean(String terminalServerList, String loadBalancerList) + { + this.terminalServerList = convertToIpAddressList(terminalServerList); + this.loadBalancerList = convertToIpAddressList(loadBalancerList); + } + + /** + * Convert string of addresses to the address list. + * + * @param addressist + */ + public List convertToIpAddressList(String addressist) + { + List listIpAddress = null; + if (addressist != null && !addressist.isEmpty()) + { + StringTokenizer tkn = new StringTokenizer(addressist, ", \t\n\r\f"); + listIpAddress = new ArrayList(tkn.countTokens()); + while (tkn.hasMoreTokens()) + { + String instance = tkn.nextToken(); + listIpAddress.add(instance); + } + } + return listIpAddress; + } + + /** + * Gets the terminal server list address. + * + * @return the terminal server list address + */ + public List getTerminalServerList() + { + return this.terminalServerList; + } + + /** + * Gets the load balancer list address. + * + * @return the load balancer list address + */ + public List getLoadBalancerList() + { + return this.loadBalancerList; + } + /** * Checks if is server enabled. * diff --git a/source/java/org/alfresco/filesys/config/ServerConfigurationBean.java b/source/java/org/alfresco/filesys/config/ServerConfigurationBean.java index b9744b1a7b..c7875ce063 100644 --- a/source/java/org/alfresco/filesys/config/ServerConfigurationBean.java +++ b/source/java/org/alfresco/filesys/config/ServerConfigurationBean.java @@ -234,6 +234,38 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean imp cifsConfig.setBroadcastMask(broadcastAddess); } + // Get the terminal server address + + List terminalServerList = cifsConfigBean.getTerminalServerList(); + if (terminalServerList != null && terminalServerList.size() > 0) + { + // Check if the terminal server address is a valid numeric IP address + for (String terminalServerAddress : terminalServerList) + { + if (IPAddress.isNumericAddress(terminalServerAddress) == false) + throw new AlfrescoRuntimeException("Invalid terminal server address, must be n.n.n.n format"); + } + // Set the terminal server address + + cifsConfig.setTerminalServerList(terminalServerList); + } + + // Get the load balancer address + + List loadBalancerList = cifsConfigBean.getLoadBalancerList(); + if (loadBalancerList != null && loadBalancerList.size() > 0) + { + // Check if the load balancer address is a valid numeric IP address + for (String loadBalancerAddress : loadBalancerList) + { + if (IPAddress.isNumericAddress(loadBalancerAddress) == false) + throw new AlfrescoRuntimeException("Invalid load balancer address, must be n.n.n.n format"); + } + // Set the terminal server address + + cifsConfig.setLoadBalancerList(loadBalancerList); + } + // Get the host configuration String hostName = cifsConfigBean.getServerName();