[teiid-commits] teiid SVN: r1310 - in trunk: server/src/main/java/com/metamatrix/common/log/reader and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Tue Sep 8 15:08:15 EDT 2009


Author: shawkins
Date: 2009-09-08 15:08:14 -0400 (Tue, 08 Sep 2009)
New Revision: 1310

Added:
   trunk/server/src/main/java/com/metamatrix/common/log/reader/LogEntry.java
   trunk/server/src/main/java/com/metamatrix/common/log/reader/LogEntryPropertyNames.java
   trunk/server/src/main/java/com/metamatrix/common/log/reader/LogReader.java
Removed:
   trunk/common-internal/src/main/java/com/metamatrix/common/log/reader/
Log:
moving the log reader code to server

Copied: trunk/server/src/main/java/com/metamatrix/common/log/reader/LogEntry.java (from rev 1303, trunk/common-internal/src/main/java/com/metamatrix/common/log/reader/LogEntry.java)
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/log/reader/LogEntry.java	                        (rev 0)
+++ trunk/server/src/main/java/com/metamatrix/common/log/reader/LogEntry.java	2009-09-08 19:08:14 UTC (rev 1310)
@@ -0,0 +1,179 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.common.log.reader;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/** 
+ * @since 4.3
+ */
+public class LogEntry implements Serializable {
+
+    
+    
+    private String exception;
+    private Date date;
+    private String message;
+    private String context;
+    private int level;
+    private String hostName;
+    private String processName;
+    private String threadName;
+
+   
+    
+    /**
+     * The name of the System property that contains the maximum number of rows
+     * that will be returned for viewing..  This is an optional property that defaults to '2500'.
+     */
+    public static final String MAX_LOG_ROWS_RETURNED = "metamatrix.log.maxRows"; //$NON-NLS-1$
+
+
+    /** 
+     * @return Returns the context.
+     * @since 4.3
+     */
+    public String getContext() {
+        return this.context;
+    }
+    
+    /** 
+     * @param context The context to set.
+     * @since 4.3
+     */
+    public void setContext(String context) {
+        this.context = context;
+    }
+
+    /** 
+     * @return Returns the date.
+     * @since 4.3
+     */
+    public Date getDate() {
+        return this.date;
+    }
+    /** 
+     * @param date The date to set.
+     * @since 4.3
+     */
+    public void setDate(Date date) {
+        this.date = date;
+    }
+
+    /** 
+     * @return Returns the exception.
+     * @since 4.3
+     */
+    public String getException() {
+        return this.exception;
+    }
+    
+    /** 
+     * @param exception The exception to set.
+     * @since 4.3
+     */
+    public void setException(String exception) {
+        this.exception = exception;
+    }
+    /** 
+     * @return Returns the hostName.
+     * @since 4.3
+     */
+    public String getHostName() {
+        return this.hostName;
+    }
+    /** 
+     * @param hostName The hostName to set.
+     * @since 4.3
+     */
+    public void setHostName(String hostName) {
+        this.hostName = hostName;
+    }
+
+    /** 
+     * @return Returns the level.
+     * @since 4.3
+     */
+    public int getLevel() {
+        return this.level;
+    }
+
+    /** 
+     * @param level The level to set.
+     * @since 4.3
+     */
+    public void setLevel(int level) {
+        this.level = level;
+    }
+
+    /** 
+     * @return Returns the message.
+     * @since 4.3
+     */
+    public String getMessage() {
+        return this.message;
+    }
+    /** 
+     * @param message The message to set.
+     * @since 4.3
+     */
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    /** 
+     * @return Returns the processName.
+     * @since 4.3
+     */
+    public String getProcessName() {
+        return this.processName;
+    }
+
+    /** 
+     * @param processName The processName to set.
+     * @since 4.3
+     */
+    public void setProcessName(String processName) {
+        this.processName = processName;
+    }
+
+    /** 
+     * @return Returns the threadName.
+     * @since 4.3
+     */
+    public String getThreadName() {
+        return this.threadName;
+    }
+
+    /** 
+     * @param threadName The threadName to set.
+     * @since 4.3
+     */
+    public void setThreadName(String threadName) {
+        this.threadName = threadName;
+    }
+    
+    
+}

