detect crawlers and strippers and chop off their sessions

This commit is contained in:
Eric J. Bowersox
2004-11-05 23:48:17 +00:00
parent 28d09ea769
commit cdbb987cd6
4 changed files with 103 additions and 26 deletions
@@ -0,0 +1,53 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.ui.helpers;
import com.silverwrist.venice.ui.*;
public class SessionKiller implements AutoCleanup
{
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private final VeniceUISession m_sess;
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
public SessionKiller(VeniceUISession sess)
{
m_sess = sess;
} // end constructor
/*--------------------------------------------------------------------------------
* Implementations from interface AutoCleanup
*--------------------------------------------------------------------------------
*/
public void cleanup()
{
m_sess.invalidate();
} // end cleanup
} // end class SessionKiller
@@ -24,9 +24,7 @@ import org.w3c.dom.*;
import com.silverwrist.util.StringUtil;
import com.silverwrist.venice.core.*;
import com.silverwrist.venice.ui.VeniceUISession;
import com.silverwrist.venice.ui.helpers.CookieControl;
import com.silverwrist.venice.ui.helpers.HTMLRendering;
import com.silverwrist.venice.ui.helpers.SessionControl;
import com.silverwrist.venice.ui.helpers.*;
import com.silverwrist.venice.util.*;
public class ScriptLibrary
@@ -220,6 +218,12 @@ public class ScriptLibrary
} // end join
public final BrowserInformation queryBrowserInformation(ServiceProvider sp)
{
return (BrowserInformation)(sp.queryService(BrowserInformation.class));
} // end queryBrowserInformation
public final CookieControl queryCookieControl(ServiceProvider sp)
{
return (CookieControl)(sp.queryService(CookieControl.class));
@@ -110,6 +110,11 @@ class BrowserDatabase
} // end finally
if (m_broken)
logger.info("BrowserDatabase: load broken");
else
logger.info("BrowserDatabase: loaded " + m_browser_list.size() + " entries");
} // end constructor
/*--------------------------------------------------------------------------------