public class CrawlerSessionManagerValve extends ValveBase implements Lifecycle, javax.servlet.http.HttpSessionBindingListener
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
AFTER_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.
|
Map<String,String> |
getClientIpSessionId() |
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(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(javax.servlet.http.HttpSessionBindingEvent event) |
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent event) |
backgroundProcess, createObjectName, event, getContainer, getContainerName, getController, getDomain, getInfo, getNext, getObjectName, getParentName, postDeregister, postRegister, preDeregister, preRegister, setContainer, setController, setNext, setObjectName, toString
protected LifecycleSupport lifecycle
protected boolean started
public void setCrawlerUserAgents(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 Pattern
public String getCrawlerUserAgents()
setCrawlerUserAgents(String)
public void setSessionInactiveInterval(int sessionInactiveInterval)
sessionInactiveInterval
- The new timeout for crawler sessionspublic int getSessionInactiveInterval()
setSessionInactiveInterval(int)
public void addLifecycleListener(LifecycleListener listener)
Lifecycle
addLifecycleListener
in interface Lifecycle
listener
- The listener to addpublic LifecycleListener[] findLifecycleListeners()
Lifecycle
findLifecycleListeners
in interface Lifecycle
public void removeLifecycleListener(LifecycleListener listener)
Lifecycle
removeLifecycleListener
in interface Lifecycle
listener
- The listener to removepublic void start() throws LifecycleException
Lifecycle
start
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic void stop() throws LifecycleException
Lifecycle
stop
in interface Lifecycle
LifecycleException
- if this component detects a fatal error
that needs to be reportedpublic void invoke(Request request, Response response) throws IOException, javax.servlet.ServletException
ValveBase
This method MUST be provided by a subclass.
invoke
in interface Valve
invoke
in class ValveBase
request
- The servlet request to be processedresponse
- The servlet response to be createdIOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet error occurspublic void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
valueBound
in interface javax.servlet.http.HttpSessionBindingListener
public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
valueUnbound
in interface javax.servlet.http.HttpSessionBindingListener
Copyright © 2013 JBoss by Red Hat. All rights reserved.