edu.internet2.middleware.shibboleth.common.config.attribute.resolver.dataConnector
Class RDBMSDataConnectorFactoryBean

java.lang.Object
  extended by org.springframework.beans.factory.config.AbstractFactoryBean
      extended by edu.internet2.middleware.shibboleth.common.config.attribute.resolver.AbstractResolutionPluginFactoryBean
          extended by edu.internet2.middleware.shibboleth.common.config.attribute.resolver.dataConnector.BaseDataConnectorFactoryBean
              extended by edu.internet2.middleware.shibboleth.common.config.attribute.resolver.dataConnector.RDBMSDataConnectorFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean

public class RDBMSDataConnectorFactoryBean
extends BaseDataConnectorFactoryBean

Spring factory bean that produces RDBMSDataConnectors.


Field Summary
private  long cacheElementTtl
          Length of time, in milliseconds, elements are cached.
private  net.sf.ehcache.CacheManager cacheManager
          Whether results should be cached.
private  List<RDBMSColumnDescriptor> columnDescriptors
          Result set column descriptors.
private  DataSource connectionDataSource
          Source of connections to the database.
private  int maximumCachedElements
          Maximum number of queries to keep in the cache.
private  boolean noResultsIsError
          Whether an empty result set is an error.
private  String queryTemplate
          SQL query template.
private  long queryTimeout
          SQL query timeout in milliseconds.
private  boolean queryUsesStoredProcedures
          Whether the SQL query uses stored procedures.
private  boolean readOnlyConnections
          Whether the database connections should be read-only.
private  TemplateEngine templateEngine
          Template engine used to transform query templates into queries.
 
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
 
Constructor Summary
RDBMSDataConnectorFactoryBean()
           
 
Method Summary
protected  Object createInstance()
          
 long getCacheElementTimeToLive()
          Gets the time to live, in milliseconds, for cache elements.
 net.sf.ehcache.CacheManager getCacheManager()
          Gets the manager for the results cache.
 List<RDBMSColumnDescriptor> getColumnDescriptors()
          Gets the result set column descriptors.
 DataSource getConnectionDataSource()
          Gets the database connection source.
 int getMaximumCachedElements()
          Gets the maximum number of elements that will be cached.
 Class getObjectType()
          
 String getQueryTemplate()
          Gets the SQL query template.
 long getQueryTimeout()
          Gets the timeout, in milliseconds, of the SQL query.
 boolean getQueryUsesStoredProcedures()
          Gets whether the SQL query uses stored procedures.
 TemplateEngine getTemplateEngine()
          Gets the template engine used to construct the SQL query from the query template.
 boolean isNoResultIsError()
          This returns whether this connector will throw an exception if no search results are found.
 boolean isReadOnlyConnections()
          Gets whether the database connection is read-only.
 void setCacheElementTimeToLive(long ttl)
          Sets the time to live, in milliseconds, for cache elements.
 void setCacheManager(net.sf.ehcache.CacheManager manager)
          Sets the manager for the results cache.
 void setColumnDescriptors(List<RDBMSColumnDescriptor> descriptors)
          Sets the result set column descriptors.
 void setConnectionDataSource(DataSource source)
          Sets the database connection source.
 void setMaximumCachedElements(int max)
          Sets the maximum number of elements that will be cached.
 void setNoResultIsError(boolean b)
          This sets whether this connector will throw an exception if no search results are found.
 void setQueryTemplate(String template)
          Sets the SQL query template.
 void setQueryTimeout(long timeout)
          Sets the timeout, in milliseconds, of the SQL query.
 void setQueryUsesStoredProcedures(boolean storedProcedures)
          Sets whether the SQL query uses stored procedures.
 void setReadOnlyConnections(boolean readOnly)
          Sets whether the database connection is read-only.
 void setTemplateEngine(TemplateEngine engine)
          Sets the template engine used to construct the SQL query from the query template.
 
Methods inherited from class edu.internet2.middleware.shibboleth.common.config.attribute.resolver.dataConnector.BaseDataConnectorFactoryBean
getFailoverDataConnectorId, populateDataConnector, setFailoverDataConnectorIds
 
Methods inherited from class edu.internet2.middleware.shibboleth.common.config.attribute.resolver.AbstractResolutionPluginFactoryBean
getDependencyIds, getPluginId, setDependencyIds, setPluginId
 
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectionDataSource

private DataSource connectionDataSource
Source of connections to the database.


templateEngine

private TemplateEngine templateEngine
Template engine used to transform query templates into queries.


queryTemplate

private String queryTemplate
SQL query template.


queryTimeout

private long queryTimeout
SQL query timeout in milliseconds.


readOnlyConnections

