com.primus.ae.searchclient
Class ClientRequestImpl

java.lang.Object
  extended by com.primus.ae.searchclient.ClientRequestImpl
All Implemented Interfaces:
atg.search.routing.command.SearchEngineRequest, ClientRequest, java.io.Serializable
Direct Known Subclasses:
ClientCategorizeRequest, ClientCategoryRequest, ClientQueryRequest, ClientSimilarDocsRequest, ClientStructuredRequest, ClientVicRequest

public abstract class ClientRequestImpl
extends java.lang.Object
implements ClientRequest, java.io.Serializable

Base class for client requests, with implementations for most of ClientRequest's methods.

See Also:
Serialized Form

Field Summary
protected  DocumentSetConstraint constraints
           
protected  boolean listPropertyAllowed
           
protected  boolean loggingEnabled
           
protected  boolean mLoggingThisRequest
           
protected  java.lang.String mRequestIdentifier
           
protected  long mRequestTime
           
protected  ParserOptions parsingOptions
           
protected  java.util.Map requestAttributes
           
 
Fields inherited from interface com.primus.ae.searchclient.ClientRequest
BROWSE, CATEGORIZE, INSPECT, QUERY, REQUEST_TAG_BROWSE, REQUEST_TAG_CATEGORIZE, REQUEST_TAG_QUERY, REQUEST_TAG_SIMILARDOCS, REQUEST_TAG_STRUCTQUERY, REQUEST_TAG_VIC, SIMILARDOCS, STRUCTQUERY, TAGS, VIC
 
Fields inherited from interface atg.search.routing.command.SearchEngineRequest
CLASS_VERSION
 
Constructor Summary
protected ClientRequestImpl()
           
protected ClientRequestImpl(java.util.Map requestAttributes, DocumentSetConstraint constraints, ParserOptions parserOptions, boolean loggingEnabled)
           
 
Method Summary
 DocumentSetConstraint getConstraints()
          Returns the constraints object, which might be null.
 java.lang.String getConstraintsXml()
          Returns the constraints XML, possibly an empty string
 ParserOptions getParsingOptions()
          Returns ParserOptions
 java.lang.String getParsingOptionsXml()
          Returns parserOptions XML, possibly an empty string.
 java.lang.String getRequestAttribute(java.lang.Object attributeName)
          Gets an individual request attribute
 java.util.Map getRequestAttributes()
          Gets all request attributes
 java.lang.String getRequestIdentifier()
           
 java.lang.String getRequestTag()
           
 long getRequestTime()
          The time of day that the request occured, in milliseconds since 1970.
protected static java.lang.String getSearchConstraints(java.lang.String constraints)
          Returns the XML presentation of Search constraints.
 boolean isFiringSearchEvents()
          Indicates whether search events are being fired.
 boolean isKeepingResponseData()
           
 boolean isListPropertyAllowed()
          Returns false by default.
 boolean isLoggingEnabled()
          Indicates whether DB logging is enabled or disabled
 boolean isLoggingThisRequest()
          Indicates whether this request will be logged.
 atg.search.routing.command.SearchEngineCommandResponse processResponse(atg.search.routing.command.SearchEngineResponse response)
          returns null, because these requests use old legacy response processing
 void setConstraints(DocumentSetConstraint constraints)
          Sets the document set constraints for the query
 void setFiringSearchEvents(boolean pFiringSearchEvents)
          Enables or disables firing of search events.
 void setKeepingResponseData(boolean keepResponseData)
          Pass in true to force inclusion of all data received as part of the search.
 void setListPropertyAllowed(boolean listPropertyAllowed)
          Enables storage of multi-valued properties in the Result's properties HashMap.
 void setLoggingEnabled(boolean loggingEnabled)
          Enables or disables DB logging
 void setLoggingThisRequest(boolean pLoggingThisRequest)
          Controls whether this request--and only this request--will generate debug logs.
 void setParsingOptions(ParserOptions parsingOptions)
           
 void setRequestAttribute(java.lang.Object attributeName, java.lang.Object attributeValue)
          Sets an individual request attreibute's value
 void setRequestAttributes(java.util.Map requestAttributes)
          Replaces all request attributes
 void setRequestIdentifier(java.lang.String pRequestIdentifier)
          Unique request identifier.
 void setRequestTime(long pRequestTime)
          Sets the time of request in milliseconds (as in the time of day).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.primus.ae.searchclient.ClientRequest
