Updates to support AVM filesystems.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4389 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2006-11-17 14:52:54 +00:00
parent 10b48c7f2a
commit d452a3890a

View File

@@ -40,6 +40,7 @@ import org.alfresco.config.ConfigElement;
import org.alfresco.config.ConfigLookupContext; import org.alfresco.config.ConfigLookupContext;
import org.alfresco.config.ConfigService; import org.alfresco.config.ConfigService;
import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.filesys.avm.AVMContext;
import org.alfresco.filesys.ftp.FTPPath; import org.alfresco.filesys.ftp.FTPPath;
import org.alfresco.filesys.ftp.InvalidPathException; import org.alfresco.filesys.ftp.InvalidPathException;
import org.alfresco.filesys.netbios.NetBIOSName; import org.alfresco.filesys.netbios.NetBIOSName;
@@ -154,6 +155,10 @@ public class ServerConfiguration extends AbstractLifecycleBean
private DiskInterface diskInterface; private DiskInterface diskInterface;
// AVM filesystem interface
private DiskInterface avmDiskInterface;
// Runtime platform type // Runtime platform type
private PlatformType m_platform = PlatformType.Unknown; private PlatformType m_platform = PlatformType.Unknown;
@@ -376,47 +381,98 @@ public class ServerConfiguration extends AbstractLifecycleBean
m_serverList = new NetworkServerList(); m_serverList = new NetworkServerList();
} }
/**
* Set the authentication manager
*
* @param authenticationManager AuthenticationManager
*/
public void setAuthenticationManager(AuthenticationManager authenticationManager) public void setAuthenticationManager(AuthenticationManager authenticationManager)
{ {
this.authenticationManager = authenticationManager; this.authenticationManager = authenticationManager;
} }
/**
* Set the authentication service
*
* @param authenticationService AuthenticationService
*/
public void setAuthenticationService(AuthenticationService authenticationService) public void setAuthenticationService(AuthenticationService authenticationService)
{ {
this.authenticationService = authenticationService; this.authenticationService = authenticationService;
} }
/**
* Set the configuration service
*
* @param configService ConfigService
*/
public void setConfigService(ConfigService configService) public void setConfigService(ConfigService configService)
{ {
this.configService = configService; this.configService = configService;
} }
/**
* Set the filesystem driver for the node service based filesystem
*
* @param diskInterface DiskInterface
*/
public void setDiskInterface(DiskInterface diskInterface) public void setDiskInterface(DiskInterface diskInterface)
{ {
this.diskInterface = diskInterface; this.diskInterface = diskInterface;
} }
/**
* Set the filesystem driver for the AVM based filesystem
*
*/
public void setAvmDiskInterface(DiskInterface diskInterface)
{
this.avmDiskInterface = diskInterface;
}
/**
* Set the authentication component
*
* @param component AuthenticationComponent
*/
public void setAuthenticationComponent(AuthenticationComponent component) public void setAuthenticationComponent(AuthenticationComponent component)
{ {
m_authenticationComponent = component; m_authenticationComponent = component;
} }
/**
* Set the node service
*
* @param service NodeService
*/
public void setNodeService(NodeService service) public void setNodeService(NodeService service)
{ {
m_nodeService = service; m_nodeService = service;
} }
/**
* Set the person service
*
* @param service PersonService
*/
public void setPersonService(PersonService service) public void setPersonService(PersonService service)
{ {
m_personService = service; m_personService = service;
} }
/**
* Set the transaction service
*
* @param service TransactionService
*/
public void setTransactionService(TransactionService service) public void setTransactionService(TransactionService service)
{ {
m_transactionService = service; m_transactionService = service;
} }
/** /**
* Check if the configuration has been initialized
*
* @return Returns true if the configuration was fully initialised * @return Returns true if the configuration was fully initialised
*/ */
public boolean isInitialised() public boolean isInitialised()
@@ -1617,67 +1673,88 @@ public class ServerConfiguration extends AbstractLifecycleBean
// Get the current filesystem configuration // Get the current filesystem configuration
ConfigElement elem = filesysElems.get(i); ConfigElement elem = filesysElems.get(i);
String filesysType = elem.getName();
String filesysName = elem.getAttribute("name"); String filesysName = elem.getAttribute("name");
try try
{ {
// Create a new filesystem driver instance and create a context for // Check the filesystem type and use the appropriate driver
// the new filesystem
DiskInterface filesysDriver = this.diskInterface; DiskSharedDevice filesys = null;
ContentContext filesysContext = (ContentContext) filesysDriver.createContext(elem);
// Check if an access control list has been specified if ( filesysType.equalsIgnoreCase("avmfilesystem"))
{
// Create a new filesystem driver instance and create a context for
// the new filesystem
AccessControlList acls = null; DiskInterface filesysDriver = this.avmDiskInterface;
ConfigElement aclElem = elem.getChild("accessControl"); AVMContext filesysContext = (AVMContext) filesysDriver.createContext(elem);
if (aclElem != null) // Create the shared filesystem
{
// Parse the access control list filesys = new DiskSharedDevice(filesysName, filesysDriver, filesysContext);
}
else
{
// Create a new filesystem driver instance and create a context for
// the new filesystem
acls = processAccessControlList(aclElem); DiskInterface filesysDriver = this.diskInterface;
} ContentContext filesysContext = (ContentContext) filesysDriver.createContext(elem);
else if (hasGlobalAccessControls())
{
// Use the global access control list for this disk share // Check if an access control list has been specified
acls = getGlobalAccessControls(); AccessControlList acls = null;
} ConfigElement aclElem = elem.getChild("accessControl");
// Check if change notifications are disabled if (aclElem != null)
{
boolean changeNotify = elem.getChild("disableChangeNotification") == null ? true : false; // Parse the access control list
// Create the shared filesystem acls = processAccessControlList(aclElem);
}
else if (hasGlobalAccessControls())
{
DiskSharedDevice filesys = new DiskSharedDevice(filesysName, filesysDriver, filesysContext); // Use the global access control list for this disk share
// Attach desktop actions to the filesystem acls = getGlobalAccessControls();
}
ConfigElement deskActionsElem = elem.getChild("desktopActions"); // Check if change notifications are disabled
if ( deskActionsElem != null)
{
// Get the desktop actions list
DesktopActionTable desktopActions = processDesktopActions(deskActionsElem, filesys); boolean changeNotify = elem.getChild("disableChangeNotification") == null ? true : false;
if ( desktopActions != null)
filesysContext.setDesktopActions( desktopActions, filesysDriver);
}
// Add any access controls to the share // Create the shared filesystem
filesys.setAccessControlList(acls); filesys = new DiskSharedDevice(filesysName, filesysDriver, filesysContext);
// Enable/disable change notification for this device // Attach desktop actions to the filesystem
filesysContext.enableChangeHandler(changeNotify); ConfigElement deskActionsElem = elem.getChild("desktopActions");
if ( deskActionsElem != null)
{
// Get the desktop actions list
// Start the filesystem DesktopActionTable desktopActions = processDesktopActions(deskActionsElem, filesys);
if ( desktopActions != null)
filesysContext.setDesktopActions( desktopActions, filesysDriver);
}
filesysContext.startFilesystem(filesys); // Add any access controls to the share
filesys.setAccessControlList(acls);
// Enable/disable change notification for this device
filesysContext.enableChangeHandler(changeNotify);
// Start the filesystem
filesysContext.startFilesystem(filesys);
}
// Create the shared device and add to the list of available // Create the shared device and add to the list of available
// shared filesystems // shared filesystems
@@ -2291,6 +2368,16 @@ public class ServerConfiguration extends AbstractLifecycleBean
return diskInterface; return diskInterface;
} }
/**
* Return the disk interface to be used to create AVM filesystem shares
*
* @return DiskInterface
*/
public final DiskInterface getAvmDiskInterface()
{
return avmDiskInterface;
}
/** /**
* Return the domain name. * Return the domain name.
* *