atg.search.formhandlers
Class SearchContext

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.search.formhandlers.SearchContext
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class SearchContext
extends GenericService

This component provides a place to store session data for use by search form handlers.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
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
SearchContext()
           
 
Method Summary
 void clearSearchSessions()
           
 java.lang.String[] getFailoverConnections()
           
 int getMaxAttemptsBeforeFailover()
           
 java.lang.String getPrimaryConnection()
           
 SearchClient getSearchClient()
           
 atg.search.events.SearchMessageTools getSearchMessageService()
           
 atg.search.client.SearchSession getSearchSession(java.lang.String pRequestChainToken)
          Get the search session used to track user in ATG Search.
 boolean isFiringSearchEvents()
           
 boolean isUseSmallReportingResponse()
           
 void mapSearchSession(java.lang.String pRequestChainToken, atg.search.client.SearchSession pSearchSession, java.lang.String pPreviousRequestChainToken)
          maps the request chain id to the search session, replacing any prior mapping of the session.
 void reconnect()
           
 void setFailoverConnections(java.lang.String[] pFailoverConnections)
           
 void setFiringSearchEvents(boolean pFiringSearchEvents)
          Controls whether reporting logging is enabled.
 void setMaxAttemptsBeforeFailover(int pMaxAttemptsBeforeFailover)
           
 void setPrimaryConnection(java.lang.String pPrimaryConnection)
           
 void setSearchMessageService(atg.search.events.SearchMessageTools pSearchMessageService)
          Set the search message service for reporting
 void setSearchSession(atg.search.client.SearchSession pSearchSession)
          Sets the search session and clears any mapped sessions, since the two types of session data are incompatible
 void setUseSmallReportingResponse(boolean pUseSmallReportingResponse)
           
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

SearchContext

public SearchContext()
Method Detail

getMaxAttemptsBeforeFailover

public int getMaxAttemptsBeforeFailover()

setMaxAttemptsBeforeFailover

public void setMaxAttemptsBeforeFailover(int pMaxAttemptsBeforeFailover)

reconnect

public void reconnect()
               throws atg.search.client.SearchClientException
Throws:
atg.search.client.SearchClientException

getSearchClient

public SearchClient getSearchClient()
                             throws atg.search.client.SearchClientException
Returns:
an initialized searchclient
Throws:
atg.search.client.SearchClientException - if it could not be initialized

getSearchSession

public atg.search.client.SearchSession getSearchSession(java.lang.String pRequestChainToken)
Get the search session used to track user in ATG Search. If a token is passed, an attempt will be made to locate an associated session; the single search session will be returned if no such session exists

Parameters:
pRequestChainToken - a request chain token, or null if there isn't one.
Returns:
the Search session

setSearchSession

public void setSearchSession(atg.search.client.SearchSession pSearchSession)
Sets the search session and clears any mapped sessions, since the two types of session data are incompatible

Parameters:
pSearchSession - the Search session

mapSearchSession

public void mapSearchSession(java.lang.String pRequestChainToken,
                             atg.search.client.SearchSession pSearchSession,
                             java.lang.String pPreviousRequestChainToken)
                      throws atg.search.client.SearchClientException
maps the request chain id to the search session, replacing any prior mapping of the session. A prior mapping is located with the search session's token property, which, if non-null, will indicate the previous request chain. This ensures that the session is only ever associated with a single request chain.

Parameters:
pRequestChainToken - request chain identifier from the response
pSearchSession - the ATG Search session
pPreviousRequestChainToken - optional previous token
Throws:
atg.search.client.SearchClientException - if the token is null or empty

isFiringSearchEvents

public boolean isFiringSearchEvents()
Returns:
true if reporting logging is enabled and the search message service is available

setFiringSearchEvents

public void setFiringSearchEvents(boolean pFiringSearchEvents)
Controls whether reporting logging is enabled.

Parameters:
pFiringSearchEvents - true if reporting logging should be enabled

isUseSmallReportingResponse

public boolean isUseSmallReportingResponse()
Returns:
true if using small response objects for reporting

setUseSmallReportingResponse

public void setUseSmallReportingResponse(boolean pUseSmallReportingResponse)
Parameters:
pUseSmallReportingResponse - true to enable use of small response objects for reporting

getSearchMessageService

public atg.search.events.SearchMessageTools getSearchMessageService()
Returns:
search message service, null if not set

setSearchMessageService

public void setSearchMessageService(atg.search.events.SearchMessageTools pSearchMessageService)
Set the search message service for reporting

Parameters:
pSearchMessageService -

getPrimaryConnection

public java.lang.String getPrimaryConnection()

setPrimaryConnection

public void setPrimaryConnection(java.lang.String pPrimaryConnection)

getFailoverConnections

public java.lang.String[] getFailoverConnections()

setFailoverConnections

public void setFailoverConnections(java.lang.String[] pFailoverConnections)

clearSearchSessions

public void clearSearchSessions()