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
This commit is contained in:
Alan Davis
2015-01-31 10:45:07 +00:00
parent 786e58f936
commit 961623f6e6
4 changed files with 95 additions and 0 deletions

View File

@@ -89,6 +89,8 @@
<bean id="cifsServerConfig" class="org.alfresco.filesys.config.CIFSConfigBean"> <bean id="cifsServerConfig" class="org.alfresco.filesys.config.CIFSConfigBean">
<constructor-arg index="0" value="${cifs.terminalServerList}"/>
<constructor-arg index="1" value="${cifs.loadBalancerList}"/>
<property name="serverEnabled"> <property name="serverEnabled">
<value>${cifs.enabled}</value> <value>${cifs.enabled}</value>
</property> </property>

View File

@@ -25,6 +25,10 @@ cifs.enabled=true
cifs.serverName=${localname}A cifs.serverName=${localname}A
cifs.domain= cifs.domain=
cifs.broadcast=255.255.255.255 cifs.broadcast=255.255.255.255
cifs.terminalServerList=
cifs.loadBalancerList=
# An empty value indicates bind to all available network adapters # An empty value indicates bind to all available network adapters
cifs.bindto= cifs.bindto=
cifs.ipv6.enabled=false cifs.ipv6.enabled=false

View File

@@ -18,6 +18,10 @@
*/ */
package org.alfresco.filesys.config; 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.error.AlfrescoRuntimeException;
import org.alfresco.jlan.server.auth.ICifsAuthenticator; import org.alfresco.jlan.server.auth.ICifsAuthenticator;
import org.alfresco.jlan.smb.server.VirtualCircuitList; import org.alfresco.jlan.smb.server.VirtualCircuitList;
@@ -97,6 +101,59 @@ public class CIFSConfigBean
private int m_maxVC = VirtualCircuitList.DefMaxCircuits; private int m_maxVC = VirtualCircuitList.DefMaxCircuits;
/** The terminal server list address. */
private List<String> terminalServerList;
/** The load balancer list address. */
private List<String> 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<String> convertToIpAddressList(String addressist)
{
List<String> listIpAddress = null;
if (addressist != null && !addressist.isEmpty())
{
StringTokenizer tkn = new StringTokenizer(addressist, ", \t\n\r\f");
listIpAddress = new ArrayList<String>(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<String> getTerminalServerList()
{
return this.terminalServerList;
}
/**
* Gets the load balancer list address.
*
* @return the load balancer list address
*/
public List<String> getLoadBalancerList()
{
return this.loadBalancerList;
}
/** /**
* Checks if is server enabled. * Checks if is server enabled.
* *

View File

@@ -234,6 +234,38 @@ public class ServerConfigurationBean extends AbstractServerConfigurationBean imp
cifsConfig.setBroadcastMask(broadcastAddess); cifsConfig.setBroadcastMask(broadcastAddess);
} }
// Get the terminal server address
List<String> 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<String> 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 // Get the host configuration
String hostName = cifsConfigBean.getServerName(); String hostName = cifsConfigBean.getServerName();