org.alfresco.query
Class AbstractCannedQueryFactory

java.lang.Object
  extended by org.alfresco.query.AbstractCannedQueryFactory
All Implemented Interfaces:
CannedQueryFactory, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
AbstractCachingCannedQueryFactory

public abstract class AbstractCannedQueryFactory
extends java.lang.Object
implements CannedQueryFactory, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanNameAware

Basic services for CannedQueryFactory implementations.

Since:
4.0

Constructor Summary
AbstractCannedQueryFactory()
           
 
Method Summary
 void afterPropertiesSet()
          Registers the instance
 CannedQuery getCannedQuery(java.lang.Object parameterBean, int skipResults, int pageSize, java.lang.String queryExecutionId)
          Retrieve an instance of a CannedQuery based on limited parameters.
protected  java.lang.String getQueryExecutionId(CannedQueryParameters parameters)
          Helper method to construct a unique query execution ID based on the instance of the factory and the parameters provided.
 void setBeanName(java.lang.String name)
          Set the name with which to register
 void setRegistry(NamedObjectRegistry registry)
          Set the registry with which to register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.query.CannedQueryFactory
getCannedQuery
 

Constructor Detail

AbstractCannedQueryFactory

public AbstractCannedQueryFactory()
Method Detail

setBeanName

public void setBeanName(java.lang.String name)
Set the name with which to register

Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware
Parameters:
name - the name of the bean

setRegistry

public void setRegistry(NamedObjectRegistry registry)
Set the registry with which to register


afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Registers the instance

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

getQueryExecutionId

protected java.lang.String getQueryExecutionId(CannedQueryParameters parameters)
Helper method to construct a unique query execution ID based on the instance of the factory and the parameters provided.

Parameters:
parameters - the query parameters
Returns:
a unique query instance ID

getCannedQuery

public CannedQuery getCannedQuery(java.lang.Object parameterBean,
                                  int skipResults,
                                  int pageSize,
                                  java.lang.String queryExecutionId)
Retrieve an instance of a CannedQuery based on limited parameters.

Specified by:
getCannedQuery in interface CannedQueryFactory
Parameters:
parameterBean - the values that the query will be based on or null if not relevant to the query
skipResults - results to skip before page
pageSize - the size of page - ie. max items (if skipResults = 0)
queryExecutionId - ID of a previously-executed query to be used during follow-up page requests - null if not available
Returns:
an implementation that will execute the query


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.