private boolean readOnlyConnections
Whether the database connections should be read-only.


queryUsesStoredProcedures

private boolean queryUsesStoredProcedures
Whether the SQL query uses stored procedures.


noResultsIsError

private boolean noResultsIsError
Whether an empty result set is an error.


columnDescriptors

private List<RDBMSColumnDescriptor> columnDescriptors
Result set column descriptors.


cacheManager

private net.sf.ehcache.CacheManager cacheManager
Whether results should be cached.


maximumCachedElements

private int maximumCachedElements
Maximum number of queries to keep in the cache.


cacheElementTtl

private long cacheElementTtl
Length of time, in milliseconds, elements are cached.

Constructor Detail

RDBMSDataConnectorFactoryBean

public RDBMSDataConnectorFactoryBean()
Method Detail

getObjectType

public Class getObjectType()

Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean
Specified by:
getObjectType in class org.springframework.beans.factory.config.AbstractFactoryBean

isNoResultIsError

public boolean isNoResultIsError()
This returns whether this connector will throw an exception if no search results are found. The default is false.

Returns:
boolean

setNoResultIsError

public void setNoResultIsError(boolean b)
This sets whether this connector will throw an exception if no search results are found.

Parameters:
b - boolean

getColumnDescriptors

public List<RDBMSColumnDescriptor> getColumnDescriptors()
Gets the result set column descriptors.

Returns:
result set column descriptors

setColumnDescriptors

public void setColumnDescriptors(List<RDBMSColumnDescriptor> descriptors)
Sets the result set column descriptors.

Parameters:
descriptors - result set column descriptors

getConnectionDataSource

public DataSource getConnectionDataSource()
Gets the database connection source.

Returns:
database connection source.

setConnectionDataSource

public void setConnectionDataSource(DataSource source)
Sets the database connection source.

Parameters:
source - database connection source

getTemplateEngine

public TemplateEngine getTemplateEngine()
Gets the template engine used to construct the SQL query from the query template.

Returns:
template engine used to construct the SQL query from the query template

setTemplateEngine

public void setTemplateEngine(TemplateEngine engine)
Sets the template engine used to construct the SQL query from the query template.

Parameters:
engine - template engine used to construct the SQL query from the query template

getQueryTemplate

public String getQueryTemplate()
Gets the SQL query template.

Returns:
SQL query template

setQueryTemplate

public void setQueryTemplate(String template)
Sets the SQL query template.

Parameters:
template - SQL query template

getQueryTimeout

public long getQueryTimeout()
Gets the timeout, in milliseconds, of the SQL query.

Returns:
timeout, in milliseconds, of the SQL query.

setQueryTimeout

public void setQueryTimeout(long timeout)
Sets the timeout, in milliseconds, of the SQL query.

Parameters:
timeout - timeout, in milliseconds, of the SQL query.

getQueryUsesStoredProcedures

public boolean getQueryUsesStoredProcedures()
Gets whether the SQL query uses stored procedures.

Returns:
whether the SQL query uses stored procedures

setQueryUsesStoredProcedures

public void setQueryUsesStoredProcedures(boolean storedProcedures)
Sets whether the SQL query uses stored procedures.

Parameters:
storedProcedures - whether the SQL query uses stored procedures

getCacheManager

public net.sf.ehcache.CacheManager getCacheManager()
Gets the manager for the results cache.

Returns:
manager for the results cache

setCacheManager

public void setCacheManager(net.sf.ehcache.CacheManager manager)
Sets the manager for the results cache.

Parameters:
manager - manager for the results cache

getCacheElementTimeToLive

public long getCacheElementTimeToLive()
Gets the time to live, in milliseconds, for cache elements.

Returns:
time to live, in milliseconds, for cache elements

setCacheElementTimeToLive

public void setCacheElementTimeToLive(long ttl)
Sets the time to live, in milliseconds, for cache elements.

Parameters:
ttl - time to live, in milliseconds, for cache elements

getMaximumCachedElements

public int getMaximumCachedElements()
Gets the maximum number of elements that will be cached.

Returns:
maximum number of elements that will be cached

setMaximumCachedElements

public void setMaximumCachedElements(int max)
Sets the maximum number of elements that will be cached.

Parameters:
max - maximum number of elements that will be cached

isReadOnlyConnections

public boolean isReadOnlyConnections()
Gets whether the database connection is read-only.

Returns:
whether the database connection is read-only

setReadOnlyConnections

public void setReadOnlyConnections(boolean readOnly)
Sets whether the database connection is read-only.

Parameters:
readOnly - whether the database connection is read-only

createInstance

protected Object createInstance()
                         throws Exception

Specified by:
createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean
Throws:
Exception


Copyright © 1999-2012. All Rights Reserved.