Copied: trunk/server/src/main/java/com/metamatrix/common/log/reader/LogEntryPropertyNames.java (from rev 1303, trunk/common-internal/src/main/java/com/metamatrix/common/log/reader/LogEntryPropertyNames.java)
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/log/reader/LogEntryPropertyNames.java	                        (rev 0)
+++ trunk/server/src/main/java/com/metamatrix/common/log/reader/LogEntryPropertyNames.java	2009-09-08 19:08:14 UTC (rev 1310)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.common.log.reader;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+
+
+/** 
+ * @since 4.3
+ */
+public class LogEntryPropertyNames implements Serializable {
+
+   
+    /**
+     * The name of the System property that contains the maximum number of rows
+     * that will be returned for viewing..  This is an optional property that defaults to '2500'.
+     */
+    public static final String MAX_LOG_ROWS_RETURNED = "metamatrix.log.maxRows"; //$NON-NLS-1$
+
+    /**
+     * List of String database column names which store the
+     * log message attributes
+     */
+    public static List COLUMN_NAMES;
+
+    
+    static {
+        COLUMN_NAMES = new ArrayList();        
+        COLUMN_NAMES.add(ColumnName.CONTEXT);
+        COLUMN_NAMES.add(ColumnName.LEVEL);
+        COLUMN_NAMES.add(ColumnName.MESSAGE);
+        COLUMN_NAMES.add(ColumnName.EXCEPTION);
+        COLUMN_NAMES.add(ColumnName.TIMESTAMP);
+        COLUMN_NAMES.add(ColumnName.HOST);
+        COLUMN_NAMES.add(ColumnName.VM);
+        COLUMN_NAMES.add(ColumnName.THREAD);
+        COLUMN_NAMES = Collections.unmodifiableList(COLUMN_NAMES);       
+       
+    }
+
+    
+    public static final class ColumnName {
+        public static final String TIMESTAMP        = "TIMESTAMP"; //$NON-NLS-1$
+        public static final String SEQUENCE_NUMBER  = "VMSEQNUM"; //$NON-NLS-1$
+        public static final String CONTEXT          = "CONTEXT"; //$NON-NLS-1$
+        public static final String LEVEL            = "MSGLEVEL"; //$NON-NLS-1$
+        public static final String EXCEPTION        = "EXCEPTION"; //$NON-NLS-1$
+        public static final String MESSAGE          = "MESSAGE"; //$NON-NLS-1$
+        public static final String HOST             = "HOSTNAME"; //$NON-NLS-1$
+        public static final String VM               = "VMID"; //$NON-NLS-1$
+        public static final String THREAD           = "THREADNAME"; //$NON-NLS-1$
+    }
+
+    
+    
+}

Copied: trunk/server/src/main/java/com/metamatrix/common/log/reader/LogReader.java (from rev 1303, trunk/common-internal/src/main/java/com/metamatrix/common/log/reader/LogReader.java)
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/log/reader/LogReader.java	                        (rev 0)
+++ trunk/server/src/main/java/com/metamatrix/common/log/reader/LogReader.java	2009-09-08 19:08:14 UTC (rev 1310)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.common.log.reader;
+
+import java.util.Date;
+import java.util.List;
+
+import com.metamatrix.api.exception.MetaMatrixComponentException;
+
+/**
+ * Class that reads MetaMatrix log entries.
+ */
+public interface LogReader {
+
+   
+
+    /** 
+     * @see com.metamatrix.platform.admin.api.RuntimeStateAdminAPI#getLogEntries(java.util.Date, java.util.Date, java.util.List, java.util.List, int)
+     * @since 4.3
+     */
+    List getLogEntries(Date startTime,
+                       Date endTime,
+                       List levels,
+                       List contexts,
+                       int maxRows) throws MetaMatrixComponentException;
+   
+      
+}
+



More information about the teiid-commits mailing list