Class WorkspaceConfig
- java.lang.Object
-
- org.apache.jackrabbit.core.config.WorkspaceConfig
-
- All Implemented Interfaces:
FileSystemFactory,QueryHandlerFactory,ISMLockingFactory
public class WorkspaceConfig extends Object implements FileSystemFactory, ISMLockingFactory, QueryHandlerFactory
Workspace configuration. This configuration class is used to create configured workspace objects.The contained configuration information are: the home directory and name of the workspace, the file system, the persistence manager, the search index and the item state manager locking configuration. The search index and the item state manager locking and the security config are optional parts.
-
-
Constructor Summary
Constructors Constructor Description WorkspaceConfig(String home, String name, boolean clustered, FileSystemFactory fsf, PersistenceManagerConfig pmc, QueryHandlerFactory qhf, ISMLockingFactory ismLockingFactory, WorkspaceSecurityConfig workspaceSecurityConfig)Creates a workspace configuration object.WorkspaceConfig(String home, String name, boolean clustered, FileSystemFactory fsf, PersistenceManagerConfig pmc, QueryHandlerFactory qhf, ISMLockingFactory ismLockingFactory, WorkspaceSecurityConfig workspaceSecurityConfig, ImportConfig importConfig)Creates a workspace configuration object.WorkspaceConfig(String home, String name, boolean clustered, FileSystemFactory fsf, PersistenceManagerConfig pmc, QueryHandlerFactory qhf, ISMLockingFactory ismLockingFactory, WorkspaceSecurityConfig workspaceSecurityConfig, ImportConfig importConfig, long defaultLockTimeout)Creates a workspace configuration object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetDefaultLockTimeout()Returns the default lock timeout in number of seconds orLong.MAX_VALUEwhen not specified.FileSystemgetFileSystem()Creates and returns the configured workspace file system.StringgetHomeDir()Returns the workspace home directory.ImportConfiggetImportConfig()ISMLockinggetISMLocking()Creates and returns the configured workspace locking strategy.StringgetName()Returns the workspace name.PersistenceManagerConfiggetPersistenceManagerConfig()Returns the workspace persistence manager configuration.QueryHandlergetQueryHandler(QueryHandlerContext context)Returns an initialized query handler, ornullif one was not configured.WorkspaceSecurityConfiggetSecurityConfig()booleanisClustered()Returns a flag indicating whether this workspace participates in a cluster.booleanisSearchEnabled()Checks whether search configuration is present.
-
-
-
Constructor Detail
-
WorkspaceConfig
public WorkspaceConfig(String home, String name, boolean clustered, FileSystemFactory fsf, PersistenceManagerConfig pmc, QueryHandlerFactory qhf, ISMLockingFactory ismLockingFactory, WorkspaceSecurityConfig workspaceSecurityConfig)
Creates a workspace configuration object.- Parameters:
home- home directoryname- workspace nameclustered-fsf- file system factorypmc- persistence manager configurationqhf- query handler factory, ornullif not configuredismLockingFactory- the item state manager locking factoryworkspaceSecurityConfig- the workspace specific security configuration.
-
WorkspaceConfig
public WorkspaceConfig(String home, String name, boolean clustered, FileSystemFactory fsf, PersistenceManagerConfig pmc, QueryHandlerFactory qhf, ISMLockingFactory ismLockingFactory, WorkspaceSecurityConfig workspaceSecurityConfig, ImportConfig importConfig)
Creates a workspace configuration object.- Parameters:
home- home directoryname- workspace nameclustered-fsf- file system factorypmc- persistence manager configurationqhf- query handler factory, ornullif not configuredismLockingFactory- the item state manager locking factoryworkspaceSecurityConfig- the workspace specific security configuration.
-
WorkspaceConfig
public WorkspaceConfig(String home, String name, boolean clustered, FileSystemFactory fsf, PersistenceManagerConfig pmc, QueryHandlerFactory qhf, ISMLockingFactory ismLockingFactory, WorkspaceSecurityConfig workspaceSecurityConfig, ImportConfig importConfig, long defaultLockTimeout)
Creates a workspace configuration object.- Parameters:
home- home directoryname- workspace nameclustered-fsf- file system factorypmc- persistence manager configurationqhf- query handler factory, ornullif not configuredismLockingFactory- the item state manager locking factoryworkspaceSecurityConfig- the workspace specific security configuration.defaultLockTimeout- default timeout for locks (in seconds)
-
-
Method Detail
-
getHomeDir
public String getHomeDir()
Returns the workspace home directory.- Returns:
- workspace home directory
-
getName
public String getName()
Returns the workspace name.- Returns:
- the workspace name
-
isClustered
public boolean isClustered()
Returns a flag indicating whether this workspace participates in a cluster.- Returns:
trueif this workspace participates in a cluster;falseotherwise
-
getDefaultLockTimeout
public long getDefaultLockTimeout()
Returns the default lock timeout in number of seconds orLong.MAX_VALUEwhen not specified.- Returns:
- default lock timeout in number of seconds or
Long.MAX_VALUEwhen not specified
-
getISMLocking
public ISMLocking getISMLocking() throws RepositoryException
Creates and returns the configured workspace locking strategy.- Specified by:
getISMLockingin interfaceISMLockingFactory- Returns:
- the configured
ISMLocking - Throws:
RepositoryException- if the locking strategy can not be created
-
getFileSystem
public FileSystem getFileSystem() throws RepositoryException
Creates and returns the configured workspace file system.- Specified by:
getFileSystemin interfaceFileSystemFactory- Returns:
- the configured
FileSystem - Throws:
RepositoryException- if the file system can not be created
-
getPersistenceManagerConfig
public PersistenceManagerConfig getPersistenceManagerConfig()
Returns the workspace persistence manager configuration.- Returns:
- persistence manager configuration
-
isSearchEnabled
public boolean isSearchEnabled()
Checks whether search configuration is present.- Returns:
trueif search is configured,falseotherwise
-
getQueryHandler
public QueryHandler getQueryHandler(QueryHandlerContext context) throws RepositoryException
Returns an initialized query handler, ornullif one was not configured.- Specified by:
getQueryHandlerin interfaceQueryHandlerFactory- Returns:
- initialized query handler, or
null - Throws:
RepositoryException
-
getSecurityConfig
public WorkspaceSecurityConfig getSecurityConfig()
- Returns:
- workspace-specific security settings.
- See Also:
WorkspaceSecurityConfig
-
getImportConfig
public ImportConfig getImportConfig()
- Returns:
- xml import settings
-
-