portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r330607 - /portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/
Date Thu, 03 Nov 2005 18:57:22 GMT
Author: taylor
Date: Thu Nov  3 10:57:08 2005
New Revision: 330607

URL: http://svn.apache.org/viewcvs?rev=330607&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-362
Implemented database support for statistics component

Added:
    portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedPageStatistics.java
    portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedPortletStatistics.java
    portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedStatistics.java
    portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedUserStatistics.java
    portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/LogRecord.java
    portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/PageLogRecord.java
    portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/PortletLogRecord.java
    portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/UserLogRecord.java

Added: portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedPageStatistics.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedPageStatistics.java?rev=330607&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedPageStatistics.java
(added)
+++ portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedPageStatistics.java
Thu Nov  3 10:57:08 2005
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2000-2004 The 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.impl;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+/**
+ * <p>
+ * BatchedPageStatistics
+ * </p>
+ * 
+ * @author <a href="mailto:chris@bluesunrise.com">Chris Schaefer</a>
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: TestPortletEntityDAO.java,v 1.3 2005/05/24 14:43:19 ate Exp $
+ */
+public class BatchedPageStatistics extends BatchedStatistics
+{
+
+    public BatchedPageStatistics(DataSource ds, int batchSize,
+            long msElapsedTimeThreshold, String name)
+    {
+        super(ds, batchSize, msElapsedTimeThreshold, name);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.jetspeed.statistics.impl.BatchedStatistics#canDoRecordType(org.apache.jetspeed.statistics.impl.LogRecord)
+     */
+    public boolean canDoRecordType(LogRecord rec)
+    {
+        return (rec instanceof PageLogRecord);
+    }
+
+    /**
+     * @param stm
+     * @param recordIterator
+     * @throws SQLException
+     */
+    protected void loadOneRecordToStatement(PreparedStatement stm, LogRecord rec)
+            throws SQLException
+    {
+        PageLogRecord record = (PageLogRecord) rec;
+
+        stm.setString(1, record.getIpAddress());
+        stm.setString(2, record.getUserName());
+        stm.setTimestamp(3, record.getTimeStamp());
+        stm.setString(4, record.getPagePath());
+        stm.setInt(5, record.getStatus());
+        stm.setLong(6, record.getMsElapsedTime());
+
+    }
+
+    /**
+     * @param con
+     * @return
+     * @throws SQLException
+     */
+    protected PreparedStatement getPreparedStatement(Connection con)
+            throws SQLException
+    {
+        PreparedStatement stm;
+        stm = con
+                .prepareStatement("INSERT INTO PAGE_STATISTICS VALUES(?,?,?,?,?,?)");
+        return stm;
+    }
+
+}

Added: portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedPortletStatistics.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedPortletStatistics.java?rev=330607&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedPortletStatistics.java
(added)
+++ portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedPortletStatistics.java
Thu Nov  3 10:57:08 2005
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2000-2001,2004 The 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.impl;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+/**
+ * Batches up LogRecord statistics, and flushes them periodically to the
+ * appropriate table in the database.
+ * <P>
+ * IMPORTANT: It is the caller's responsibility to insure that the LogRecord
+ * instances added to a BatchedStatistics instance are all of the same type
+ * (Portlet Access, Page Access, or User Logout).
+ * 
+ * @author <a href="mailto:chris@bluesunrise.com">Chris Schaefer</a>
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: TestPortletEntityDAO.java,v 1.3 2005/05/24 14:43:19 ate Exp $
+ */
+public class BatchedPortletStatistics extends BatchedStatistics
+{
+
+    public BatchedPortletStatistics(DataSource ds, int batchSize,
+            long msElapsedTimeThreshold, String name)
+    {
+        super(ds, batchSize, msElapsedTimeThreshold, name);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.jetspeed.statistics.impl.BatchedStatistics#canDoRecordType(org.apache.jetspeed.statistics.impl.LogRecord)
+     */
+    public boolean canDoRecordType(LogRecord rec)
+    {
+        return (rec instanceof PortletLogRecord);
+    }
+
+    /**
+     * @param stm
+     * @param recordIterator
+     * @throws SQLException
+     */
+    protected void loadOneRecordToStatement(PreparedStatement stm, LogRecord rec)
+            throws SQLException
+    {
+        PortletLogRecord record = (PortletLogRecord) rec;
+
+        stm.setString(1, record.getIpAddress());
+        stm.setString(2, record.getUserName());
+        stm.setTimestamp(3, record.getTimeStamp());
+        stm.setString(4, record.getPagePath());
+        stm.setString(5, record.getPortletName());
+        stm.setInt(6, record.getStatus());
+        stm.setLong(7, record.getMsElapsedTime());
+
+    }
+
+    /**
+     * @param con
+     * @return
+     * @throws SQLException
+     */
+    protected PreparedStatement getPreparedStatement(Connection con)
+            throws SQLException
+    {
+        PreparedStatement stm;
+        stm = con
+                .prepareStatement("INSERT INTO PORTLET_STATISTICS VALUES(?,?,?,?,?,?,?)");
+        return stm;
+    }
+
+}

Added: portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedStatistics.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedStatistics.java?rev=330607&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedStatistics.java
(added)
+++ portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedStatistics.java
Thu Nov  3 10:57:08 2005
@@ -0,0 +1,221 @@
+/*
+ * Copyright 2000-2004 The 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.impl;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.sql.DataSource;
+
+/**
+ * <p>
+ * BatchedStatistics
+ * </p>
+ * 
+ * @author <a href="mailto:chris@bluesunrise.com">Chris Schaefer</a>
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: TestPortletEntityDAO.java,v 1.3 2005/05/24 14:43:19 ate Exp $
+ */
+public abstract class BatchedStatistics implements Runnable
+{
+
+    public BatchedStatistics(DataSource ds, int batchSize,
+            long msElapsedTimeThreshold, String name)
+    {
+        this.ds = ds;
+        this.msElapsedTimeThreshold = msElapsedTimeThreshold;
+        this.batchSize = batchSize;
+        this.name = name;
+        if (this.name == null)
+        {
+            this.name = this.getClass().getName();
+        }
+        msLastFlushTime = System.currentTimeMillis();
+        thread = new Thread(this, name);
+        thread.start();
+        // give a quick break until the thread is running
+        // we know thread is running when done is false
+        while (this.done)
+        {
+            try
+            {
+                Thread.sleep(1);
+            } catch (InterruptedException e)
+            {
+            }
+        }
+
+    }
+
+    protected Connection getConnection() throws SQLException
+    {
+        return ds.getConnection();
+    }
+
+    /**
+     * should only be called from code synchronized to the linked list
+     */
+    private void checkAndDoFlush()
+    {
+        long msCurrentTime = System.currentTimeMillis();
+        if ((logRecords.size() >= batchSize)
+                || (msCurrentTime - msLastFlushTime > msElapsedTimeThreshold))
+        {
+            flush();
+            msLastFlushTime = msCurrentTime;
+        }
+    }
+
+    public void addStatistic(LogRecord logRecord)
+    {
+        synchronized (logRecords)
+        {
+            logRecords.add(logRecord);
+            checkAndDoFlush();
+        }
+    }
+
+    public boolean isDone()
+    {
+        return done;
+    }
+
+    public void tellThreadToStop()
+    {
+        keepRunning = false;
+        //this.thread.notify();
+    }
+
+    private boolean done = true;
+
+    private boolean keepRunning = true;
+
+    public void run()
+    {
+        done = false;
+        while (keepRunning)
+        {
+            try
+            {
+                synchronized(this.thread) {
+                    this.thread.wait(msElapsedTimeThreshold / 4);
+                }
+            } 
+            catch (InterruptedException ie)
+            {
+                keepRunning = false;
+            }
+            synchronized (logRecords)
+            {
+                checkAndDoFlush();
+            }
+        }
+        // force a flush on the way out even if the constraints have not been
+        // met
+        synchronized (logRecords)
+        {
+            flush();
+        }
+        done = true;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.jetspeed.statistics.impl.BatchedStatistics#flush() should
+     *      only be called from code synchronized to the linked list
+     */
+    public void flush()
+    {
+        if (logRecords.isEmpty()) return;
+
+        Connection con = null;
+        PreparedStatement stm = null;
+
+        try
+        {
+            con = getConnection();
+            boolean autoCommit = con.getAutoCommit();
+            con.setAutoCommit(false);
+
+            stm = getPreparedStatement(con);
+            Iterator recordIterator = logRecords.iterator();
+            while (recordIterator.hasNext())
+            {
+                LogRecord record = (LogRecord) recordIterator.next();
+
+                loadOneRecordToStatement(stm, record);
+
+                stm.addBatch();
+            }
+            int[] updateCounts = stm.executeBatch();
+            con.commit();
+            // only clear the records if we actually store them...
+            logRecords.clear();
+            con.setAutoCommit(autoCommit);
+        } catch (SQLException e)
+        {
+            // todo log to standard Jetspeed logger
+            e.printStackTrace();
+        } finally
+        {
+            try
+            {
+                if (stm != null) stm.close();
+            } catch (SQLException se)
+            {
+            }
+            releaseConnection(con);
+        }
+    }
+
+    abstract protected PreparedStatement getPreparedStatement(Connection con)
+            throws SQLException;
+
+    abstract protected void loadOneRecordToStatement(PreparedStatement stm,
+            LogRecord rec) throws SQLException;
+
+    void releaseConnection(Connection con)
+    {
+        try
+        {
+            if (con != null) con.close();
+        } catch (SQLException e)
+        {
+        }
+    }
+
+    protected Thread thread;
+
+    protected long msLastFlushTime = 0;
+
+    protected int batchSize = 10;
+
+    protected long msElapsedTimeThreshold = 5000;
+
+    protected List logRecords = new LinkedList();
+
+    protected DataSource ds = null;
+
+    protected String name;
+
+    public abstract boolean canDoRecordType(LogRecord rec);
+
+}

Added: portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedUserStatistics.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedUserStatistics.java?rev=330607&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedUserStatistics.java
(added)
+++ portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/BatchedUserStatistics.java
Thu Nov  3 10:57:08 2005
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2000-2004 The 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.impl;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+/**
+ * <p>
+ * BatchedUserStatistics
+ * </p>
+ * 
+ * @author <a href="mailto:chris@bluesunrise.com">Chris Schaefer</a>
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: TestPortletEntityDAO.java,v 1.3 2005/05/24 14:43:19 ate Exp $
+ */
+public class BatchedUserStatistics extends BatchedStatistics
+{
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.jetspeed.statistics.impl.BatchedStatistics#canDoRecordType(org.apache.jetspeed.statistics.impl.LogRecord)
+     */
+    public boolean canDoRecordType(LogRecord rec)
+    {
+        return (rec instanceof UserLogRecord);
+    }
+
+    public BatchedUserStatistics(DataSource ds, int batchSize,
+            long msElapsedTimeThreshold, String name)
+    {
+        super(ds, batchSize, msElapsedTimeThreshold, name);
+    }
+
+    /**
+     * @param stm
+     * @param recordIterator
+     * @throws SQLException
+     */
+    protected void loadOneRecordToStatement(PreparedStatement stm, LogRecord rec)
+            throws SQLException
+    {
+        UserLogRecord record = (UserLogRecord) rec;
+
+        stm.setString(1, record.getIpAddress());
+        stm.setString(2, record.getUserName());
+        stm.setTimestamp(3, record.getTimeStamp());
+        stm.setInt(4, record.getStatus());
+        stm.setLong(5, record.getMsElapsedTime());
+    }
+
+    /**
+     * @param con
+     * @return
+     * @throws SQLException
+     */
+    protected PreparedStatement getPreparedStatement(Connection con)
+            throws SQLException
+    {
+        PreparedStatement stm;
+        stm = con
+                .prepareStatement("INSERT INTO USER_STATISTICS VALUES(?,?,?,?,?)");
+        return stm;
+    }
+
+}

Added: portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/LogRecord.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/LogRecord.java?rev=330607&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/LogRecord.java
(added)
+++ portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/LogRecord.java
Thu Nov  3 10:57:08 2005
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2000-2001,2004 The 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.impl;
+
+import java.sql.Timestamp;
+
+/**
+ * LogRecord
+ * <P>
+ * Abstract class that holds the fields of a log entry generated by
+ * implementations of the PortalStatistics interface.
+ * <P>
+ * Some of the fields are common to all types of log entries; those fields are
+ * implemented in LogRecord. The fields that are specific to a particular type
+ * of log entry need to be implemented in a class that extends LogRecord.
+ * 
+ * @author <a href="mailto:rklein@bluesunrise.com">Richard D. Klein </a>
+ * @version $Id: LogRecord.java 188420 2005-03-23 22:25:50Z rdk $
+ */
+public abstract class LogRecord
+{
+
+    public static final String TYPE_PORTLET = "PORTLET";
+
+    public static final String TYPE_PAGE = "PAGE";
+
+    public static final String TYPE_USER = "USER";
+
+    protected String ipAddress = null;
+
+    protected String logType = null;
+
+    protected long msElapsedTime = 0;
+
+    protected int status = 0;
+
+    protected Timestamp timeStamp = null;
+
+    protected String userName = null;
+
+    public LogRecord(String logType)
+    {
+        this.logType = logType;
+    }
+
+    /**
+     * @return Returns the ipAddress.
+     */
+    public String getIpAddress()
+    {
+        return ipAddress;
+    }
+
+    /**
+     * @param ipAddress
+     *            The ipAddress to set.
+     */
+    public void setIpAddress(String ipAddress)
+    {
+        this.ipAddress = ipAddress;
+    }
+
+    /**
+     * @return Returns the logType.
+     */
+    public String getLogType()
+    {
+        return logType;
+    }
+
+    /**
+     * @param logType
+     *            The logType to set.
+     */
+    public void setLogType(String logType)
+    {
+        this.logType = logType;
+    }
+
+    /**
+     * @return Returns the msElapsedTime.
+     */
+    public long getMsElapsedTime()
+    {
+        return msElapsedTime;
+    }
+
+    /**
+     * @param msElapsedTime
+     *            The msElapsedTime to set.
+     */
+    public void setMsElapsedTime(long msElapsedTime)
+    {
+        this.msElapsedTime = msElapsedTime;
+    }
+
+    /**
+     * @return Returns the status.
+     */
+    public int getStatus()
+    {
+        return status;
+    }
+
+    /**
+     * @param status
+     *            The status to set.
+     */
+    public void setStatus(int status)
+    {
+        this.status = status;
+    }
+
+    /**
+     * @return Returns the timeStamp.
+     */
+    public Timestamp getTimeStamp()
+    {
+        return timeStamp;
+    }
+
+    /**
+     * @param timeStamp
+     *            The timeStamp to set.
+     */
+    public void setTimeStamp(Timestamp timeStamp)
+    {
+        this.timeStamp = timeStamp;
+    }
+
+    /**
+     * @return Returns the userName.
+     */
+    public String getUserName()
+    {
+        return userName;
+    }
+
+    /**
+     * @param userName
+     *            The userName to set.
+     */
+    public void setUserName(String userName)
+    {
+        this.userName = userName;
+    }
+}

Added: portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/PageLogRecord.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/PageLogRecord.java?rev=330607&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/PageLogRecord.java
(added)
+++ portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/PageLogRecord.java
Thu Nov  3 10:57:08 2005
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2001,2004 The 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.impl;
+
+/**
+ * PageLogRecord
+ * <P>
+ * Extends the abstract class LogRecord to holds the fields of a Page Access log
+ * entry.
+ * 
+ * @author <a href="mailto:rklein@bluesunrise.com">Richard D. Klein </a>
+ * @version $Id: LogRecord.java 188420 2005-03-23 22:25:50Z rdk $
+ */
+public class PageLogRecord extends LogRecord
+{
+
+    protected String pagePath = null;
+
+    public PageLogRecord()
+    {
+        super(LogRecord.TYPE_PAGE);
+    }
+
+    /**
+     * @return Returns the pagePath.
+     */
+    public String getPagePath()
+    {
+        return pagePath;
+    }
+
+    /**
+     * @param pagePath
+     *            The pagePath to set.
+     */
+    public void setPagePath(String pagePath)
+    {
+        this.pagePath = pagePath;
+    }
+}

Added: portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/PortletLogRecord.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/PortletLogRecord.java?rev=330607&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/PortletLogRecord.java
(added)
+++ portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/PortletLogRecord.java
Thu Nov  3 10:57:08 2005
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2000-2001,2004 The 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.impl;
+
+/**
+ * PortletLogRecord
+ * <P>
+ * Extends the abstract class LogRecord to holds the fields of a Portlet Access
+ * log entry.
+ * 
+ * @author <a href="mailto:rklein@bluesunrise.com">Richard D. Klein </a>
+ * @version $Id: LogRecord.java 188420 2005-03-23 22:25:50Z rdk $
+ */
+public class PortletLogRecord extends LogRecord
+{
+
+    protected String portletName = null;
+
+    protected String pagePath = null;
+
+    public PortletLogRecord()
+    {
+        super(LogRecord.TYPE_PORTLET);
+    }
+
+    /**
+     * @return Returns the pagePath.
+     */
+    public String getPagePath()
+    {
+        return pagePath;
+    }
+
+    /**
+     * @param pagePath
+     *            The pagePath to set.
+     */
+    public void setPagePath(String pagePath)
+    {
+        this.pagePath = pagePath;
+    }
+
+    /**
+     * @return Returns the portletName.
+     */
+    public String getPortletName()
+    {
+        return portletName;
+    }
+
+    /**
+     * @param portletName
+     *            The portletName to set.
+     */
+    public void setPortletName(String portletName)
+    {
+        this.portletName = portletName;
+    }
+}

Added: portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/UserLogRecord.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/UserLogRecord.java?rev=330607&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/UserLogRecord.java
(added)
+++ portals/jetspeed-2/trunk/components/statistics/src/java/org/apache/jetspeed/statistics/impl/UserLogRecord.java
Thu Nov  3 10:57:08 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2001,2004 The 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.impl;
+
+/**
+ * UserLogRecord
+ * <P>
+ * Extends the abstract class LogRecord to holds the fields of a User Logout log
+ * entry.
+ * 
+ * @author <a href="mailto:rklein@bluesunrise.com">Richard D. Klein </a>
+ * @version $Id: LogRecord.java 188420 2005-03-23 22:25:50Z rdk $
+ */
+public class UserLogRecord extends LogRecord
+{
+
+    public UserLogRecord()
+    {
+        super(LogRecord.TYPE_USER);
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message