public class SQLDirectory extends AbstractDirectory
Modifier and Type | Class and Description |
---|---|
protected class |
SQLDirectory.TxSessionCleaner |
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
log |
static String |
TENANT_ID_FIELD |
cache, descriptor, fieldMapper, references, registry, sessionCount, sessionMaxCount
Constructor and Description |
---|
SQLDirectory(SQLDirectoryDescriptor descriptor) |
Modifier and Type | Method and Description |
---|---|
protected void |
addSession(SQLSession session) |
protected void |
checkConnection() |
Connection |
getConnection() |
protected Connection |
getConnection(DataSource aDataSource)
Gets a physical connection from a datasource.
|
protected DataSource |
getDataSource()
DO NOT USE, use getConnection() instead.
|
SQLDirectoryDescriptor |
getDescriptor()
To be implemented with a more specific return type.
|
Dialect |
getDialect() |
Map<String,Field> |
getSchemaFieldMap() |
Session |
getSession()
Creates a session for accessing entries in this directory.
|
List<String> |
getStoredFieldNames() |
Table |
getTable() |
protected void |
initConnection()
Lazy init connection
|
boolean |
isMultiTenant()
Returns
true if this directory is a multi tenant directory, false otherwise. |
protected void |
registerInTx(SQLSession session) |
String |
toString() |
boolean |
useNativeCase() |
addReference, addReferences, addSession, doSanityChecks, getCache, getFieldMapper, getIdField, getName, getParentDirectory, getPasswordField, getReference, getReferences, getReferences, getSchema, invalidateCaches, invalidateDirectoryCache, isReadOnly, isReference, orderEntries, removeSession, setReadOnly, shutdown
public static final org.apache.commons.logging.Log log
public static final String TENANT_ID_FIELD
public SQLDirectory(SQLDirectoryDescriptor descriptor)
public SQLDirectoryDescriptor getDescriptor()
AbstractDirectory
getDescriptor
in class AbstractDirectory
protected void initConnection()
protected DataSource getDataSource() throws DirectoryException
DirectoryException
public Connection getConnection() throws DirectoryException
DirectoryException
protected Connection getConnection(DataSource aDataSource) throws SQLException
A few retries are done to work around databases that have problems with many open/close in a row.
aDataSource
- the datasourceSQLException
public Session getSession() throws DirectoryException
Directory
DirectoryException
- if a session cannot be createdprotected void checkConnection()
protected void addSession(SQLSession session) throws DirectoryException
DirectoryException
protected void registerInTx(SQLSession session) throws DirectoryException
DirectoryException
public Map<String,Field> getSchemaFieldMap()
public List<String> getStoredFieldNames()
public Dialect getDialect()
public boolean useNativeCase()
public boolean isMultiTenant()
Directory
true
if this directory is a multi tenant directory, false
otherwise.isMultiTenant
in interface Directory
isMultiTenant
in class AbstractDirectory
Copyright © 2016 Nuxeo SA. All rights reserved.