public class WGFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SYSPROPERTY_EVENTTHREAD
System property to turn off the usage of an event thread.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addUserAccessFilter(UserAccessFilter filter)
Registers a user access filter for use on all databases
|
void |
closeAll()
Permanently close all opened databases.
|
void |
closeSessions()
Close all open sessions on all databases.
|
<T extends WGDatabaseServer> |
createDatabaseServer(java.lang.Class<T> serverClass,
java.util.Map<java.lang.String,java.lang.String> options)
Tool method for creating database servers when using WGAPI as library (rather than from inside WGA).
|
void |
finalize() |
static AuthModuleFactory |
getAuthModuleFactory()
Returns the Factory for Authentication Modules used by databases of this factory.
|
net.sf.ehcache.CacheManager |
getCacheManager()
Returns the EHCache Cache Manager used by this WGFactory and its databases
|
static java.lang.Class<? extends WGWorkflowEngine> |
getDefaultWorkflowEngine()
Returns the default workflow engine to use
|
WGEventThread |
getEventThread() |
static HttpClientFactory |
getHttpClientFactory()
Returns the factory use to create HttpClient instances
|
static java.lang.ClassLoader |
getImplementationLoader()
Returns the class loader to load WGAPI implementations
|
static WGFactory |
getInstance()
Returns the singleton instance of the factory
|
static org.apache.log4j.Logger |
getLogger()
Returns the logger object to be used by all objects inside the WGAPI
|
static WGMailService |
getMailService()
Returns the mail service that the WGAPI uses, for example for sending workflow notification mails
|
MetaInfo |
getMetaInfo(java.lang.String name,
java.lang.Class<? extends MetaInfoProvider> c)
Returns the MetaInfo for given name of the given class
|
java.util.Map<java.lang.String,MetaInfo> |
getMetaInfos(java.lang.Class<? extends MetaInfoProvider> c)
returns the MetaInfos Map for the given class
|
static MimetypeDeterminationService |
getMimetypeDeterminationService()
Returns a service for determining file mimetypes
|
static de.innovationgate.wga.modules.ModuleRegistry |
getModuleRegistry()
Returns the module registry to use by the WGAPI
|
java.util.List<WGDatabase> |
getOpenedDatabases()
Returns a list of all opened database objects.
|
static WGDatabaseRevisionSerializer |
getRevisionSerializer(java.lang.Class<?> revClass)
Deprecated.
Since database revisions are always instances of
WGDatabaseRevision now having their own serialisation/deserialisation methods |
static java.io.File |
getTempDir()
Returns the directory for temporary files used by the WGAPI.
|
UserAccessFilter |
getUserAccessFilter(java.lang.String filterUid)
Returns a registered user access filter by its uid
|
boolean |
isDatabaseBackendMaintenanceEnabled()
Returns if daily database maintenance is generally enabled
|
boolean |
isDatabaseMaintenanceEnabled()
Deprecated.
Because of changed semantics. Use
isDatabaseBackendMaintenanceEnabled() instead. |
static boolean |
isEventThread()
Returns true, if the current thread is the WGAPI event thread
|
WGDatabase |
openDatabase(WGDatabaseServer server,
java.lang.String strType,
java.lang.String strPath,
java.lang.String strUserName,
java.lang.String strUserPwd,
java.util.Map<java.lang.String,java.lang.String> options)
Opens a WGA database initially, ready for work.
|
WGDatabase |
openDatabase(WGDatabaseServer server,
java.lang.String strType,
java.lang.String strPath,
java.lang.String strUserName,
java.lang.String strUserPwd,
java.util.Map<java.lang.String,java.lang.String> options,
boolean prepareOnly)
Opens a WGA database initially.
|
void |
openSessions()
Opens sessions on all not yet opened databases with master session information.
|
void |
openSessions(java.lang.String user,
java.lang.String password)
Opens sessions on all not yet opened databases with a given login.
|
WGDatabase |
prepareDatabase(WGDatabaseServer server,
java.lang.String strType,
java.lang.String strPath,
java.lang.String strUserName,
java.lang.String strUserPwd,
java.util.Map<java.lang.String,java.lang.String> options)
Opens a WGA database initially, but only prepares it for work.
|
static void |
setAuthModuleFactory(AuthModuleFactory authModuleFactory)
Sets the Factory for Authentication Modules used by databases of this factory
|
void |
setDatabaseBackendMaintenanceEnabled(boolean databaseMaintenanceEnabled)
Sets if daily database maintenance is generally enabled
|
void |
setDatabaseMaintenanceEnabled(boolean databaseMaintenanceEnabled)
Deprecated.
Because of changed semantics. Use
setDatabaseBackendMaintenanceEnabled(boolean) instead. |
static void |
setDefaultWorkflowEngine(java.lang.Class<? extends WGWorkflowEngine> defaultWorkflowEngine)
Sets the default workflow engine to use by the WGAPI
|
static void |
setHttpClientFactory(HttpClientFactory httpClientFactory)
set the factory use to create HttpClient instances in WGA
|
static void |
setImplementationLoader(java.lang.ClassLoader loader)
Sets a class loader that is used to load WGAPI implementation classes
|
static void |
setMailService(WGMailService mailService)
Sets the mail service to use in WGAPI
|
static void |
setMimetypeDeterminationService(MimetypeDeterminationService mimetypeDeterminationService)
Returns a service for determining file mimetypes
|
static void |
setModuleRegistry(de.innovationgate.wga.modules.ModuleRegistry moduleRegistry)
Sets the module registry to use by the WGAPI
|
static void |
setTempDir(java.io.File tempDir)
Sets the directory for temporary files used by the WGAPI.
|
void |
shutdown()
Shutdown all databases and the factory
|
public static final java.lang.String SYSPROPERTY_EVENTTHREAD
public static de.innovationgate.wga.modules.ModuleRegistry getModuleRegistry()
public static void setModuleRegistry(de.innovationgate.wga.modules.ModuleRegistry moduleRegistry)
public static WGDatabaseRevisionSerializer getRevisionSerializer(java.lang.Class<?> revClass) throws WGAPIException
WGDatabaseRevision
now having their own serialisation/deserialisation methodsrevClass
- The java class in which revisions are servedWGAPIException
public static boolean isEventThread()
public MetaInfo getMetaInfo(java.lang.String name, java.lang.Class<? extends MetaInfoProvider> c) throws WGSystemException
name
- The metadata field namec
- The implementation class of the document typeWGSystemException
- if the metaDataFramework cannot be accessedpublic java.util.Map<java.lang.String,MetaInfo> getMetaInfos(java.lang.Class<? extends MetaInfoProvider> c) throws WGSystemException
c
- ClassWGSystemException
public static WGFactory getInstance()
public void finalize()
finalize
in class java.lang.Object
public WGDatabase openDatabase(WGDatabaseServer server, java.lang.String strType, java.lang.String strPath, java.lang.String strUserName, java.lang.String strUserPwd, java.util.Map<java.lang.String,java.lang.String> options, boolean prepareOnly) throws WGAPIException
server
- The database server that this database resides onstrType
- The type of the database, i.e. the database implementation class to usestrPath
- The path of the database. Varies by implementation.strUserName
- The user name to use as master login.strUserPwd
- The password for the master login.options
- Additional creation options.prepareOnly
- Lets the database only be prepared (test connectivity) and connected on first sessionWGAPIException
public WGDatabase openDatabase(WGDatabaseServer server, java.lang.String strType, java.lang.String strPath, java.lang.String strUserName, java.lang.String strUserPwd, java.util.Map<java.lang.String,java.lang.String> options) throws WGAPIException
server
- The database server that this database resides onstrType
- The type of the database, i.e. the database implementation class to usestrPath
- The path of the database. Varies by implementation.strUserName
- The user name to use as master login.strUserPwd
- The password for the master login.options
- Additional creation options.WGAPIException
public WGDatabase prepareDatabase(WGDatabaseServer server, java.lang.String strType, java.lang.String strPath, java.lang.String strUserName, java.lang.String strUserPwd, java.util.Map<java.lang.String,java.lang.String> options) throws WGAPIException
server
- The database server that this database resides onstrType
- The type of the database, i.e. the database implementation class to usestrPath
- The path of the database. Varies by implementation.strUserName
- The user name to use as master login.strUserPwd
- The password for the master login.options
- Additional creation options.WGAPIException
public void closeSessions()
public void openSessions(java.lang.String user, java.lang.String password) throws WGAPIException
user
- password
- WGAPIException
public void openSessions() throws WGAPIException
WGAPIException
public java.util.List<WGDatabase> getOpenedDatabases()
public void closeAll()
public void shutdown()
public static org.apache.log4j.Logger getLogger()
public static java.lang.ClassLoader getImplementationLoader()
public static void setImplementationLoader(java.lang.ClassLoader loader)
public static java.io.File getTempDir()
public static void setTempDir(java.io.File tempDir)
public static AuthModuleFactory getAuthModuleFactory()
public static void setAuthModuleFactory(AuthModuleFactory authModuleFactory)
public net.sf.ehcache.CacheManager getCacheManager() throws net.sf.ehcache.CacheException
net.sf.ehcache.CacheException
public <T extends WGDatabaseServer> T createDatabaseServer(java.lang.Class<T> serverClass, java.util.Map<java.lang.String,java.lang.String> options) throws java.lang.InstantiationException, java.lang.IllegalAccessException, WGAPIException
T
- serverClass
- The class of the server to createoptions
- Options for the database serverjava.lang.InstantiationException
java.lang.IllegalAccessException
WGAPIException
public static java.lang.Class<? extends WGWorkflowEngine> getDefaultWorkflowEngine()
public static void setDefaultWorkflowEngine(java.lang.Class<? extends WGWorkflowEngine> defaultWorkflowEngine)
public static WGMailService getMailService()
public static void setMailService(WGMailService mailService)
public static MimetypeDeterminationService getMimetypeDeterminationService()
public static void setMimetypeDeterminationService(MimetypeDeterminationService mimetypeDeterminationService)
public static HttpClientFactory getHttpClientFactory()
public static void setHttpClientFactory(HttpClientFactory httpClientFactory)
public java.lang.String addUserAccessFilter(UserAccessFilter filter)
filter
- The filter to addpublic UserAccessFilter getUserAccessFilter(java.lang.String filterUid)
filterUid
- The uidpublic boolean isDatabaseBackendMaintenanceEnabled()
public void setDatabaseBackendMaintenanceEnabled(boolean databaseMaintenanceEnabled)
public boolean isDatabaseMaintenanceEnabled()
isDatabaseBackendMaintenanceEnabled()
instead.public void setDatabaseMaintenanceEnabled(boolean databaseMaintenanceEnabled)
setDatabaseBackendMaintenanceEnabled(boolean)
instead.public WGEventThread getEventThread()