getRequestId
 
Methods inherited from interface atg.search.routing.command.SearchEngineRequest
toXML
 

Field Detail

requestAttributes

protected java.util.Map requestAttributes

loggingEnabled

protected boolean loggingEnabled

constraints

protected DocumentSetConstraint constraints

parsingOptions

protected ParserOptions parsingOptions

listPropertyAllowed

protected boolean listPropertyAllowed

mRequestIdentifier

protected java.lang.String mRequestIdentifier

mRequestTime

protected long mRequestTime

mLoggingThisRequest

protected boolean mLoggingThisRequest
Constructor Detail

ClientRequestImpl

protected ClientRequestImpl()

ClientRequestImpl

protected ClientRequestImpl(java.util.Map requestAttributes,
                            DocumentSetConstraint constraints,
                            ParserOptions parserOptions,
                            boolean loggingEnabled)
Parameters:
requestAttributes -
constraints -
loggingEnabled -
Method Detail

processResponse

public atg.search.routing.command.SearchEngineCommandResponse processResponse(atg.search.routing.command.SearchEngineResponse response)
                                                                       throws atg.search.routing.command.RoutingCommandException
returns null, because these requests use old legacy response processing

Specified by:
processResponse in interface atg.search.routing.command.SearchEngineRequest
Parameters:
response -
Returns:
null
Throws:
atg.search.routing.command.RoutingCommandException

setRequestTime

public void setRequestTime(long pRequestTime)
Sets the time of request in milliseconds (as in the time of day). Set automatically.

Specified by:
setRequestTime in interface ClientRequest
Parameters:
pRequestTime - current time in milliseconds

getRequestTime

public long getRequestTime()
The time of day that the request occured, in milliseconds since 1970.

Specified by:
getRequestTime in interface ClientRequest
Returns:
time of request in milliseconds

setFiringSearchEvents

public void setFiringSearchEvents(boolean pFiringSearchEvents)
Enables or disables firing of search events. Calls setLoggingEnabled(boolean).

Specified by:
setFiringSearchEvents in interface atg.search.routing.command.SearchEngineRequest
Parameters:
pFiringSearchEvents - true if search events are being fired

isFiringSearchEvents

public boolean isFiringSearchEvents()
Indicates whether search events are being fired. Calls isLoggingEnabled()

Specified by:
isFiringSearchEvents in interface atg.search.routing.command.SearchEngineRequest
Returns:
true if events are being fired

isLoggingEnabled

public boolean isLoggingEnabled()
Description copied from interface: ClientRequest
Indicates whether DB logging is enabled or disabled

Specified by:
isLoggingEnabled in interface ClientRequest
Returns:
true if logging is enabled

setLoggingEnabled

public void setLoggingEnabled(boolean loggingEnabled)
Description copied from interface: ClientRequest
Enables or disables DB logging

Specified by:
setLoggingEnabled in interface ClientRequest
Parameters:
loggingEnabled - true if logging is enabled

getRequestAttributes

public java.util.Map getRequestAttributes()
Gets all request attributes

Specified by:
getRequestAttributes in interface atg.search.routing.command.SearchEngineRequest
Returns:
map of request attributes

getRequestAttribute

public java.lang.String getRequestAttribute(java.lang.Object attributeName)
Gets an individual request attribute

Specified by:
getRequestAttribute in interface atg.search.routing.command.SearchEngineRequest
Parameters:
attributeName - Name of attribute
Returns:
attribute value

setRequestAttributes

public void setRequestAttributes(java.util.Map requestAttributes)
Replaces all request attributes

