public class CrawlerSessionManagerValve extends ValveBase implements Lifecycle
| Modifier and Type | Field and Description |
|---|---|
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component.
|
protected boolean |
started |
container, controller, domain, info, mserver, next, oname, smAFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT| Constructor and Description |
|---|
CrawlerSessionManagerValve() |
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(LifecycleListener listener)
Add a LifecycleEvent listener to this component.
|
LifecycleListener[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle.
|
java.util.Map<java.lang.String,java.lang.String> |
getClientIpSessionId() |
java.lang.String |
getCrawlerUserAgents() |
int |
getSessionInactiveInterval() |
void |
invoke(Request request,
Response response)
The implementation-specific logic represented by this Valve.
|
void |
removeLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component.
|
void |
setCrawlerUserAgents(java.lang.String crawlerUserAgents)
Specify the regular expression (using
Pattern) that will be used
to identify crawlers based in the User-Agent header provided. |
void |
setSessionInactiveInterval(int sessionInactiveInterval)
Specify the session timeout (in seconds) for a crawler's session.
|
void |
start()
Prepare for the beginning of active use of the public methods of this
component.
|
void |
stop()
Gracefully terminate the active use of the public methods of this
component.
|
void |
valueBound(HttpSessionBindingEvent event) |
void |
valueUnbound(HttpSessionBindingEvent event) |
backgroundProcess, createObjectName, event, getContainer, getContainerName, getController, getDomain, getInfo, getNext, getObjectName, getParentName, postDeregister, postRegister, preDeregister, preRegister, setContainer, setController, setNext, setObjectName, toStringprotected LifecycleSupport lifecycle
protected boolean started
public void setCrawlerUserAgents(java.lang.String crawlerUserAgents)
Pattern) that will be used
to identify crawlers based in the User-Agent header provided. The default
is ".*GoogleBot.*|.*bingbot.*|.*Yahoo! Slurp.*"crawlerUserAgents - The regular expression using Patternpublic java.lang.String getCrawlerUserAgents()
setCrawlerUserAgents(String)public void setSessionInactiveInterval(int sessionInactiveInterval)
sessionInactiveInterval - The new timeout for crawler sessionspublic int getSessionInactiveInterval()
setSessionInactiveInterval(int)public java.util.Map<java.lang.String,java.lang.String> getClientIpSessionId()
public void addLifecycleListener(LifecycleListener listener)
LifecycleaddLifecycleListener in interface Lifecyclelistener - The listener to addpublic LifecycleListener[] findLifecycleListeners()
LifecyclefindLifecycleListeners in interface Lifecyclepublic void removeLifecycleListener(LifecycleListener listener)
LifecycleremoveLifecycleListener in interface Lifecyclelistener - The listener to removepublic void start()
throws LifecycleException
Lifecyclestart in interface LifecycleLifecycleException - if this component detects a fatal error
that prevents this component from being usedpublic void stop()
throws LifecycleException
Lifecyclestop in interface LifecycleLifecycleException - if this component detects a fatal error
that needs to be reportedpublic void invoke(Request request, Response response) throws java.io.IOException, ServletException
ValveBaseThis method MUST be provided by a subclass.
public void valueBound(HttpSessionBindingEvent event)
public void valueUnbound(HttpSessionBindingEvent event)