[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.28-33-g56fe8a8
added by portage for gitosis-gentoo
git-noreply at pixie.qos.ch
Mon Mar 28 22:00:07 CEST 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".
The branch, master has been updated
via 56fe8a84fb7a07a0f842318409d61285ebcc4ff9 (commit)
via e6014e4306c6a0f4732e8aefd071f8fbfb7437c2 (commit)
via 146b2027091f6f34b9fe22a5f3548046756e08ec (commit)
from 291d3efbed616b1c62b2ba465cf727fc99ddda70 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=56fe8a84fb7a07a0f842318409d61285ebcc4ff9
http://github.com/ceki/logback/commit/56fe8a84fb7a07a0f842318409d61285ebcc4ff9
commit 56fe8a84fb7a07a0f842318409d61285ebcc4ff9
Author: Joern Huxhorn <jhuxhorn at googlemail.com>
Date: Mon Mar 28 16:22:27 2011 +0200
Using IAccessEvent instead of AccessEvent if possible.
diff --git a/logback-access/src/main/java/ch/qos/logback/access/PatternLayout.java b/logback-access/src/main/java/ch/qos/logback/access/PatternLayout.java
index d702bd5..e86223a 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/PatternLayout.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/PatternLayout.java
@@ -41,14 +41,14 @@ import ch.qos.logback.access.pattern.ResponseContentConverter;
import ch.qos.logback.access.pattern.ResponseHeaderConverter;
import ch.qos.logback.access.pattern.ServerNameConverter;
import ch.qos.logback.access.pattern.StatusCodeConverter;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.pattern.PatternLayoutBase;
import ch.qos.logback.core.pattern.parser.Parser;
/**
* <p>
* This class is a module-specific implementation of
- * {@link ch.qos.logback.classic.PatternLayout} to allow http-specific patterns
+ * {@link ch.qos.logback.access.PatternLayout} to allow http-specific patterns
* to be used. The <code>ch.qos.logback.access.PatternLayout</code> provides a
* way to format the logging output that is just as easy and flexible as the
* usual <code>PatternLayout</code>.
@@ -60,7 +60,7 @@ import ch.qos.logback.core.pattern.parser.Parser;
* @author Ceki Gülcü
* @author Sébastien Pennec
*/
-public class PatternLayout extends PatternLayoutBase<AccessEvent> {
+public class PatternLayout extends PatternLayoutBase<IAccessEvent> {
public static final Map<String, String> defaultConverterMap = new HashMap<String, String>();
@@ -167,7 +167,7 @@ public class PatternLayout extends PatternLayoutBase<AccessEvent> {
return defaultConverterMap;
}
- public String doLayout(AccessEvent event) {
+ public String doLayout(IAccessEvent event) {
if (!isStarted()) {
return null;
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/PatternLayoutEncoder.java b/logback-access/src/main/java/ch/qos/logback/access/PatternLayoutEncoder.java
index aa3b6f2..f418bfe 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/PatternLayoutEncoder.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/PatternLayoutEncoder.java
@@ -1,10 +1,10 @@
package ch.qos.logback.access;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.pattern.PatternLayoutEncoderBase;
-public class PatternLayoutEncoder extends PatternLayoutEncoderBase<AccessEvent> {
+public class PatternLayoutEncoder extends PatternLayoutEncoderBase<IAccessEvent> {
@Override
public void start() {
@@ -16,4 +16,4 @@ public class PatternLayoutEncoder extends PatternLayoutEncoderBase<AccessEvent>
super.start();
}
-}
\ No newline at end of file
+}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/boolex/JaninoEventEvaluator.java b/logback-access/src/main/java/ch/qos/logback/access/boolex/JaninoEventEvaluator.java
index 7702755..4149b8b 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/boolex/JaninoEventEvaluator.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/boolex/JaninoEventEvaluator.java
@@ -16,19 +16,19 @@ package ch.qos.logback.access.boolex;
import java.util.ArrayList;
import java.util.List;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.CoreConstants;
import ch.qos.logback.core.boolex.JaninoEventEvaluatorBase;
import ch.qos.logback.core.boolex.Matcher;
-public class JaninoEventEvaluator extends JaninoEventEvaluatorBase<AccessEvent> {
+public class JaninoEventEvaluator extends JaninoEventEvaluatorBase<IAccessEvent> {
public final static List<String> DEFAULT_PARAM_NAME_LIST = new ArrayList<String>();
public final static List<Class> DEFAULT_PARAM_TYPE_LIST = new ArrayList<Class>();
static {
DEFAULT_PARAM_NAME_LIST.add("event");
- DEFAULT_PARAM_TYPE_LIST.add(AccessEvent.class);
+ DEFAULT_PARAM_TYPE_LIST.add(IAccessEvent.class);
}
@@ -67,8 +67,7 @@ public class JaninoEventEvaluator extends JaninoEventEvaluatorBase<AccessEvent>
return (Class[]) fullTypeList.toArray(CoreConstants.EMPTY_CLASS_ARRAY);
}
- protected Object[] getParameterValues(AccessEvent event) {
- AccessEvent accessEvent = (AccessEvent) event;
+ protected Object[] getParameterValues(IAccessEvent accessEvent) {
final int matcherListSize = matcherList.size();
int i = 0;
@@ -77,7 +76,7 @@ public class JaninoEventEvaluator extends JaninoEventEvaluatorBase<AccessEvent>
values[i++] = accessEvent;
for (int j = 0; j < matcherListSize; j++) {
- values[i++] = (Matcher) matcherList.get(j);
+ values[i++] = matcherList.get(j);
}
return values;
diff --git a/logback-access/src/main/java/ch/qos/logback/access/db/DBAppender.java b/logback-access/src/main/java/ch/qos/logback/access/db/DBAppender.java
index e8b1057..e3f071d 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/db/DBAppender.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/db/DBAppender.java
@@ -19,7 +19,7 @@ import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Enumeration;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.db.DBAppenderBase;
/**
@@ -33,7 +33,7 @@ import ch.qos.logback.core.db.DBAppenderBase;
* @author Ray DeCampo
* @author Sébastien Pennec
*/
-public class DBAppender extends DBAppenderBase<AccessEvent> {
+public class DBAppender extends DBAppenderBase<IAccessEvent> {
protected static final String insertSQL;
protected final String insertHeaderSQL = "INSERT INTO access_event_header (event_id, header_key, header_value) VALUES (?, ?, ?)";
protected static final Method GET_GENERATED_KEYS_METHOD;
@@ -70,7 +70,7 @@ public class DBAppender extends DBAppenderBase<AccessEvent> {
}
@Override
- protected void subAppend(AccessEvent event, Connection connection,
+ protected void subAppend(IAccessEvent event, Connection connection,
PreparedStatement insertStatement) throws Throwable {
addAccessEvent(insertStatement, event);
@@ -81,14 +81,14 @@ public class DBAppender extends DBAppenderBase<AccessEvent> {
}
}
- protected void secondarySubAppend(AccessEvent event, Connection connection,
+ protected void secondarySubAppend(IAccessEvent event, Connection connection,
long eventId) throws Throwable {
if (insertHeaders) {
addRequestHeaders(event, connection, eventId);
}
}
- void addAccessEvent(PreparedStatement stmt, AccessEvent event)
+ void addAccessEvent(PreparedStatement stmt, IAccessEvent event)
throws SQLException {
stmt.setLong(1, event.getTimeStamp());
stmt.setString(2, event.getRequestURI());
@@ -102,7 +102,7 @@ public class DBAppender extends DBAppenderBase<AccessEvent> {
stmt.setString(10, event.getRequestContent());
}
- void addRequestHeaders(AccessEvent event,
+ void addRequestHeaders(IAccessEvent event,
Connection connection, long eventId) throws SQLException {
Enumeration names = event.getRequestHeaderNames();
if (names.hasMoreElements()) {
diff --git a/logback-access/src/main/java/ch/qos/logback/access/html/HTMLLayout.java b/logback-access/src/main/java/ch/qos/logback/access/html/HTMLLayout.java
index 51b6fa4..5d8e612 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/html/HTMLLayout.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/html/HTMLLayout.java
@@ -18,7 +18,7 @@ import static ch.qos.logback.core.CoreConstants.LINE_SEPARATOR;
import java.util.Map;
import ch.qos.logback.access.PatternLayout;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.html.HTMLLayoutBase;
import ch.qos.logback.core.pattern.Converter;
@@ -37,7 +37,7 @@ import ch.qos.logback.core.pattern.Converter;
* @author Ceki Gülcü
* @author Sébastien Pennec
*/
-public class HTMLLayout extends HTMLLayoutBase<AccessEvent> {
+public class HTMLLayout extends HTMLLayoutBase<IAccessEvent> {
/**
* Default pattern string for log output.
@@ -58,7 +58,7 @@ public class HTMLLayout extends HTMLLayoutBase<AccessEvent> {
return PatternLayout.defaultConverterMap;
}
- public String doLayout(AccessEvent event) {
+ public String doLayout(IAccessEvent event) {
StringBuilder buf = new StringBuilder();
startNewTableIfLimitReached(buf);
@@ -76,7 +76,7 @@ public class HTMLLayout extends HTMLLayoutBase<AccessEvent> {
}
buf.append(LINE_SEPARATOR);
- Converter<AccessEvent> c = head;
+ Converter<IAccessEvent> c = head;
while (c != null) {
appendEventToBuffer(buf, c, event);
c = c.getNext();
@@ -87,8 +87,8 @@ public class HTMLLayout extends HTMLLayoutBase<AccessEvent> {
return buf.toString();
}
- private void appendEventToBuffer(StringBuilder buf, Converter<AccessEvent> c,
- AccessEvent event) {
+ private void appendEventToBuffer(StringBuilder buf, Converter<IAccessEvent> c,
+ IAccessEvent event) {
buf.append("<td class=\"");
buf.append(computeConverterName(c));
buf.append("\">");
diff --git a/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java b/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java
index d4a624a..a3f417e 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java
@@ -24,6 +24,7 @@ import org.mortbay.jetty.Response;
import ch.qos.logback.access.joran.JoranConfigurator;
import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.ContextBase;
import ch.qos.logback.core.CoreConstants;
@@ -108,13 +109,13 @@ import ch.qos.logback.core.util.OptionHelper;
* @author Sébastien Pennec
*/
public class RequestLogImpl extends ContextBase implements RequestLog,
- AppenderAttachable<AccessEvent>, FilterAttachable<AccessEvent> {
+ AppenderAttachable<IAccessEvent>, FilterAttachable<IAccessEvent> {
public final static String DEFAULT_CONFIG_FILE = "etc" + File.separatorChar
+ "logback-access.xml";
- AppenderAttachableImpl<AccessEvent> aai = new AppenderAttachableImpl<AccessEvent>();
- FilterAttachableImpl<AccessEvent> fai = new FilterAttachableImpl<AccessEvent>();
+ AppenderAttachableImpl<IAccessEvent> aai = new AppenderAttachableImpl<IAccessEvent>();
+ FilterAttachableImpl<IAccessEvent> fai = new FilterAttachableImpl<IAccessEvent>();
String filename;
boolean started = false;
@@ -125,7 +126,7 @@ public class RequestLogImpl extends ContextBase implements RequestLog,
public void log(Request jettyRequest, Response jettyResponse) {
JettyServerAdapter adapter = new JettyServerAdapter(jettyRequest,
jettyResponse);
- AccessEvent accessEvent = new AccessEvent(jettyRequest, jettyResponse,
+ IAccessEvent accessEvent = new AccessEvent(jettyRequest, jettyResponse,
adapter);
if (getFilterChainDecision(accessEvent) == FilterReply.DENY) {
return;
@@ -203,19 +204,19 @@ public class RequestLogImpl extends ContextBase implements RequestLog,
return false;
}
- public void addAppender(Appender<AccessEvent> newAppender) {
+ public void addAppender(Appender<IAccessEvent> newAppender) {
aai.addAppender(newAppender);
}
- public Iterator<Appender<AccessEvent>> iteratorForAppenders() {
+ public Iterator<Appender<IAccessEvent>> iteratorForAppenders() {
return aai.iteratorForAppenders();
}
- public Appender<AccessEvent> getAppender(String name) {
+ public Appender<IAccessEvent> getAppender(String name) {
return aai.getAppender(name);
}
- public boolean isAttached(Appender<AccessEvent> appender) {
+ public boolean isAttached(Appender<IAccessEvent> appender) {
return aai.isAttached(appender);
}
@@ -224,7 +225,7 @@ public class RequestLogImpl extends ContextBase implements RequestLog,
}
- public boolean detachAppender(Appender<AccessEvent> appender) {
+ public boolean detachAppender(Appender<IAccessEvent> appender) {
return aai.detachAppender(appender);
}
@@ -232,7 +233,7 @@ public class RequestLogImpl extends ContextBase implements RequestLog,
return aai.detachAppender(name);
}
- public void addFilter(Filter<AccessEvent> newFilter) {
+ public void addFilter(Filter<IAccessEvent> newFilter) {
fai.addFilter(newFilter);
}
@@ -240,11 +241,11 @@ public class RequestLogImpl extends ContextBase implements RequestLog,
fai.clearAllFilters();
}
- public List<Filter<AccessEvent>> getCopyOfAttachedFiltersList() {
+ public List<Filter<IAccessEvent>> getCopyOfAttachedFiltersList() {
return fai.getCopyOfAttachedFiltersList();
}
- public FilterReply getFilterChainDecision(AccessEvent event) {
+ public FilterReply getFilterChainDecision(IAccessEvent event) {
return fai.getFilterChainDecision(event);
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/jetty/v7/RequestLogImpl.java b/logback-access/src/main/java/ch/qos/logback/access/jetty/v7/RequestLogImpl.java
index 95742fa..4738049 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/jetty/v7/RequestLogImpl.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/jetty/v7/RequestLogImpl.java
@@ -15,6 +15,7 @@ package ch.qos.logback.access.jetty.v7;
import ch.qos.logback.access.joran.JoranConfigurator;
import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.ContextBase;
import ch.qos.logback.core.CoreConstants;
@@ -107,12 +108,12 @@ import java.util.List;
* @author Sébastien Pennec
*/
public class RequestLogImpl extends ContextBase implements RequestLog,
- AppenderAttachable<AccessEvent>, FilterAttachable<AccessEvent> {
+ AppenderAttachable<IAccessEvent>, FilterAttachable<IAccessEvent> {
public final static String DEFAULT_CONFIG_FILE = "etc" + File.separatorChar + "logback-access.xml";
- AppenderAttachableImpl<AccessEvent> aai = new AppenderAttachableImpl<AccessEvent>();
- FilterAttachableImpl<AccessEvent> fai = new FilterAttachableImpl<AccessEvent>();
+ AppenderAttachableImpl<IAccessEvent> aai = new AppenderAttachableImpl<IAccessEvent>();
+ FilterAttachableImpl<IAccessEvent> fai = new FilterAttachableImpl<IAccessEvent>();
String filename;
boolean started = false;
@@ -122,7 +123,7 @@ public class RequestLogImpl extends ContextBase implements RequestLog,
public void log(Request jettyRequest, Response jettyResponse) {
JettyServerAdapter adapter = new JettyServerAdapter(jettyRequest, jettyResponse);
- AccessEvent accessEvent = new AccessEvent(jettyRequest, jettyResponse, adapter);
+ IAccessEvent accessEvent = new AccessEvent(jettyRequest, jettyResponse, adapter);
if (getFilterChainDecision(accessEvent) == FilterReply.DENY) {
return;
}
@@ -205,19 +206,19 @@ public class RequestLogImpl extends ContextBase implements RequestLog,
//no support for listeners yet
}
- public void addAppender(Appender<AccessEvent> newAppender) {
+ public void addAppender(Appender<IAccessEvent> newAppender) {
aai.addAppender(newAppender);
}
- public Iterator<Appender<AccessEvent>> iteratorForAppenders() {
+ public Iterator<Appender<IAccessEvent>> iteratorForAppenders() {
return aai.iteratorForAppenders();
}
- public Appender<AccessEvent> getAppender(String name) {
+ public Appender<IAccessEvent> getAppender(String name) {
return aai.getAppender(name);
}
- public boolean isAttached(Appender<AccessEvent> appender) {
+ public boolean isAttached(Appender<IAccessEvent> appender) {
return aai.isAttached(appender);
}
@@ -226,7 +227,7 @@ public class RequestLogImpl extends ContextBase implements RequestLog,
}
- public boolean detachAppender(Appender<AccessEvent> appender) {
+ public boolean detachAppender(Appender<IAccessEvent> appender) {
return aai.detachAppender(appender);
}
@@ -234,7 +235,7 @@ public class RequestLogImpl extends ContextBase implements RequestLog,
return aai.detachAppender(name);
}
- public void addFilter(Filter<AccessEvent> newFilter) {
+ public void addFilter(Filter<IAccessEvent> newFilter) {
fai.addFilter(newFilter);
}
@@ -242,11 +243,11 @@ public class RequestLogImpl extends ContextBase implements RequestLog,
fai.clearAllFilters();
}
- public List<Filter<AccessEvent>> getCopyOfAttachedFiltersList() {
+ public List<Filter<IAccessEvent>> getCopyOfAttachedFiltersList() {
return fai.getCopyOfAttachedFiltersList();
}
- public FilterReply getFilterChainDecision(AccessEvent event) {
+ public FilterReply getFilterChainDecision(IAccessEvent event) {
return fai.getFilterChainDecision(event);
}
-}
\ No newline at end of file
+}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/net/AccessEventPreSerializationTransformer.java b/logback-access/src/main/java/ch/qos/logback/access/net/AccessEventPreSerializationTransformer.java
index 5678671..a41eab9 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/net/AccessEventPreSerializationTransformer.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/net/AccessEventPreSerializationTransformer.java
@@ -16,13 +16,18 @@ package ch.qos.logback.access.net;
import java.io.Serializable;
import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.spi.PreSerializationTransformer;
public class AccessEventPreSerializationTransformer implements
- PreSerializationTransformer<AccessEvent> {
+ PreSerializationTransformer<IAccessEvent> {
- public Serializable transform(AccessEvent event) {
- return event;
+ public Serializable transform(IAccessEvent event) {
+ if (event instanceof AccessEvent) {
+ return (AccessEvent)event;
+ } else {
+ throw new IllegalArgumentException("Unsupported type "+event.getClass().getName());
+ }
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/net/SMTPAppender.java b/logback-access/src/main/java/ch/qos/logback/access/net/SMTPAppender.java
index 7b1d60c..6fcfe43 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/net/SMTPAppender.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/net/SMTPAppender.java
@@ -14,7 +14,7 @@
package ch.qos.logback.access.net;
import ch.qos.logback.access.PatternLayout;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.Layout;
import ch.qos.logback.core.boolex.EventEvaluator;
import ch.qos.logback.core.helpers.CyclicBuffer;
@@ -31,7 +31,7 @@ import ch.qos.logback.core.net.SMTPAppenderBase;
* @author Sébastien Pennec
*
*/
-public class SMTPAppender extends SMTPAppenderBase<AccessEvent> {
+public class SMTPAppender extends SMTPAppenderBase<IAccessEvent> {
static final String DEFAULT_SUBJECT_PATTERN = "%m";
@@ -47,7 +47,7 @@ public class SMTPAppender extends SMTPAppenderBase<AccessEvent> {
* Use <code>evaluator</code> passed as parameter as the {@link
* EventEvaluator} for this SMTPAppender.
*/
- public SMTPAppender(EventEvaluator<AccessEvent> evaluator) {
+ public SMTPAppender(EventEvaluator<IAccessEvent> evaluator) {
this.eventEvaluator = evaluator;
}
@@ -55,22 +55,22 @@ public class SMTPAppender extends SMTPAppenderBase<AccessEvent> {
* Perform SMTPAppender specific appending actions, mainly adding the event to
* the appropriate cyclic buffer.
*/
- protected void subAppend(CyclicBuffer<AccessEvent> cb, AccessEvent event) {
+ protected void subAppend(CyclicBuffer<IAccessEvent> cb, IAccessEvent event) {
cb.add(event);
}
@Override
- protected void fillBuffer(CyclicBuffer<AccessEvent> cb, StringBuffer sbuf) {
+ protected void fillBuffer(CyclicBuffer<IAccessEvent> cb, StringBuffer sbuf) {
int len = cb.length();
for (int i = 0; i < len; i++) {
// sbuf.append(MimeUtility.encodeText(layout.format(cb.getOrCreate())));
- AccessEvent event = (AccessEvent) cb.get();
+ IAccessEvent event = cb.get();
sbuf.append(layout.doLayout(event));
}
}
@Override
- protected Layout<AccessEvent> makeSubjectLayout(String subjectStr) {
+ protected Layout<IAccessEvent> makeSubjectLayout(String subjectStr) {
if(subjectStr == null) {
subjectStr = DEFAULT_SUBJECT_PATTERN;
}
@@ -80,13 +80,13 @@ public class SMTPAppender extends SMTPAppenderBase<AccessEvent> {
return pl;
}
- protected PatternLayout makeNewToPatternLayout(String toPattern) {
+ protected PatternLayout makeNewToPatternLayout(String toPattern) {
PatternLayout pl = new PatternLayout();
pl.setPattern(toPattern);
return pl;
}
- protected boolean isEventMarkedForBufferRemoval(AccessEvent eventObject) {
+ protected boolean isEventMarkedForBufferRemoval(IAccessEvent eventObject) {
return false;
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/net/SocketAppender.java b/logback-access/src/main/java/ch/qos/logback/access/net/SocketAppender.java
index 4f567a6..4c82da7 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/net/SocketAppender.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/net/SocketAppender.java
@@ -16,12 +16,12 @@ package ch.qos.logback.access.net;
import java.net.InetAddress;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.net.SocketAppenderBase;
import ch.qos.logback.core.spi.PreSerializationTransformer;
/**
- * Sends {@link AccessEvent} objects to a remote a log server, usually a
+ * Sends {@link IAccessEvent} objects to a remote a log server, usually a
* {@link SocketNode}.
*
* For more information about this appender, please refer to the online manual at
@@ -32,9 +32,9 @@ import ch.qos.logback.core.spi.PreSerializationTransformer;
*
*/
-public class SocketAppender extends SocketAppenderBase<AccessEvent> {
+public class SocketAppender extends SocketAppenderBase<IAccessEvent> {
- PreSerializationTransformer<AccessEvent> pst = new AccessEventPreSerializationTransformer();
+ PreSerializationTransformer<IAccessEvent> pst = new AccessEventPreSerializationTransformer();
public SocketAppender() {
}
@@ -58,12 +58,11 @@ public class SocketAppender extends SocketAppenderBase<AccessEvent> {
}
@Override
- protected void postProcessEvent(AccessEvent event) {
- AccessEvent ae = (AccessEvent)event;
- ae.prepareForDeferredProcessing();
+ protected void postProcessEvent(IAccessEvent event) {
+ event.prepareForDeferredProcessing();
}
- public PreSerializationTransformer<AccessEvent> getPST() {
+ public PreSerializationTransformer<IAccessEvent> getPST() {
return pst;
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/net/SocketNode.java b/logback-access/src/main/java/ch/qos/logback/access/net/SocketNode.java
index a2f2ce4..cc955a2 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/net/SocketNode.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/net/SocketNode.java
@@ -19,13 +19,13 @@ import java.io.ObjectInputStream;
import java.net.Socket;
import ch.qos.logback.access.spi.AccessContext;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.spi.FilterReply;
// Contributors: Moses Hohman <mmhohman at rainbow.uchicago.edu>
/**
- * Read {@link AccessEvent} objects sent from a remote client using Sockets
+ * Read {@link IAccessEvent} objects sent from a remote client using Sockets
* (TCP). These logging events are logged according to local policy, as if they
* were generated locally.
*
@@ -56,12 +56,12 @@ public class SocketNode implements Runnable {
}
public void run() {
- AccessEvent event;
+ IAccessEvent event;
try {
while (true) {
// read an event from the wire
- event = (AccessEvent) ois.readObject();
+ event = (IAccessEvent) ois.readObject();
//check that the event should be logged
if (context.getFilterChainDecision(event) == FilterReply.DENY) {
break;
diff --git a/logback-access/src/main/java/ch/qos/logback/access/net/URLEvaluator.java b/logback-access/src/main/java/ch/qos/logback/access/net/URLEvaluator.java
index b20133b..c68891b 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/net/URLEvaluator.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/net/URLEvaluator.java
@@ -16,7 +16,7 @@ package ch.qos.logback.access.net;
import java.util.ArrayList;
import java.util.List;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.boolex.EvaluationException;
import ch.qos.logback.core.boolex.EventEvaluator;
import ch.qos.logback.core.spi.ContextAwareBase;
@@ -44,7 +44,7 @@ public class URLEvaluator extends ContextAwareBase implements EventEvaluator, Li
}
public boolean evaluate(Object eventObject) throws NullPointerException, EvaluationException {
- AccessEvent event = (AccessEvent)eventObject;
+ IAccessEvent event = (IAccessEvent)eventObject;
String url = event.getRequestURL();
for(String expected:URLList) {
if (url.contains(expected)) {
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/AccessConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/AccessConverter.java
index 341562b..8df5f70 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/AccessConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/AccessConverter.java
@@ -13,7 +13,7 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.Context;
import ch.qos.logback.core.pattern.DynamicConverter;
import ch.qos.logback.core.spi.ContextAware;
@@ -21,7 +21,7 @@ import ch.qos.logback.core.spi.ContextAwareBase;
import ch.qos.logback.core.status.Status;
-abstract public class AccessConverter extends DynamicConverter<AccessEvent> implements ContextAware {
+abstract public class AccessConverter extends DynamicConverter<IAccessEvent> implements ContextAware {
public final static char SPACE_CHAR = ' ';
public final static char QUESTION_CHAR = '?';
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/ContentLengthConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/ContentLengthConverter.java
index c88298c..15a03e8 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/ContentLengthConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/ContentLengthConverter.java
@@ -13,14 +13,14 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
public class ContentLengthConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
long len = accessEvent.getContentLength();
- if(len == AccessEvent.SENTINEL) {
- return AccessEvent.NA;
+ if(len == IAccessEvent.SENTINEL) {
+ return IAccessEvent.NA;
} else {
return Long.toString(len);
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/DateConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/DateConverter.java
index 23299bd..10de74a 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/DateConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/DateConverter.java
@@ -18,7 +18,7 @@ import java.util.Date;
import java.util.List;
import java.util.TimeZone;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.CoreConstants;
@@ -60,7 +60,7 @@ public class DateConverter extends AccessConverter {
}
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
long timestamp = accessEvent.getTimeStamp();
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/EnsureLineSeparation.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/EnsureLineSeparation.java
index abc7f99..01ea29d 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/EnsureLineSeparation.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/EnsureLineSeparation.java
@@ -13,20 +13,20 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.pattern.Converter;
import ch.qos.logback.core.pattern.ConverterUtil;
import ch.qos.logback.core.pattern.PostCompileProcessor;
-public class EnsureLineSeparation implements PostCompileProcessor<AccessEvent> {
+public class EnsureLineSeparation implements PostCompileProcessor<IAccessEvent> {
/**
* Add a line separator converter so that access event appears on a separate
* line.
*/
- public void process(Converter<AccessEvent> head) {
- Converter<AccessEvent> tail = ConverterUtil.findTail(head);
- Converter<AccessEvent> newLineConverter = new LineSeparatorConverter();
+ public void process(Converter<IAccessEvent> head) {
+ Converter<IAccessEvent> tail = ConverterUtil.findTail(head);
+ Converter<IAccessEvent> newLineConverter = new LineSeparatorConverter();
if (tail == null) {
head = newLineConverter;
} else {
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/FullRequestConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/FullRequestConverter.java
index 9ece66b..afd70d4 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/FullRequestConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/FullRequestConverter.java
@@ -15,7 +15,7 @@ package ch.qos.logback.access.pattern;
import java.util.Enumeration;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.CoreConstants;
/**
@@ -30,7 +30,7 @@ import ch.qos.logback.core.CoreConstants;
public class FullRequestConverter extends AccessConverter {
@Override
- public String convert(AccessEvent ae) {
+ public String convert(IAccessEvent ae) {
StringBuffer buf = new StringBuffer();
buf.append(ae.getRequestURL());
buf.append(CoreConstants.LINE_SEPARATOR);
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/FullResponseConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/FullResponseConverter.java
index de9e25e..335dffb 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/FullResponseConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/FullResponseConverter.java
@@ -15,13 +15,13 @@ package ch.qos.logback.access.pattern;
import java.util.List;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.CoreConstants;
public class FullResponseConverter extends AccessConverter {
@Override
- public String convert(AccessEvent ae) {
+ public String convert(IAccessEvent ae) {
StringBuffer buf = new StringBuffer();
buf.append("HTTP/1.1 ");
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/LineSeparatorConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/LineSeparatorConverter.java
index 11f8d46..4476187 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/LineSeparatorConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/LineSeparatorConverter.java
@@ -13,13 +13,13 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.CoreConstants;
public class LineSeparatorConverter extends AccessConverter {
- public String convert(AccessEvent event) {
+ public String convert(IAccessEvent event) {
return CoreConstants.LINE_SEPARATOR;
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/LocalIPAddressConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/LocalIPAddressConverter.java
index 38087aa..bfdd592 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/LocalIPAddressConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/LocalIPAddressConverter.java
@@ -16,7 +16,7 @@ package ch.qos.logback.access.pattern;
import java.net.InetAddress;
import java.net.UnknownHostException;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
public class LocalIPAddressConverter extends AccessConverter {
@@ -30,7 +30,7 @@ public class LocalIPAddressConverter extends AccessConverter {
}
}
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return localIPAddressStr;
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/LocalPortConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/LocalPortConverter.java
index 8824253..8e5dda2 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/LocalPortConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/LocalPortConverter.java
@@ -13,12 +13,12 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
public class LocalPortConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return Integer.toString(accessEvent.getLocalPort());
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/NAConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/NAConverter.java
index 1a12716..e234c90 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/NAConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/NAConverter.java
@@ -13,7 +13,7 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
/**
* Always returns the NA (not available) string which is "-" in the case
@@ -23,8 +23,8 @@ import ch.qos.logback.access.spi.AccessEvent;
*/
public class NAConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
- return AccessEvent.NA;
+ public String convert(IAccessEvent accessEvent) {
+ return IAccessEvent.NA;
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteHostConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteHostConverter.java
index 368a267..fae7c82 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteHostConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteHostConverter.java
@@ -13,12 +13,12 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
public class RemoteHostConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return accessEvent.getRemoteHost();
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteIPAddressConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteIPAddressConverter.java
index caf09db..623bb61 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteIPAddressConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteIPAddressConverter.java
@@ -13,11 +13,11 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
public class RemoteIPAddressConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return accessEvent.getRemoteAddr();
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteUserConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteUserConverter.java
index c414e26..d7905ae 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteUserConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RemoteUserConverter.java
@@ -13,16 +13,16 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
public class RemoteUserConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
String user = accessEvent.getRemoteUser();
if(user == null) {
- return AccessEvent.NA;
+ return IAccessEvent.NA;
} else {
return user;
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestAttributeConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestAttributeConverter.java
index 253e476..c77809e 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestAttributeConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestAttributeConverter.java
@@ -13,7 +13,7 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.util.OptionHelper;
@@ -30,7 +30,7 @@ public class RequestAttributeConverter extends AccessConverter {
}
}
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
if (!isStarted()) {
return "INACTIVE_REQUEST_ATTRIB_CONV";
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestContentConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestContentConverter.java
index 0cecce1..1a09de8 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestContentConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestContentConverter.java
@@ -13,7 +13,7 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
/**
* This class is tied to the <code>requestContent</code> conversion word.
@@ -27,7 +27,7 @@ import ch.qos.logback.access.spi.AccessEvent;
public class RequestContentConverter extends AccessConverter {
@Override
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return accessEvent.getRequestContent();
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestCookieConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestCookieConverter.java
index 18f2fd8..23a5e47 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestCookieConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestCookieConverter.java
@@ -13,7 +13,7 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.util.OptionHelper;
@@ -30,7 +30,7 @@ public class RequestCookieConverter extends AccessConverter {
}
}
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
if (!isStarted()) {
return "INACTIVE_COOKIE_CONVERTER";
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestHeaderConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestHeaderConverter.java
index 222b808..dff6bd8 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestHeaderConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestHeaderConverter.java
@@ -13,7 +13,7 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.util.OptionHelper;
@@ -30,7 +30,7 @@ public class RequestHeaderConverter extends AccessConverter {
super.start();
}
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
if(!isStarted()) {
return "INACTIVE_HEADER_CONV";
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestMethodConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestMethodConverter.java
index dfd7728..581e800 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestMethodConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestMethodConverter.java
@@ -13,12 +13,12 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
public class RequestMethodConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return accessEvent.getMethod();
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestParameterConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestParameterConverter.java
index dee1d01..7124246 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestParameterConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestParameterConverter.java
@@ -15,7 +15,7 @@ package ch.qos.logback.access.pattern;
import java.util.Arrays;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.util.OptionHelper;
public class RequestParameterConverter extends AccessConverter {
@@ -31,7 +31,7 @@ public class RequestParameterConverter extends AccessConverter {
}
}
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
if (!isStarted()) {
return "INACTIVE_REQUEST_PARAM_CONV";
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestProtocolConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestProtocolConverter.java
index 06c03fb..38d3df0 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestProtocolConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestProtocolConverter.java
@@ -13,12 +13,12 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
public class RequestProtocolConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return accessEvent.getProtocol();
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURIConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURIConverter.java
index 2216f42..a66fd18 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURIConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURIConverter.java
@@ -13,7 +13,7 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
/**
* The request URI.
@@ -22,7 +22,7 @@ import ch.qos.logback.access.spi.AccessEvent;
*/
public class RequestURIConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return accessEvent.getRequestURI();
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURLConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURLConverter.java
index 5b035b7..473326e 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURLConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestURLConverter.java
@@ -13,7 +13,7 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
/**
* The first line of the request.
@@ -22,7 +22,7 @@ import ch.qos.logback.access.spi.AccessEvent;
*/
public class RequestURLConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return accessEvent.getRequestURL();
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/ResponseContentConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/ResponseContentConverter.java
index 9e0d6e7..14dc7b0 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/ResponseContentConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/ResponseContentConverter.java
@@ -13,7 +13,7 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
/**
* This class is tied to the <code>requestContent</code> conversion word.
@@ -27,7 +27,7 @@ import ch.qos.logback.access.spi.AccessEvent;
public class ResponseContentConverter extends AccessConverter {
@Override
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return accessEvent.getResponseContent();
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/ResponseHeaderConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/ResponseHeaderConverter.java
index 5ebd369..5019c92 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/ResponseHeaderConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/ResponseHeaderConverter.java
@@ -13,7 +13,7 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.util.OptionHelper;
@@ -30,7 +30,7 @@ public class ResponseHeaderConverter extends AccessConverter {
}
}
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
if(!isStarted()) {
return "INACTIVE_REPONSE_HEADER_CONV";
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/ServerNameConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/ServerNameConverter.java
index 33e1d2c..da7da5f 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/ServerNameConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/ServerNameConverter.java
@@ -13,11 +13,11 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
public class ServerNameConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return accessEvent.getServerName();
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/pattern/StatusCodeConverter.java b/logback-access/src/main/java/ch/qos/logback/access/pattern/StatusCodeConverter.java
index 5278002..8b7ecf0 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/pattern/StatusCodeConverter.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/pattern/StatusCodeConverter.java
@@ -13,11 +13,11 @@
*/
package ch.qos.logback.access.pattern;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
public class StatusCodeConverter extends AccessConverter {
- public String convert(AccessEvent accessEvent) {
+ public String convert(IAccessEvent accessEvent) {
return Integer.toString(accessEvent.getStatusCode());
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/sift/AccessEventDiscriminator.java b/logback-access/src/main/java/ch/qos/logback/access/sift/AccessEventDiscriminator.java
index 6108472..120dab6 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/sift/AccessEventDiscriminator.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/sift/AccessEventDiscriminator.java
@@ -16,14 +16,14 @@ package ch.qos.logback.access.sift;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.sift.Discriminator;
import ch.qos.logback.core.spi.ContextAwareBase;
/**
*
* AccessEventDiscriminator's job is to return the value of a designated field
- * in an {@link AccessEvent} instance.
+ * in an {@link IAccessEvent} instance.
*
* <p>The field is specified via the {@link FieldName} property.
*
@@ -31,7 +31,7 @@ import ch.qos.logback.core.spi.ContextAwareBase;
*
*/
public class AccessEventDiscriminator extends ContextAwareBase implements
- Discriminator<AccessEvent> {
+ Discriminator<IAccessEvent> {
boolean started = false;
@@ -53,7 +53,7 @@ public class AccessEventDiscriminator extends ContextAwareBase implements
FieldName fieldName;
String additionalKey;
- public String getDiscriminatingValue(AccessEvent acccessEvent) {
+ public String getDiscriminatingValue(IAccessEvent acccessEvent) {
String rawValue = getRawDiscriminatingValue(acccessEvent);
if (rawValue == null || rawValue.length() == 0) {
return defaultValue;
@@ -62,7 +62,7 @@ public class AccessEventDiscriminator extends ContextAwareBase implements
}
}
- public String getRawDiscriminatingValue(AccessEvent acccessEvent) {
+ public String getRawDiscriminatingValue(IAccessEvent acccessEvent) {
switch (fieldName) {
case COOKIE:
// tested
@@ -84,16 +84,16 @@ public class AccessEventDiscriminator extends ContextAwareBase implements
}
}
- private String getRequestAttribute(AccessEvent acccessEvent) {
+ private String getRequestAttribute(IAccessEvent acccessEvent) {
String attr = acccessEvent.getAttribute(additionalKey);
- if (AccessEvent.NA.equals(attr)) {
+ if (IAccessEvent.NA.equals(attr)) {
return null;
} else {
return attr;
}
}
- private String getRequestURI(AccessEvent acccessEvent) {
+ private String getRequestURI(IAccessEvent acccessEvent) {
String uri = acccessEvent.getRequestURI();
if (uri != null && uri.length() >= 1 && uri.charAt(0) == '/') {
return uri.substring(1);
@@ -102,7 +102,7 @@ public class AccessEventDiscriminator extends ContextAwareBase implements
}
}
- private String getSessionAttribute(AccessEvent acccessEvent) {
+ private String getSessionAttribute(IAccessEvent acccessEvent) {
HttpServletRequest req = acccessEvent.getRequest();
if (req != null) {
HttpSession session = req.getSession(false);
diff --git a/logback-access/src/main/java/ch/qos/logback/access/sift/AppenderFactory.java b/logback-access/src/main/java/ch/qos/logback/access/sift/AppenderFactory.java
index 62c2ff3..ba86a52 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/sift/AppenderFactory.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/sift/AppenderFactory.java
@@ -15,12 +15,12 @@ package ch.qos.logback.access.sift;
import java.util.List;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.joran.event.SaxEvent;
import ch.qos.logback.core.sift.AppenderFactoryBase;
import ch.qos.logback.core.sift.SiftingJoranConfiguratorBase;
-public class AppenderFactory extends AppenderFactoryBase<AccessEvent> {
+public class AppenderFactory extends AppenderFactoryBase<IAccessEvent> {
String keyName;
@@ -29,7 +29,7 @@ public class AppenderFactory extends AppenderFactoryBase<AccessEvent> {
this.keyName = keyName;
}
- public SiftingJoranConfiguratorBase<AccessEvent> getSiftingJoranConfigurator(
+ public SiftingJoranConfiguratorBase<IAccessEvent> getSiftingJoranConfigurator(
String keyValue) {
return new SiftingJoranConfigurator(keyName, keyValue);
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/sift/SiftingAppender.java b/logback-access/src/main/java/ch/qos/logback/access/sift/SiftingAppender.java
index 95ae870..2c752f7 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/sift/SiftingAppender.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/sift/SiftingAppender.java
@@ -13,9 +13,8 @@
*/
package ch.qos.logback.access.sift;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.joran.spi.DefaultClass;
-import ch.qos.logback.core.sift.AppenderTracker;
import ch.qos.logback.core.sift.Discriminator;
import ch.qos.logback.core.sift.SiftingAppenderBase;
@@ -29,7 +28,7 @@ import ch.qos.logback.core.sift.SiftingAppenderBase;
*
* @author Ceki Gulcu
*/
-public class SiftingAppender extends SiftingAppenderBase<AccessEvent> {
+public class SiftingAppender extends SiftingAppenderBase<IAccessEvent> {
@Override
public void start() {
@@ -37,13 +36,13 @@ public class SiftingAppender extends SiftingAppenderBase<AccessEvent> {
}
@Override
- protected long getTimestamp(AccessEvent event) {
+ protected long getTimestamp(IAccessEvent event) {
return event.getTimeStamp();
}
@Override
@DefaultClass(AccessEventDiscriminator.class)
- public void setDiscriminator(Discriminator<AccessEvent> discriminator) {
+ public void setDiscriminator(Discriminator<IAccessEvent> discriminator) {
super.setDiscriminator(discriminator);
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/sift/SiftingJoranConfigurator.java b/logback-access/src/main/java/ch/qos/logback/access/sift/SiftingJoranConfigurator.java
index 13d00cc..2d27abe 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/sift/SiftingJoranConfigurator.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/sift/SiftingJoranConfigurator.java
@@ -17,7 +17,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.joran.action.ActionConst;
import ch.qos.logback.core.joran.action.AppenderAction;
@@ -26,7 +26,7 @@ import ch.qos.logback.core.joran.spi.RuleStore;
import ch.qos.logback.core.sift.SiftingJoranConfiguratorBase;
public class SiftingJoranConfigurator extends
- SiftingJoranConfiguratorBase<AccessEvent> {
+ SiftingJoranConfiguratorBase<IAccessEvent> {
String key;
String value;
@@ -59,7 +59,7 @@ public class SiftingJoranConfigurator extends
}
@SuppressWarnings("unchecked")
- public Appender<AccessEvent> getAppender() {
+ public Appender<IAccessEvent> getAppender() {
Map<String, Object> omap = interpreter.getInterpretationContext()
.getObjectMap();
HashMap appenderMap = (HashMap) omap.get(ActionConst.APPENDER_BAG);
@@ -68,6 +68,6 @@ public class SiftingJoranConfigurator extends
if(values.size() == 0) {
return null;
}
- return (Appender<AccessEvent>) values.iterator().next();
+ return (Appender<IAccessEvent>) values.iterator().next();
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/spi/AccessContext.java b/logback-access/src/main/java/ch/qos/logback/access/spi/AccessContext.java
index a8a3069..0584185 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/spi/AccessContext.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/spi/AccessContext.java
@@ -32,16 +32,16 @@ import ch.qos.logback.core.spi.FilterReply;
* @author Sébastien Pennec
*/
public class AccessContext extends ContextBase implements
- AppenderAttachable<AccessEvent>, FilterAttachable<AccessEvent> {
+ AppenderAttachable<IAccessEvent>, FilterAttachable<IAccessEvent> {
- AppenderAttachableImpl<AccessEvent> aai = new AppenderAttachableImpl<AccessEvent>();
- FilterAttachableImpl<AccessEvent> fai = new FilterAttachableImpl<AccessEvent>();
+ AppenderAttachableImpl<IAccessEvent> aai = new AppenderAttachableImpl<IAccessEvent>();
+ FilterAttachableImpl<IAccessEvent> fai = new FilterAttachableImpl<IAccessEvent>();
- public void callAppenders(AccessEvent event) {
+ public void callAppenders(IAccessEvent event) {
aai.appendLoopOnAppenders(event);
}
- public void addAppender(Appender<AccessEvent> newAppender) {
+ public void addAppender(Appender<IAccessEvent> newAppender) {
aai.addAppender(newAppender);
}
@@ -49,7 +49,7 @@ public class AccessContext extends ContextBase implements
aai.detachAndStopAllAppenders();
}
- public boolean detachAppender(Appender<AccessEvent> appender) {
+ public boolean detachAppender(Appender<IAccessEvent> appender) {
return aai.detachAppender(appender);
}
@@ -57,19 +57,19 @@ public class AccessContext extends ContextBase implements
return aai.detachAppender(name);
}
- public Appender<AccessEvent> getAppender(String name) {
+ public Appender<IAccessEvent> getAppender(String name) {
return aai.getAppender(name);
}
- public boolean isAttached(Appender<AccessEvent> appender) {
+ public boolean isAttached(Appender<IAccessEvent> appender) {
return aai.isAttached(appender);
}
- public Iterator<Appender<AccessEvent>> iteratorForAppenders() {
+ public Iterator<Appender<IAccessEvent>> iteratorForAppenders() {
return aai.iteratorForAppenders();
}
- public void addFilter(Filter<AccessEvent> newFilter) {
+ public void addFilter(Filter<IAccessEvent> newFilter) {
fai.addFilter(newFilter);
}
@@ -77,11 +77,11 @@ public class AccessContext extends ContextBase implements
fai.clearAllFilters();
}
- public List<Filter<AccessEvent>> getCopyOfAttachedFiltersList() {
+ public List<Filter<IAccessEvent>> getCopyOfAttachedFiltersList() {
return fai.getCopyOfAttachedFiltersList();
}
- public FilterReply getFilterChainDecision(AccessEvent event) {
+ public FilterReply getFilterChainDecision(IAccessEvent event) {
return fai.getFilterChainDecision(event);
}
}
diff --git a/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java b/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java
index fe75250..0880645 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java
@@ -23,6 +23,7 @@ import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
+import ch.qos.logback.access.spi.IAccessEvent;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.connector.Request;
@@ -62,7 +63,7 @@ import ch.qos.logback.core.util.StatusPrinter;
* @author Sébastien Pennec
*/
public class LogbackValve extends ValveBase implements Lifecycle, Context,
- AppenderAttachable<AccessEvent>, FilterAttachable<AccessEvent> {
+ AppenderAttachable<IAccessEvent>, FilterAttachable<IAccessEvent> {
public final static String DEFAULT_CONFIG_FILE = "conf" + File.separatorChar
+ "logback-access.xml";
@@ -78,9 +79,9 @@ public class LogbackValve extends ValveBase implements Lifecycle, Context,
// serialized. For the time being, we ignore this shortcoming.
Map<String, String> propertyMap = new HashMap<String, String>();
Map<String, Object> objectMap = new HashMap<String, Object>();
- private FilterAttachableImpl<AccessEvent> fai = new FilterAttachableImpl<AccessEvent>();
+ private FilterAttachableImpl<IAccessEvent> fai = new FilterAttachableImpl<IAccessEvent>();
- AppenderAttachableImpl<AccessEvent> aai = new AppenderAttachableImpl<AccessEvent>();
+ AppenderAttachableImpl<IAccessEvent> aai = new AppenderAttachableImpl<IAccessEvent>();
String filename;
boolean quiet;
boolean started;
@@ -158,7 +159,7 @@ public class LogbackValve extends ValveBase implements Lifecycle, Context,
getNext().invoke(request, response);
TomcatServerAdapter adapter = new TomcatServerAdapter(request, response);
- AccessEvent accessEvent = new AccessEvent(request, response, adapter);
+ IAccessEvent accessEvent = new AccessEvent(request, response, adapter);
if (getFilterChainDecision(accessEvent) == FilterReply.DENY) {
return;
@@ -175,19 +176,19 @@ public class LogbackValve extends ValveBase implements Lifecycle, Context,
started = false;
}
- public void addAppender(Appender<AccessEvent> newAppender) {
+ public void addAppender(Appender<IAccessEvent> newAppender) {
aai.addAppender(newAppender);
}
- public Iterator<Appender<AccessEvent>> iteratorForAppenders() {
+ public Iterator<Appender<IAccessEvent>> iteratorForAppenders() {
return aai.iteratorForAppenders();
}
- public Appender<AccessEvent> getAppender(String name) {
+ public Appender<IAccessEvent> getAppender(String name) {
return aai.getAppender(name);
}
- public boolean isAttached(Appender<AccessEvent> appender) {
+ public boolean isAttached(Appender<IAccessEvent> appender) {
return aai.isAttached(appender);
}
@@ -196,7 +197,7 @@ public class LogbackValve extends ValveBase implements Lifecycle, Context,
}
- public boolean detachAppender(Appender<AccessEvent> appender) {
+ public boolean detachAppender(Appender<IAccessEvent> appender) {
return aai.detachAppender(appender);
}
@@ -237,7 +238,7 @@ public class LogbackValve extends ValveBase implements Lifecycle, Context,
objectMap.put(key, value);
}
- public void addFilter(Filter<AccessEvent> newFilter) {
+ public void addFilter(Filter<IAccessEvent> newFilter) {
fai.addFilter(newFilter);
}
@@ -245,11 +246,11 @@ public class LogbackValve extends ValveBase implements Lifecycle, Context,
fai.clearAllFilters();
}
- public List<Filter<AccessEvent>> getCopyOfAttachedFiltersList() {
+ public List<Filter<IAccessEvent>> getCopyOfAttachedFiltersList() {
return fai.getCopyOfAttachedFiltersList();
}
- public FilterReply getFilterChainDecision(AccessEvent event) {
+ public FilterReply getFilterChainDecision(IAccessEvent event) {
return fai.getFilterChainDecision(event);
}
diff --git a/logback-access/src/test/java/ch/qos/logback/access/boolex/JaninoEventEvaluatorTest.java b/logback-access/src/test/java/ch/qos/logback/access/boolex/JaninoEventEvaluatorTest.java
index f16caac..5dd6fdb 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/boolex/JaninoEventEvaluatorTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/boolex/JaninoEventEvaluatorTest.java
@@ -17,12 +17,11 @@ package ch.qos.logback.access.boolex;
import ch.qos.logback.access.dummy.DummyRequest;
import ch.qos.logback.access.dummy.DummyResponse;
import ch.qos.logback.access.dummy.DummyServerAdapter;
-import ch.qos.logback.access.net.URLEvaluator;
import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.Context;
import ch.qos.logback.core.ContextBase;
import ch.qos.logback.core.boolex.EvaluationException;
-import ch.qos.logback.core.util.StatusPrinter;
import org.junit.Before;
import org.junit.Test;
@@ -53,7 +52,7 @@ public class JaninoEventEvaluatorTest {
public void smoke() throws EvaluationException {
evaluator.setExpression("event.getProtocol().equals(\"testProtocol\")");
evaluator.start();
- AccessEvent ae = new AccessEvent(request, response, serverAdapter);
+ IAccessEvent ae = new AccessEvent(request, response, serverAdapter);
assertTrue( evaluator.evaluate(ae));
}
@@ -62,7 +61,7 @@ public class JaninoEventEvaluatorTest {
evaluator.setExpression("String protocol = event.getProtocol();" +
"return protocol.equals(\"testProtocol\");");
evaluator.start();
- AccessEvent ae = new AccessEvent(request, response, serverAdapter);
+ IAccessEvent ae = new AccessEvent(request, response, serverAdapter);
assertTrue(evaluator.evaluate(ae));
}
@@ -70,7 +69,7 @@ public class JaninoEventEvaluatorTest {
public void invalidExpression() throws EvaluationException {
evaluator.setExpression("return true");
evaluator.start();
- AccessEvent ae = new AccessEvent(request, response, serverAdapter);
+ IAccessEvent ae = new AccessEvent(request, response, serverAdapter);
try {
evaluator.evaluate(ae);
fail("Was expecting an exception");
diff --git a/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java b/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java
index f3f28b6..b6cd260 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java
@@ -17,6 +17,7 @@ import static org.junit.Assert.assertEquals;
import java.util.Random;
+import ch.qos.logback.access.spi.IAccessEvent;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -27,7 +28,6 @@ import org.junit.Test;
import ch.qos.logback.access.dummy.DummyAccessEventBuilder;
import ch.qos.logback.access.joran.JoranConfigurator;
import ch.qos.logback.access.spi.AccessContext;
-import ch.qos.logback.access.spi.AccessEvent;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.joran.spi.JoranException;
import ch.qos.logback.core.status.Status;
@@ -64,10 +64,10 @@ public class DBAppenderIntegrationTest {
configurator.setContext(context);
configurator.doConfigure(configFile);
- Appender<AccessEvent> appender = context.getAppender("DB");
+ Appender<IAccessEvent> appender = context.getAppender("DB");
for (int i = 0; i < 10; i++) {
- AccessEvent event = DummyAccessEventBuilder.buildNewAccessEvent();
+ IAccessEvent event = DummyAccessEventBuilder.buildNewAccessEvent();
appender.doAppend(event);
}
diff --git a/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderTest.java b/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderTest.java
index fa8f90e..58a7319 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderTest.java
@@ -22,6 +22,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
+import ch.qos.logback.access.spi.IAccessEvent;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -88,7 +89,7 @@ public class DBAppenderTest {
public void testAppendAccessEvent() throws SQLException {
setInsertHeadersAndStart(false);
- AccessEvent event = createAccessEvent();
+ IAccessEvent event = createAccessEvent();
appender.append(event);
Statement stmt = connectionSource.getConnection().createStatement();
@@ -118,7 +119,7 @@ public class DBAppenderTest {
public void testCheckNoHeadersAreInserted() throws Exception {
setInsertHeadersAndStart(false);
- AccessEvent event = createAccessEvent();
+ IAccessEvent event = createAccessEvent();
appender.append(event);
StatusPrinter.print(context.getStatusManager());
@@ -136,7 +137,7 @@ public class DBAppenderTest {
public void testAppendHeaders() throws SQLException {
setInsertHeadersAndStart(true);
- AccessEvent event = createAccessEvent();
+ IAccessEvent event = createAccessEvent();
appender.append(event);
Statement stmt = connectionSource.getConnection().createStatement();
@@ -172,7 +173,7 @@ public class DBAppenderTest {
setInsertHeadersAndStart(false);
String uri = "testAppendMultipleEvents";
for (int i = 0; i < 10; i++) {
- AccessEvent event = createAccessEvent(uri);
+ IAccessEvent event = createAccessEvent(uri);
appender.append(event);
}
@@ -191,17 +192,16 @@ public class DBAppenderTest {
stmt.close();
}
- private AccessEvent createAccessEvent() {
+ private IAccessEvent createAccessEvent() {
return createAccessEvent("");
}
- private AccessEvent createAccessEvent(String uri) {
+ private IAccessEvent createAccessEvent(String uri) {
DummyRequest request = new DummyRequest();
request.setRequestUri(uri);
DummyResponse response = new DummyResponse();
DummyServerAdapter adapter = new DummyServerAdapter(request, response);
- AccessEvent ae = new AccessEvent(request, response, adapter);
- return ae;
+ return new AccessEvent(request, response, adapter);
}
}
diff --git a/logback-access/src/test/java/ch/qos/logback/access/dummy/DummyAccessEventBuilder.java b/logback-access/src/test/java/ch/qos/logback/access/dummy/DummyAccessEventBuilder.java
index 85595cf..9586984 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/dummy/DummyAccessEventBuilder.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/dummy/DummyAccessEventBuilder.java
@@ -14,17 +14,17 @@
package ch.qos.logback.access.dummy;
import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
public class DummyAccessEventBuilder {
- static public AccessEvent buildNewAccessEvent() {
+ static public IAccessEvent buildNewAccessEvent() {
DummyRequest request = new DummyRequest();
DummyResponse response = new DummyResponse();
DummyServerAdapter adapter = new DummyServerAdapter(request, response);
- AccessEvent ae = new AccessEvent(request, response, adapter);
- return ae;
+ return new AccessEvent(request, response, adapter);
}
}
diff --git a/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyBasicTest.java b/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyBasicTest.java
index 805db06..393f11f 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyBasicTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyBasicTest.java
@@ -21,11 +21,11 @@ import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;
+import ch.qos.logback.access.spi.IAccessEvent;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import ch.qos.logback.access.spi.AccessEvent;
import ch.qos.logback.access.spi.Util;
import ch.qos.logback.access.testUtil.NotifyingListAppender;
import ch.qos.logback.core.testUtil.RandomUtil;
@@ -85,7 +85,7 @@ public class JettyBasicTest {
}
assertTrue(listAppender.list.size() > 0);
- AccessEvent event = (AccessEvent) listAppender.list.get(0);
+ IAccessEvent event = listAppender.list.get(0);
assertEquals("127.0.0.1", event.getRemoteHost());
assertEquals("localhost", event.getServerName());
listAppender.list.clear();
@@ -122,7 +122,7 @@ public class JettyBasicTest {
}
@SuppressWarnings("unused")
- AccessEvent event = (AccessEvent) listAppender.list.get(0);
+ IAccessEvent event = listAppender.list.get(0);
// we should test the contents of the requests
// assertEquals(msg, event.getRequestContent());
diff --git a/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyFixture.java b/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyFixture.java
index 87fb172..4a6f891 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyFixture.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/jetty/JettyFixture.java
@@ -20,6 +20,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import ch.qos.logback.access.spi.IAccessEvent;
import org.mortbay.jetty.Handler;
import org.mortbay.jetty.HttpConnection;
import org.mortbay.jetty.Request;
@@ -27,7 +28,6 @@ import org.mortbay.jetty.handler.AbstractHandler;
import org.mortbay.util.ByteArrayISO8859Writer;
import ch.qos.logback.access.PatternLayoutEncoder;
-import ch.qos.logback.access.spi.AccessEvent;
import ch.qos.logback.access.testUtil.NotifyingListAppender;
import ch.qos.logback.core.ConsoleAppender;
@@ -56,7 +56,7 @@ public class JettyFixture extends JettyFixtureBase {
appender.setName("list");
appender.start();
- ConsoleAppender<AccessEvent> console = new ConsoleAppender<AccessEvent>();
+ ConsoleAppender<IAccessEvent> console = new ConsoleAppender<IAccessEvent>();
console.setContext(requestLogImpl);
console.setName("console");
PatternLayoutEncoder layout = new PatternLayoutEncoder();
@@ -98,4 +98,4 @@ class BasicHandler extends AbstractHandler {
base_request.setHandled(true);
}
-}
\ No newline at end of file
+}
diff --git a/logback-access/src/test/java/ch/qos/logback/access/joran/JoranConfiguratorTest.java b/logback-access/src/test/java/ch/qos/logback/access/joran/JoranConfiguratorTest.java
index c24d18b..7551b54 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/joran/JoranConfiguratorTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/joran/JoranConfiguratorTest.java
@@ -17,6 +17,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import ch.qos.logback.access.spi.IAccessEvent;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -24,7 +25,6 @@ import org.junit.Test;
import ch.qos.logback.access.TeztConstants;
import ch.qos.logback.access.dummy.DummyAccessEventBuilder;
import ch.qos.logback.access.spi.AccessContext;
-import ch.qos.logback.access.spi.AccessEvent;
import ch.qos.logback.core.joran.spi.JoranException;
import ch.qos.logback.core.read.ListAppender;
import ch.qos.logback.core.testUtil.StringListAppender;
@@ -51,24 +51,24 @@ public class JoranConfiguratorTest {
public void smoke() throws Exception {
configure(TeztConstants.TEST_DIR_PREFIX + "input/joran/smoke.xml");
- ListAppender<AccessEvent> listAppender = (ListAppender<AccessEvent>) context
+ ListAppender<IAccessEvent> listAppender = (ListAppender<IAccessEvent>) context
.getAppender("LIST");
- AccessEvent event = DummyAccessEventBuilder.buildNewAccessEvent();
+ IAccessEvent event = DummyAccessEventBuilder.buildNewAccessEvent();
listAppender.doAppend(event);
assertEquals(1, listAppender.list.size());
assertEquals(1, listAppender.list.size());
- AccessEvent ae = (AccessEvent) listAppender.list.get(0);
+ IAccessEvent ae = listAppender.list.get(0);
assertNotNull(ae);
}
@Test
public void defaultLayout() throws Exception {
configure(TeztConstants.TEST_DIR_PREFIX + "input/joran/defaultLayout.xml");
- StringListAppender<AccessEvent> listAppender = (StringListAppender<AccessEvent>) context
+ StringListAppender<IAccessEvent> listAppender = (StringListAppender<IAccessEvent>) context
.getAppender("STR_LIST");
- AccessEvent event = DummyAccessEventBuilder.buildNewAccessEvent();
+ IAccessEvent event = DummyAccessEventBuilder.buildNewAccessEvent();
listAppender.doAppend(event);
assertEquals(1, listAppender.strList.size());
// the result contains a line separator at the end
diff --git a/logback-access/src/test/java/ch/qos/logback/access/net/MockSocketServer.java b/logback-access/src/test/java/ch/qos/logback/access/net/MockSocketServer.java
index b6cfee8..a2d5c5c 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/net/MockSocketServer.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/net/MockSocketServer.java
@@ -20,7 +20,8 @@ import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
-import ch.qos.logback.access.spi.AccessEvent;
+//import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
/**
@@ -32,7 +33,7 @@ public class MockSocketServer extends Thread {
final int loopLen;
- List<AccessEvent> accessEventList = new ArrayList<AccessEvent>();
+ List<IAccessEvent> accessEventList = new ArrayList<IAccessEvent>();
boolean finished = false;
MockSocketServer(int loopLen) {
@@ -45,14 +46,13 @@ public class MockSocketServer extends Thread {
ObjectInputStream ois = null;
ServerSocket serverSocket = null;
// Object readObject;
- AccessEvent event;
try {
serverSocket = new ServerSocket(PORT);
Socket socket = serverSocket.accept();
ois = new ObjectInputStream(new BufferedInputStream(socket
.getInputStream()));
for (int i = 0; i < loopLen; i++) {
- event = (AccessEvent) ois.readObject();
+ IAccessEvent event = (IAccessEvent) ois.readObject();
accessEventList.add(event);
}
} catch (Exception se) {
diff --git a/logback-access/src/test/java/ch/qos/logback/access/net/SerializationPerfTest.java b/logback-access/src/test/java/ch/qos/logback/access/net/SerializationPerfTest.java
index 918b1f4..2479976 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/net/SerializationPerfTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/net/SerializationPerfTest.java
@@ -16,9 +16,9 @@ package ch.qos.logback.access.net;
import java.io.IOException;
import java.io.ObjectOutputStream;
+import ch.qos.logback.access.spi.IAccessEvent;
import junit.framework.TestCase;
import ch.qos.logback.access.dummy.DummyAccessEventBuilder;
-import ch.qos.logback.access.spi.AccessEvent;
public class SerializationPerfTest extends TestCase {
@@ -48,7 +48,7 @@ public class SerializationPerfTest extends TestCase {
int pauseCounter = 0;
for (int i = 0; i < loopNumber; i++) {
try {
- AccessEvent ae = DummyAccessEventBuilder.buildNewAccessEvent();
+ IAccessEvent ae = DummyAccessEventBuilder.buildNewAccessEvent();
//average time for the next method: 5000 nanos
ae.prepareForDeferredProcessing();
oos.writeObject(ae);
@@ -76,7 +76,7 @@ public class SerializationPerfTest extends TestCase {
// System.out.println("Beginning mesured run");
for (int i = 0; i < loopNumber; i++) {
try {
- AccessEvent ae = DummyAccessEventBuilder.buildNewAccessEvent();
+ IAccessEvent ae = DummyAccessEventBuilder.buildNewAccessEvent();
t1 = System.nanoTime();
//average length of the next method: 4000 nanos
ae.prepareForDeferredProcessing();
diff --git a/logback-access/src/test/java/ch/qos/logback/access/net/SocketAppenderTest.java b/logback-access/src/test/java/ch/qos/logback/access/net/SocketAppenderTest.java
index f9e7bfd..795d98f 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/net/SocketAppenderTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/net/SocketAppenderTest.java
@@ -16,6 +16,7 @@ package ch.qos.logback.access.net;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import ch.qos.logback.access.spi.IAccessEvent;
import org.junit.Test;
import ch.qos.logback.access.dummy.DummyRequest;
@@ -52,7 +53,7 @@ public class SocketAppenderTest {
assertTrue(mockSocketServer.finished);
assertEquals(1, mockSocketServer.accessEventList.size());
- AccessEvent remoteEvent = mockSocketServer.accessEventList.get(0);
+ IAccessEvent remoteEvent = mockSocketServer.accessEventList.get(0);
//check that the values are available although the request and response
//objects did not survive serialization
assertEquals("headerValue1", remoteEvent.getRequestHeader("headerName1"));
@@ -78,12 +79,11 @@ public class SocketAppenderTest {
socketAppender.start();
}
- private AccessEvent buildNewAccessEvent() {
+ private IAccessEvent buildNewAccessEvent() {
DummyRequest request = new DummyRequest();
DummyResponse response = new DummyResponse();
DummyServerAdapter adapter = new DummyServerAdapter(request, response);
- AccessEvent ae = new AccessEvent(request, response, adapter);
- return ae;
+ return new AccessEvent(request, response, adapter);
}
}
diff --git a/logback-access/src/test/java/ch/qos/logback/access/net/URLEvaluatorTest.java b/logback-access/src/test/java/ch/qos/logback/access/net/URLEvaluatorTest.java
index f259f65..dd2bf4d 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/net/URLEvaluatorTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/net/URLEvaluatorTest.java
@@ -15,6 +15,7 @@ package ch.qos.logback.access.net;
import static org.junit.Assert.*;
+import ch.qos.logback.access.spi.IAccessEvent;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -61,14 +62,14 @@ public class URLEvaluatorTest {
@Test
public void testExpectFalse() throws EvaluationException {
request.setRequestUri("test");
- AccessEvent ae = new AccessEvent(request, response, serverAdapter);
+ IAccessEvent ae = new AccessEvent(request, response, serverAdapter);
assertFalse(evaluator.evaluate(ae));
}
@Test
public void testExpectTrue() throws EvaluationException {
request.setRequestUri(expectedURL1);
- AccessEvent ae = new AccessEvent(request, response, serverAdapter);
+ IAccessEvent ae = new AccessEvent(request, response, serverAdapter);
assertTrue(evaluator.evaluate(ae));
}
@@ -76,7 +77,7 @@ public class URLEvaluatorTest {
public void testExpectTrueMultiple() throws EvaluationException {
evaluator.addURL(expectedURL2);
request.setRequestUri(expectedURL2);
- AccessEvent ae = new AccessEvent(request, response, serverAdapter);
+ IAccessEvent ae = new AccessEvent(request, response, serverAdapter);
assertTrue(evaluator.evaluate(ae));
}
}
diff --git a/logback-access/src/test/java/ch/qos/logback/access/pattern/ConverterTest.java b/logback-access/src/test/java/ch/qos/logback/access/pattern/ConverterTest.java
index b96b8bc..c71f1e6 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/pattern/ConverterTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/pattern/ConverterTest.java
@@ -20,6 +20,7 @@ import java.util.List;
import javax.servlet.http.Cookie;
+import ch.qos.logback.access.spi.IAccessEvent;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -31,7 +32,7 @@ import ch.qos.logback.access.spi.AccessEvent;
public class ConverterTest {
- AccessEvent event;
+ IAccessEvent event;
DummyRequest request;
DummyResponse response;
@@ -191,10 +192,9 @@ public class ConverterTest {
assertEquals(Integer.toString(event.getServerAdapter().getStatusCode()), result);
}
- private AccessEvent createEvent() {
+ private IAccessEvent createEvent() {
DummyServerAdapter dummyAdapter = new DummyServerAdapter(request, response);
- AccessEvent ae = new AccessEvent(request, response, dummyAdapter);
- return ae;
+ return new AccessEvent(request, response, dummyAdapter);
}
}
diff --git a/logback-access/src/test/java/ch/qos/logback/access/sift/SiftingAppenderTest.java b/logback-access/src/test/java/ch/qos/logback/access/sift/SiftingAppenderTest.java
index 318c02a..c879f6a 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/sift/SiftingAppenderTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/sift/SiftingAppenderTest.java
@@ -25,7 +25,7 @@ import org.junit.Before;
import org.junit.Test;
import ch.qos.logback.access.jetty.RequestLogImpl;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.access.spi.Util;
import ch.qos.logback.core.read.ListAppender;
import ch.qos.logback.core.testUtil.RandomUtil;
@@ -77,18 +77,18 @@ public class SiftingAppenderTest {
long now = System.currentTimeMillis();
{
- ListAppender<AccessEvent> listAppender = (ListAppender<AccessEvent>) siftingAppender
+ ListAppender<IAccessEvent> listAppender = (ListAppender<IAccessEvent>) siftingAppender
.getAppenderTracker().get("NA", now);
assertEquals(1, listAppender.list.size());
}
{
- ListAppender<AccessEvent> listAppender = (ListAppender<AccessEvent>) siftingAppender
+ ListAppender<IAccessEvent> listAppender = (ListAppender<IAccessEvent>) siftingAppender
.getAppenderTracker().get("x", now);
assertEquals(2, listAppender.list.size());
}
{
- ListAppender<AccessEvent> listAppender = (ListAppender<AccessEvent>) siftingAppender
+ ListAppender<IAccessEvent> listAppender = (ListAppender<IAccessEvent>) siftingAppender
.getAppenderTracker().get("y", now);
assertEquals(1, listAppender.list.size());
}
diff --git a/logback-access/src/test/java/ch/qos/logback/access/spi/AccessEventSerializationTest.java b/logback-access/src/test/java/ch/qos/logback/access/spi/AccessEventSerializationTest.java
index b486836..acc4767 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/spi/AccessEventSerializationTest.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/spi/AccessEventSerializationTest.java
@@ -34,7 +34,7 @@ public class AccessEventSerializationTest {
ClassNotFoundException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
- AccessEvent ae = DummyAccessEventBuilder.buildNewAccessEvent();
+ IAccessEvent ae = DummyAccessEventBuilder.buildNewAccessEvent();
// average time for the next method: 5000 nanos
ae.prepareForDeferredProcessing();
oos.writeObject(ae);
@@ -50,7 +50,7 @@ public class AccessEventSerializationTest {
public void testSerialization() throws IOException, ClassNotFoundException {
Object o = buildSerializedAccessEvent();
assertNotNull(o);
- AccessEvent aeBack = (AccessEvent) o;
+ IAccessEvent aeBack = (IAccessEvent) o;
assertEquals(DummyResponse.DUMMY_DEFAULT_HDEADER_MAP, aeBack
diff --git a/logback-access/src/test/java/ch/qos/logback/access/testUtil/NotifyingListAppender.java b/logback-access/src/test/java/ch/qos/logback/access/testUtil/NotifyingListAppender.java
index 950a5ab..40179c8 100644
--- a/logback-access/src/test/java/ch/qos/logback/access/testUtil/NotifyingListAppender.java
+++ b/logback-access/src/test/java/ch/qos/logback/access/testUtil/NotifyingListAppender.java
@@ -16,14 +16,14 @@ package ch.qos.logback.access.testUtil;
import java.util.ArrayList;
import java.util.List;
-import ch.qos.logback.access.spi.AccessEvent;
+import ch.qos.logback.access.spi.IAccessEvent;
import ch.qos.logback.core.AppenderBase;
-public class NotifyingListAppender extends AppenderBase<AccessEvent> {
+public class NotifyingListAppender extends AppenderBase<IAccessEvent> {
- public List<AccessEvent> list = new ArrayList<AccessEvent>();
+ public List<IAccessEvent> list = new ArrayList<IAccessEvent>();
- protected void append(AccessEvent e) {
+ protected void append(IAccessEvent e) {
list.add(e);
synchronized (this) {
this.notify();
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=e6014e4306c6a0f4732e8aefd071f8fbfb7437c2
http://github.com/ceki/logback/commit/e6014e4306c6a0f4732e8aefd071f8fbfb7437c2
commit e6014e4306c6a0f4732e8aefd071f8fbfb7437c2
Author: Joern Huxhorn <jhuxhorn at googlemail.com>
Date: Mon Mar 28 16:06:08 2011 +0200
Implementing IAccessEvent interface.
ATTENTION, breaking change:
- removed NA_STRING_ARRAY because the content could
have been changed by other classes, previously.
- EMPTY is no longer public but private instead.
diff --git a/logback-access/src/main/java/ch/qos/logback/access/spi/AccessEvent.java b/logback-access/src/main/java/ch/qos/logback/access/spi/AccessEvent.java
index 6596aaf..7541c27 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/spi/AccessEvent.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/spi/AccessEvent.java
@@ -29,7 +29,6 @@ import javax.servlet.http.HttpServletResponse;
import ch.qos.logback.access.AccessConstants;
import ch.qos.logback.access.pattern.AccessConverter;
import ch.qos.logback.access.servlet.Util;
-import ch.qos.logback.core.spi.DeferredProcessingAware;
// Contributors: Joern Huxhorn (see also bug #110)
@@ -42,16 +41,12 @@ import ch.qos.logback.core.spi.DeferredProcessingAware;
* @author Ceki Gülcü
* @author Sébastien Pennec
*/
-public class AccessEvent implements Serializable, DeferredProcessingAware {
+public class AccessEvent implements Serializable, IAccessEvent {
private static final long serialVersionUID = 866718993618836343L;
- public final static String NA = "-";
- public final static String[] NA_STRING_ARRAY = new String[] { AccessEvent.NA };
-
- public final static String EMPTY = "";
- public static final int SENTINEL = -1;
+ private static final String EMPTY = "";
private transient final HttpServletRequest httpRequest;
private transient final HttpServletResponse httpResponse;
@@ -129,7 +124,7 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
if (httpRequest != null) {
requestURI = httpRequest.getRequestURI();
} else {
- requestURI = AccessEvent.NA;
+ requestURI = NA;
}
}
return requestURI;
@@ -154,7 +149,7 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
buf.append(httpRequest.getProtocol());
requestURL = buf.toString();
} else {
- requestURL = AccessEvent.NA;
+ requestURL = NA;
}
}
return requestURL;
@@ -167,7 +162,7 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
// determine if remote lookup will be performed
remoteHost = httpRequest.getRemoteHost();
} else {
- remoteHost = AccessEvent.NA;
+ remoteHost = NA;
}
}
return remoteHost;
@@ -178,7 +173,7 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
if (httpRequest != null) {
remoteUser = httpRequest.getRemoteUser();
} else {
- remoteUser = AccessEvent.NA;
+ remoteUser = NA;
}
}
return remoteUser;
@@ -189,7 +184,7 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
if (httpRequest != null) {
protocol = httpRequest.getProtocol();
} else {
- protocol = AccessEvent.NA;
+ protocol = NA;
}
}
return protocol;
@@ -200,7 +195,7 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
if (httpRequest != null) {
method = httpRequest.getMethod();
} else {
- method = AccessEvent.NA;
+ method = NA;
}
}
return method;
@@ -211,7 +206,7 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
if (httpRequest != null) {
serverName = httpRequest.getServerName();
} else {
- serverName = AccessEvent.NA;
+ serverName = NA;
}
}
return serverName;
@@ -222,7 +217,7 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
if (httpRequest != null) {
remoteAddr = httpRequest.getRemoteAddr();
} else {
- remoteAddr = AccessEvent.NA;
+ remoteAddr = NA;
}
}
return remoteAddr;
@@ -243,7 +238,7 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
if (result != null) {
return result;
} else {
- return AccessEvent.NA;
+ return NA;
}
}
@@ -305,12 +300,12 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
if (httpRequest != null) {
Object value = httpRequest.getAttribute(key);
if (value == null) {
- return AccessEvent.NA;
+ return NA;
} else {
return value.toString();
}
} else {
- return AccessEvent.NA;
+ return NA;
}
}
@@ -318,12 +313,12 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
if (httpRequest != null) {
String[] value = httpRequest.getParameterValues(key);
if (value == null) {
- return NA_STRING_ARRAY;
+ return new String[] { NA };
} else {
return value;
}
} else {
- return NA_STRING_ARRAY;
+ return new String[] { NA };
}
}
@@ -332,7 +327,7 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
if (httpRequest != null) {
Cookie[] cookieArray = httpRequest.getCookies();
if (cookieArray == null) {
- return AccessEvent.NA;
+ return NA;
}
for (Cookie cookie : cookieArray) {
@@ -341,7 +336,7 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
}
}
}
- return AccessEvent.NA;
+ return NA;
}
public long getContentLength() {
@@ -494,4 +489,4 @@ public class AccessEvent implements Serializable, DeferredProcessingAware {
getRequestContent();
getResponseContent();
}
-}
\ No newline at end of file
+}
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=146b2027091f6f34b9fe22a5f3548046756e08ec
http://github.com/ceki/logback/commit/146b2027091f6f34b9fe22a5f3548046756e08ec
commit 146b2027091f6f34b9fe22a5f3548046756e08ec
Author: Joern Huxhorn <jhuxhorn at googlemail.com>
Date: Mon Mar 28 16:01:25 2011 +0200
New IAccessEvent interface.
diff --git a/logback-access/src/main/java/ch/qos/logback/access/spi/IAccessEvent.java b/logback-access/src/main/java/ch/qos/logback/access/spi/IAccessEvent.java
new file mode 100644
index 0000000..7fe5ce2
--- /dev/null
+++ b/logback-access/src/main/java/ch/qos/logback/access/spi/IAccessEvent.java
@@ -0,0 +1,118 @@
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ * Copyright (C) 1999-2009, QOS.ch. All rights reserved.
+ *
+ * This program and the accompanying materials are dual-licensed under
+ * either the terms of the Eclipse Public License v1.0 as published by
+ * the Eclipse Foundation
+ *
+ * or (per the licensee's choosing)
+ *
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ */
+package ch.qos.logback.access.spi;
+
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Map;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import ch.qos.logback.core.spi.DeferredProcessingAware;
+
+// Contributors: Joern Huxhorn (see also bug #110)
+
+/**
+ * The Access module's internal representation of logging events. When the
+ * logging component instance is called in the container to log then a
+ * <code>AccessEvent</code> instance is created. This instance is passed
+ * around to the different logback components.
+ *
+ * @author Ceki Gülcü
+ * @author Sébastien Pennec
+ * @author Jörn Huxhorn
+ */
+public interface IAccessEvent extends DeferredProcessingAware {
+
+ String NA = "-";
+ int SENTINEL = -1;
+
+ /**
+ * Returns the underlying HttpServletRequest. After serialization the returned
+ * value will be null.
+ *
+ * @return
+ */
+ HttpServletRequest getRequest();
+
+ /**
+ * Returns the underlying HttpServletResponse. After serialization the returned
+ * value will be null.
+ *
+ * @return
+ */
+ HttpServletResponse getResponse();
+
+ /**
+ * The number of milliseconds elapsed from 1/1/1970 until logging event was
+ * created.
+ */
+ long getTimeStamp();
+
+ String getRequestURI();
+
+ /**
+ * The first line of the request.
+ */
+ String getRequestURL();
+
+ String getRemoteHost();
+
+ String getRemoteUser();
+
+ String getProtocol();
+
+ String getMethod();
+
+ String getServerName();
+
+ String getRemoteAddr();
+
+ String getRequestHeader(String key);
+
+ Enumeration getRequestHeaderNames();
+
+ Map<String, String> getRequestHeaderMap();
+
+ Map<String, String[]> getRequestParameterMap();
+
+ /**
+ * Attributes are not serialized
+ *
+ * @param key
+ */
+ String getAttribute(String key);
+
+ String[] getRequestParameter(String key);
+
+ String getCookie(String key);
+
+ long getContentLength();
+
+ int getStatusCode();
+
+ String getRequestContent();
+
+ String getResponseContent();
+
+ int getLocalPort();
+
+ ServerAdapter getServerAdapter();
+
+ String getResponseHeader(String key);
+
+ Map<String, String> getResponseHeaderMap();
+
+ List<String> getResponseHeaderNameList();
+}
-----------------------------------------------------------------------
Summary of changes:
.../java/ch/qos/logback/access/PatternLayout.java | 8 +-
.../qos/logback/access/PatternLayoutEncoder.java | 6 +-
.../access/boolex/JaninoEventEvaluator.java | 11 +-
.../java/ch/qos/logback/access/db/DBAppender.java | 12 +-
.../ch/qos/logback/access/html/HTMLLayout.java | 12 +-
.../qos/logback/access/jetty/RequestLogImpl.java | 25 ++--
.../logback/access/jetty/v7/RequestLogImpl.java | 27 +++--
.../AccessEventPreSerializationTransformer.java | 11 ++-
.../ch/qos/logback/access/net/SMTPAppender.java | 18 ++--
.../ch/qos/logback/access/net/SocketAppender.java | 15 +--
.../java/ch/qos/logback/access/net/SocketNode.java | 8 +-
.../ch/qos/logback/access/net/URLEvaluator.java | 4 +-
.../logback/access/pattern/AccessConverter.java | 4 +-
.../access/pattern/ContentLengthConverter.java | 8 +-
.../qos/logback/access/pattern/DateConverter.java | 4 +-
.../access/pattern/EnsureLineSeparation.java | 10 +-
.../access/pattern/FullRequestConverter.java | 4 +-
.../access/pattern/FullResponseConverter.java | 4 +-
.../access/pattern/LineSeparatorConverter.java | 4 +-
.../access/pattern/LocalIPAddressConverter.java | 4 +-
.../logback/access/pattern/LocalPortConverter.java | 4 +-
.../ch/qos/logback/access/pattern/NAConverter.java | 6 +-
.../access/pattern/RemoteHostConverter.java | 4 +-
.../access/pattern/RemoteIPAddressConverter.java | 4 +-
.../access/pattern/RemoteUserConverter.java | 6 +-
.../access/pattern/RequestAttributeConverter.java | 4 +-
.../access/pattern/RequestContentConverter.java | 4 +-
.../access/pattern/RequestCookieConverter.java | 4 +-
.../access/pattern/RequestHeaderConverter.java | 4 +-
.../access/pattern/RequestMethodConverter.java | 4 +-
.../access/pattern/RequestParameterConverter.java | 4 +-
.../access/pattern/RequestProtocolConverter.java | 4 +-
.../access/pattern/RequestURIConverter.java | 4 +-
.../access/pattern/RequestURLConverter.java | 4 +-
.../access/pattern/ResponseContentConverter.java | 4 +-
.../access/pattern/ResponseHeaderConverter.java | 4 +-
.../access/pattern/ServerNameConverter.java | 4 +-
.../access/pattern/StatusCodeConverter.java | 4 +-
.../access/sift/AccessEventDiscriminator.java | 18 ++--
.../qos/logback/access/sift/AppenderFactory.java | 6 +-
.../qos/logback/access/sift/SiftingAppender.java | 9 +-
.../access/sift/SiftingJoranConfigurator.java | 8 +-
.../ch/qos/logback/access/spi/AccessContext.java | 24 ++--
.../ch/qos/logback/access/spi/AccessEvent.java | 41 +++----
.../ch/qos/logback/access/spi/IAccessEvent.java | 118 ++++++++++++++++++++
.../ch/qos/logback/access/tomcat/LogbackValve.java | 25 ++--
.../access/boolex/JaninoEventEvaluatorTest.java | 9 +-
.../access/db/DBAppenderIntegrationTest.java | 6 +-
.../ch/qos/logback/access/db/DBAppenderTest.java | 16 ++--
.../access/dummy/DummyAccessEventBuilder.java | 6 +-
.../qos/logback/access/jetty/JettyBasicTest.java | 6 +-
.../ch/qos/logback/access/jetty/JettyFixture.java | 6 +-
.../access/joran/JoranConfiguratorTest.java | 12 +-
.../qos/logback/access/net/MockSocketServer.java | 8 +-
.../logback/access/net/SerializationPerfTest.java | 6 +-
.../qos/logback/access/net/SocketAppenderTest.java | 8 +-
.../qos/logback/access/net/URLEvaluatorTest.java | 7 +-
.../qos/logback/access/pattern/ConverterTest.java | 8 +-
.../logback/access/sift/SiftingAppenderTest.java | 8 +-
.../access/spi/AccessEventSerializationTest.java | 4 +-
.../access/testUtil/NotifyingListAppender.java | 8 +-
61 files changed, 380 insertions(+), 262 deletions(-)
create mode 100644 logback-access/src/main/java/ch/qos/logback/access/spi/IAccessEvent.java
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
More information about the logback-dev
mailing list