Package net.sourceforge.pebble.logging

Examples of net.sourceforge.pebble.logging.CountedUrl


   * @return  a filtered List containing CountedUrls
   */
  public List filter(List referers) {
    List results = new ArrayList();
    Iterator it = referers.iterator();
    CountedUrl referer;
    while (it.hasNext()) {
      referer = (CountedUrl)it.next();
      if (!filter(referer)) {
        results.add(referer);
      }
View Full Code Here


*/
public class CountedUrlComparatorTest extends TestCase {

  public void testCompare() {
    CountedUrlByCountComparator comp = new CountedUrlByCountComparator();
    CountedUrl c1 = new Referer("http://www.google.com");
    CountedUrl c2 = new Referer("http://www.yahoo.com");

    assertTrue(comp.compare(c1, c1) == 0);
    assertTrue(comp.compare(c1, c2) < 0);
    assertTrue(comp.compare(c2, c1) > 0);

    c1.addLogEntry(new LogEntry());
    assertTrue(comp.compare(c1, c2) < 0);
    assertTrue(comp.compare(c2, c1) > 0);

    c2.addLogEntry(new LogEntry());
    c2.addLogEntry(new LogEntry());
    assertTrue(comp.compare(c1, c2) > 0);
    assertTrue(comp.compare(c2, c1) < 0);
  }
View Full Code Here

    }

    // now calculate the total number of requests, after filtering spam
    int totalRequests = 0;
    Iterator it = requests.iterator();
    CountedUrl url;
    while (it.hasNext()) {
      url = (CountedUrl)it.next();
      totalRequests += url.getCount();
    }

    getModel().put("logAction", "viewRequests");
    getModel().put("requests", requests);
    getModel().put("totalRequests", new Integer(totalRequests));
View Full Code Here

    Collections.sort(referers, new CountedUrlByCountComparator());

    // now calculate the total number of referers, after filtering spam
    int totalReferers = 0;
    Iterator it = referers.iterator();
    CountedUrl url;
    while (it.hasNext()) {
      url = (CountedUrl)it.next();
      totalReferers += url.getCount();
    }

    getModel().put("logAction", "viewReferers");
    getModel().put("referers", referers);
    getModel().put("totalReferers", new Integer(totalReferers));
View Full Code Here

TOP

Related Classes of net.sourceforge.pebble.logging.CountedUrl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.