public class CrawlerSessionManagerValve extends ValveBase implements HttpSessionBindingListener
Lifecycle.SingleUseasyncSupported, container, containerLog, next, smmserverAFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT| Constructor and Description |
|---|
CrawlerSessionManagerValve()
Specifies a default constructor so async support can be configured.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
getClientIpSessionId() |
String |
getCrawlerUserAgents() |
int |
getSessionInactiveInterval() |
protected void |
initInternal()
Sub-classes wishing to perform additional initialization should override
this method, ensuring that super.initInternal() is the first call in the
overriding method.
|
void |
invoke(Request request,
Response response)
Perform request processing as required by this Valve.
|
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 |
valueUnbound(HttpSessionBindingEvent event)
Notifies the object that it is being unbound from a session and
identifies the session.
|
backgroundProcess, getContainer, getDomainInternal, getNext, getObjectNameKeyProperties, isAsyncSupported, setAsyncSupported, setContainer, setNext, startInternal, stopInternal, toStringdestroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregisteraddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitvalueBoundpublic CrawlerSessionManagerValve()
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 Patternpublic String getCrawlerUserAgents()
setCrawlerUserAgents(String)public void setSessionInactiveInterval(int sessionInactiveInterval)
sessionInactiveInterval - The new timeout for crawler sessionspublic int getSessionInactiveInterval()
setSessionInactiveInterval(int)protected void initInternal()
throws LifecycleException
LifecycleMBeanBaseinitInternal in class ValveBaseLifecycleExceptionpublic void invoke(Request request, Response response) throws IOException, ServletException
ValvePerform request processing as required by this Valve.
An individual Valve MAY perform the following actions, in the specified order:
getNext().invoke().
A Valve MUST NOT do any of the following things:
getNext().invoke() method has returned.
getNext().invoke() method has
returned.
invoke in interface Valverequest - The servlet request to be processedresponse - The servlet response to be createdIOException - if an input/output error occurs, or is thrown
by a subsequently invoked Valve, Filter, or ServletServletException - if a servlet error occurs, or is thrown
by a subsequently invoked Valve, Filter, or Servletpublic void valueUnbound(HttpSessionBindingEvent event)
javax.servlet.http.HttpSessionBindingListenervalueUnbound in interface HttpSessionBindingListenerevent - the event that identifies the sessionHttpSessionBindingListener.valueBound(javax.servlet.http.HttpSessionBindingEvent)Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.