atg.targeting
Class TargetingResults

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.targeting.TargetingResults
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 TargetingResults
extends GenericService

A service which can be used to perform a targeting operation and produce an Enumeration of targeting results.

When the bufferSize property is specified, targeting is performed in chunks - each time more elements are needed, they are obtained by performing a targeting operation which returns the next array of size bufferSize.

See Also:
TargetingEnumeration, Targeter, TargetingSourceMap

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
TargetingResults()
           
 
Method Summary
 void doStartService()
          Called after the service has been created, placed into the naming hierarchy, and initialized with its configured property values.
 int getBufferSize()
          Returns the number of items to target for in each iteration.
 ComponentNameResolver getNameResolver()
          Returns a ComponentNameResolver corresponding to the source map, if it has been specified; otherwise, returns a global ComponentNameResolver.
 ComponentNameResolver getNameResolver(DynamoHttpServletRequest pRequest)
          Returns a ComponentNameResolver corresponding to the source map, if it has been specified; otherwise, returns the ComponentNameResolver which uses the passed in request for resolution.
 java.util.Enumeration getResults()
          Returns targeting results as an Enumeration.
 java.util.Enumeration getResults(DynamoHttpServletRequest pRequest)
          Returns targeting results as an Enumeration.
 TargetingSourceMap getSourceMap()
          Returns the source map used by the targeter.
 Targeter getTargeter()
          Returns the targeter to use for the targeting operation.
 void setBufferSize(int pBufferSize)
          Sets the number of items to target for in each iteration.
 void setSourceMap(TargetingSourceMap pSourceMap)
          Sets the source map used by the targeter.
 void setTargeter(Targeter pTargeter)
          Sets the targeter to use for the targeting operation.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, 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

TargetingResults

public TargetingResults()
Method Detail

getTargeter

public Targeter getTargeter()
Returns the targeter to use for the targeting operation.


setTargeter

public void setTargeter(Targeter pTargeter)
Sets the targeter to use for the targeting operation.


getSourceMap

public TargetingSourceMap getSourceMap()
Returns the source map used by the targeter.


setSourceMap

public void setSourceMap(TargetingSourceMap pSourceMap)
Sets the source map used by the targeter.


getNameResolver

public ComponentNameResolver getNameResolver(DynamoHttpServletRequest pRequest)
Returns a ComponentNameResolver corresponding to the source map, if it has been specified; otherwise, returns the ComponentNameResolver which uses the passed in request for resolution.

See Also:
ComponentNameResolver, TargetingSourceMap.getNameResolver(DynamoHttpServletRequest)

getNameResolver

public ComponentNameResolver getNameResolver()
Returns a ComponentNameResolver corresponding to the source map, if it has been specified; otherwise, returns a global ComponentNameResolver. Note that this resolver won't be able to resolve session or request-scoped components, because it does not have a handle on the request.

See Also:
NameResolver, TargetingSourceMap.getNameResolver()

getBufferSize

public int getBufferSize()
Returns the number of items to target for in each iteration. If zero, only one targeting operation will be performed, with all the targeting results returned at once.


setBufferSize

public void setBufferSize(int pBufferSize)
Sets the number of items to target for in each iteration. If zero, only one targeting operation will be performed, with all the targeting results returned at once.


getResults

public java.util.Enumeration getResults(DynamoHttpServletRequest pRequest)
Returns targeting results as an Enumeration. This is the preferred version of the method - it allows the targeting rules to depend on the properties of the current request or session. The given request is used to resolve any references to session- and request-scoped components (such as "Profile," "Request").


getResults

public java.util.Enumeration getResults()
Returns targeting results as an Enumeration. This method is equivalent to getResults(null), and should only be called if the targeter's rules don't depend on the properties of the current request or session.


doStartService

public void doStartService()
                    throws ServiceException
Called after the service has been created, placed into the naming hierarchy, and initialized with its configured property values. Makes sure all the required properties have been set in the .properties file.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the service had a problem starting up