Return-Path: Delivered-To: apmail-portals-jetspeed-dev-archive@www.apache.org Received: (qmail 61770 invoked from network); 24 Oct 2005 18:15:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Oct 2005 18:15:43 -0000 Received: (qmail 68009 invoked by uid 500); 24 Oct 2005 18:15:41 -0000 Delivered-To: apmail-portals-jetspeed-dev-archive@portals.apache.org Received: (qmail 67978 invoked by uid 500); 24 Oct 2005 18:15:41 -0000 Mailing-List: contact jetspeed-dev-help@portals.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jetspeed Developers List" Delivered-To: mailing list jetspeed-dev@portals.apache.org Received: (qmail 67945 invoked by uid 99); 24 Oct 2005 18:15:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2005 11:15:40 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 24 Oct 2005 11:15:37 -0700 Received: (qmail 61455 invoked by uid 65534); 24 Oct 2005 18:15:18 -0000 Message-ID: <20051024181518.61452.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r328117 - /portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/statistics/PortalStatistics.java Date: Mon, 24 Oct 2005 18:15:18 -0000 To: jetspeed-dev@portals.apache.org From: taylor@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: taylor Date: Mon Oct 24 11:15:17 2005 New Revision: 328117 URL: http://svn.apache.org/viewcvs?rev=328117&view=rev Log: http://issues.apache.org/jira/browse/JS2-362 Start of implementation of portal statistic component Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/statistics/PortalStatistics.java Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/statistics/PortalStatistics.java URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/statistics/PortalStatistics.java?rev=328117&view=auto ============================================================================== --- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/statistics/PortalStatistics.java (added) +++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/statistics/PortalStatistics.java Mon Oct 24 11:15:17 2005 @@ -0,0 +1,87 @@ +/* Copyright 2004 Apache Software Foundation +* +* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package org.apache.jetspeed.statistics; + +import org.apache.jetspeed.request.RequestContext; +import org.apache.pluto.om.portlet.PortletDefinition; + +/** + * Simple implementation of the PortletStatsService. This implementation + * uses Apache Common Log Format (CLF) as its default log format. + * This format uses the following pattern string: "%h %l %u %t \"%r\" %>s %b", + * where: + *
    + *
  • %h - remote host
  • + *
  • %l - remote log name
  • + *
  • %u - remote user
  • + *
  • %t - time in common log time format
  • + *
  • %r - first line of request
  • + *
  • %s - status (either 200 or 401)
  • + *
  • %b - bytes sent (always "-" for no bytes sent). Optionally, portlet load time may be logged (see logLoadTime property)
  • + *
+ *

+ * Here's an example log entry: + *

+ * 127.0.0.1 - turbine [26/Aug/2002:11:44:40 -0500] "GET /jetspeed/DatabaseBrowserTest HTTP/1.1" 200 - + *

+ * TODO: + *

    + *
  • Statistics cache (by portlet and by user)
  • + *
  • Portlet exclusion
  • + *
  • Configurable format pattern
  • + *
+ * + * @author David Sean Taylor + * @author Mark Orciuch + * @author Richard Klein + * @version $Id: $ + */ +public interface PortalStatistics +{ + /** + * Returns sevice enabled state + * + * @return true if service is enabled + */ + public boolean isEnabled(); + + /** + * Sets service enabled state + * + * @param state new state + * @return original service enabled state + */ + public boolean setEnabled(boolean state); + + /** + * Logs portlet access using default load time. + * + * @param data Current request info object + * @param portlet Portlet being logged + * @param statusCode HTTP status code. For now, either 200 (successfull) or 401 (unauthorized) + */ + public void logAccess(RequestContext request, PortletDefinition portlet, String statusCode); + + /** + * Logs portlet access. + * + * @param data Current request info object + * @param portlet Portlet being logged + * @param statusCode HTTP status code. For now, either 200 (successfull) or 401 (unauthorized) + */ + public void logAccess(RequestContext request, PortletDefinition portlet, String statusCode, long time); + + // TODO: define remaining APIs for Pages, User access +} \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org For additional commands, e-mail: jetspeed-dev-help@portals.apache.org