Specified by:
setRequestAttributes in interface atg.search.routing.command.SearchEngineRequest
Parameters:
requestAttributes - map of request attributes

setRequestAttribute

public void setRequestAttribute(java.lang.Object attributeName,
                                java.lang.Object attributeValue)
Sets an individual request attreibute's value

Specified by:
setRequestAttribute in interface atg.search.routing.command.SearchEngineRequest
Parameters:
attributeName - name of attribute
attributeValue - value of attribute

getRequestIdentifier

public java.lang.String getRequestIdentifier()
Specified by:
getRequestIdentifier in interface ClientRequest
Returns:
unique request identifier

setRequestIdentifier

public void setRequestIdentifier(java.lang.String pRequestIdentifier)
Unique request identifier. Routing sets this automatically.

Specified by:
setRequestIdentifier in interface ClientRequest
Parameters:
pRequestIdentifier - unique identifier for this request

getConstraints

public DocumentSetConstraint getConstraints()
Returns the constraints object, which might be null. For convenience, use getConstraintsXml to get just the XML.

Specified by:
getConstraints in interface ClientRequest
Returns:
constraints
See Also:
getConstraintsXml()

getConstraintsXml

public java.lang.String getConstraintsXml()
Returns the constraints XML, possibly an empty string

Returns:
constraints XML

setConstraints

public void setConstraints(DocumentSetConstraint constraints)
Description copied from interface: ClientRequest
Sets the document set constraints for the query

Specified by:
setConstraints in interface ClientRequest
Parameters:
constraints - constraints

getParsingOptions

public ParserOptions getParsingOptions()
Returns ParserOptions

Specified by:
getParsingOptions in interface ClientRequest
Returns:
parsing options

getParsingOptionsXml

public java.lang.String getParsingOptionsXml()
Returns parserOptions XML, possibly an empty string.

Returns:
parsing options

setParsingOptions

public void setParsingOptions(ParserOptions parsingOptions)
Specified by:
setParsingOptions in interface ClientRequest
Parameters:
parsingOptions - parsing options

getSearchConstraints

protected static java.lang.String getSearchConstraints(java.lang.String constraints)
Returns the XML presentation of Search constraints.

Returns:
a String value of document Sets XML element

setKeepingResponseData

public void setKeepingResponseData(boolean keepResponseData)
Pass in true to force inclusion of all data received as part of the search. Note that this dramatically increases the size of the results object.

Specified by:
setKeepingResponseData in interface atg.search.routing.command.SearchEngineRequest
Parameters:
keepResponseData - true if response data should be kept and returned in the results.

isKeepingResponseData

public boolean isKeepingResponseData()
Specified by:
isKeepingResponseData in interface atg.search.routing.command.SearchEngineRequest
Returns:
true if response data will be preserved in the results, false otherwise

isListPropertyAllowed

public boolean isListPropertyAllowed()
Returns false by default. If true, expect Lists from the Result's properties HashMap. Otherwise expect Strings.

Specified by:
isListPropertyAllowed in interface ClientRequest
Returns:

setListPropertyAllowed

public void setListPropertyAllowed(boolean listPropertyAllowed)
Enables storage of multi-valued properties in the Result's properties HashMap. All values will be Lists, whether or not they are multi-valued. Default is false.

Specified by:
setListPropertyAllowed in interface ClientRequest
Parameters:
listPropertyAllowed - true to enable list properties

getRequestTag

public java.lang.String getRequestTag()
Specified by:
getRequestTag in interface atg.search.routing.command.SearchEngineRequest

setLoggingThisRequest

public void setLoggingThisRequest(boolean pLoggingThisRequest)
Controls whether this request--and only this request--will generate debug logs.

Specified by:
setLoggingThisRequest in interface atg.search.routing.command.SearchEngineRequest
Parameters:
pLoggingThisRequest - pass true to enable logging for this request

isLoggingThisRequest

public boolean isLoggingThisRequest()
Indicates whether this request will be logged.

Specified by:
isLoggingThisRequest in interface atg.search.routing.command.SearchEngineRequest
Returns:
whether this request will be logged