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();