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,9 +1673,29 @@ 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
{
// Check the filesystem type and use the appropriate driver
DiskSharedDevice filesys = null;
if ( filesysType.equalsIgnoreCase("avmfilesystem"))
{
// Create a new filesystem driver instance and create a context for
// the new filesystem
DiskInterface filesysDriver = this.avmDiskInterface;
AVMContext filesysContext = (AVMContext) filesysDriver.createContext(elem);
// Create the shared filesystem
filesys = new DiskSharedDevice(filesysName, filesysDriver, filesysContext);
}
else
{ {
// Create a new filesystem driver instance and create a context for // Create a new filesystem driver instance and create a context for
// the new filesystem // the new filesystem
@@ -1653,7 +1729,7 @@ public class ServerConfiguration extends AbstractLifecycleBean
// Create the shared filesystem // Create the shared filesystem
DiskSharedDevice filesys = new DiskSharedDevice(filesysName, filesysDriver, filesysContext); filesys = new DiskSharedDevice(filesysName, filesysDriver, filesysContext);
// Attach desktop actions to the filesystem // Attach desktop actions to the filesystem
@@ -1678,6 +1754,7 @@ public class ServerConfiguration extends AbstractLifecycleBean
// Start the filesystem // Start the filesystem
filesysContext.startFilesystem(filesys); 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.
* *