atg.svc.repository.service
Class QOAAService

java.lang.Object
  extended by atg.nucleus.GenericService
      extended by atg.svc.repository.service.BaseService
          extended by atg.svc.repository.service.KnowledgeBaseService
              extended by atg.svc.repository.service.QOAAService
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class QOAAService
extends KnowledgeBaseService

Maintains the solution scoring. Also supports the retrieval of the the pre-defined solution lists

Version:
$Id: //application/service/version/2007.3/common/src/classes/atg/svc/repository/service/QOAAService.java#2 $$Change: 632007 $
Author:
Chris Aakre

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.svc.repository.service.BaseService
mBeanHomes, mBeanHomesName, mRepositoryHomes, mRepositoryHomesName
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
QOAAService()
           
 
Method Summary
 QOAA create(java.lang.String pSolutionId)
          Creates a new QOAA bean for the specified solution.
 void delete(java.lang.String pSolutionId)
          Deletes a QOAA object to the repository.
 QOAA edit(java.lang.String pSolutionId)
          Gets an editable version of a QOAA given the solution's id.
protected  java.util.List filterSolutions(java.util.Collection pIn, java.util.Collection pTopicIds, java.util.Collection pSolutionClassIds, boolean pRetSolns, int pBatchSize)
          Filter relevant solutions by topic and/or solution class
 QOAA findBySolutionId(java.lang.String pSolutionId)
          Finds a solution relevance object by the solution's repository id.
 java.util.Collection findQOAAByRange(int pStartingIndex, int pBatchSize)
          Used by SolutionScoringService to retrieve QOAA to return.
 java.util.Collection getQOAAByScore(int pMaxCount)
          Gets the Questions Others are Asking List ordered by score returning up to maxCnt.
 atg.svc.repository.service.util.SolutionSecurityUtils getSolutionSecurityUtils()
           
 SolutionService getSolutionService()
           
 void save(QOAA pQOAA)
          Saves a QOAA object to the repository.
 void setSolutionSecurityUtils(atg.svc.repository.service.util.SolutionSecurityUtils pSolutionSecurityUtils)
           
 void setSolutionService(SolutionService pSolutionService)
           
 
Methods inherited from class atg.svc.repository.service.KnowledgeBaseService
getBeanHomes, getRepositoryHomes
 
Methods inherited from class atg.svc.repository.service.BaseService
getBaseBeanHomes, getBaseRepositoryHomes, getBeanHomesName, getRepositoryHomesName, getRepositoryService, getToday, setBeanHomesName, setRepositoryHomesName, setRepositoryService
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingWarning, setServiceInfo, startService, stopService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Constructor Detail

QOAAService

public QOAAService()
Method Detail

getSolutionSecurityUtils

public atg.svc.repository.service.util.SolutionSecurityUtils getSolutionSecurityUtils()
Returns:
Returns the solutionSecurityUtils.

setSolutionSecurityUtils

public void setSolutionSecurityUtils(atg.svc.repository.service.util.SolutionSecurityUtils pSolutionSecurityUtils)
Parameters:
pSolutionSecurityUtils - The solutionSecurityUtils to set.

getSolutionService

public SolutionService getSolutionService()
Returns:
Returns the solutionService.

setSolutionService

public void setSolutionService(SolutionService pSolutionService)
Parameters:
pSolutionService - The solutionService to set.

create

public QOAA create(java.lang.String pSolutionId)
            throws javax.ejb.CreateException,
                   ObjectNotFoundException
Creates a new QOAA bean for the specified solution. Use save to persist the QOAA object.

Parameters:
pSolutionId - Id of the Solution RepImpl object
Returns:
A QOAA BeanImpl.
Throws:
javax.ejb.CreateException - If the create fails.
ObjectNotFoundException - when the solution is not found.

delete

public void delete(java.lang.String pSolutionId)
            throws ObjectNotFoundException,
                   PersistenceException
Deletes a QOAA object to the repository.

Parameters:
pSolutionId - id of solution.
Throws:
ObjectNotFoundException - If the repository item represented by the QOAA bean is not found.
PersistenceException - If the delete operation fails.

edit

public QOAA edit(java.lang.String pSolutionId)
          throws ObjectNotFoundException,
                 javax.ejb.CreateException
Gets an editable version of a QOAA given the solution's id. If a QOAA object does not exist for the solution, a new one is created.

Parameters:
pSolutionId - A Solution RepId
Returns:
A QOAA ReposImpl.
Throws:
ObjectNotFoundException - when the solution is not found
javax.ejb.CreateException - If the create for solution relevance object fails.

getQOAAByScore

public java.util.Collection getQOAAByScore(int pMaxCount)
                                    throws javax.ejb.FinderException
Gets the Questions Others are Asking List ordered by score returning up to maxCnt.

Parameters:
pMaxCount - Maximum number of QOAA to return
Returns:
A collection of Questions Others are Asking objects that have a link to the solution and the solution relevance object
Throws:
javax.ejb.FinderException - When an error occurs

findQOAAByRange

public java.util.Collection findQOAAByRange(int pStartingIndex,
                                            int pBatchSize)
                                     throws javax.ejb.FinderException
Used by SolutionScoringService to retrieve QOAA to return. The SolutionScoringService filters the returned list so you should not call this method directly to retrieve the QOAA list but instead call SolutionScoringService.getQOAAList()

Throws:
javax.ejb.FinderException

findBySolutionId

public QOAA findBySolutionId(java.lang.String pSolutionId)
Finds a solution relevance object by the solution's repository id.

Parameters:
pSolutionId - The repository id of Solution object
Returns:
The SolutionRelevance ReposImpl or null if the SolutionRelevance doesn't exist

filterSolutions

protected java.util.List filterSolutions(java.util.Collection pIn,
                                         java.util.Collection pTopicIds,
                                         java.util.Collection pSolutionClassIds,
                                         boolean pRetSolns,
                                         int pBatchSize)
Filter relevant solutions by topic and/or solution class

Parameters:
pIn - Collection of QOAA objects to filter
pTopicIds - Topic ids (String) to filter by - solution must reference at least one topic. If null or empty, not constrained by topic
pSolutionClassIds - - Solution Class ids (String) to filter by - solution must use one of these solution class. If null or empty, not filtered by solution class
pRetSolns - if true, returns a filtered list of Solution else returns a filtered list of SolutionRelevance
Returns:
List of filtered SolutionRelevance or Solution objects

save

public void save(QOAA pQOAA)
          throws ObjectNotFoundException,
                 PersistenceException
Saves a QOAA object to the repository. It should have the id. The existing object is updated.

Parameters:
pQOAA - The QOAA to save.
Throws:
ObjectNotFoundException - If the repository item represented by the QOAA bean is not found.
PersistenceException - If the save operation fails.