1 /**
2 * Logback: the reliable, generic, fast and flexible logging framework.
3 * Copyright (C) 1999-2011, QOS.ch. All rights reserved.
4 *
5 * This program and the accompanying materials are dual-licensed under
6 * either the terms of the Eclipse Public License v1.0 as published by
7 * the Eclipse Foundation
8 *
9 * or (per the licensee's choosing)
10 *
11 * under the terms of the GNU Lesser General Public License version 2.1
12 * as published by the Free Software Foundation.
13 */
14 package ch.qos.logback.access.spi;
15
16 import java.util.Enumeration;
17 import java.util.List;
18 import java.util.Map;
19 import javax.servlet.http.HttpServletRequest;
20 import javax.servlet.http.HttpServletResponse;
21
22 import ch.qos.logback.core.spi.DeferredProcessingAware;
23
24 // Contributors: Joern Huxhorn (see also bug #110)
25
26 /**
27 * The Access module's internal representation of logging events. When the
28 * logging component instance is called in the container to log then a
29 * <code>AccessEvent</code> instance is created. This instance is passed
30 * around to the different logback components.
31 *
32 * @author Ceki Gülcü
33 * @author Sébastien Pennec
34 * @author Jörn Huxhorn
35 */
36 public interface IAccessEvent extends DeferredProcessingAware {
37
38 String NA = "-";
39 int SENTINEL = -1;
40
41 /**
42 * Returns the underlying HttpServletRequest. After serialization the returned
43 * value will be null.
44 *
45 * @return
46 */
47 HttpServletRequest getRequest();
48
49 /**
50 * Returns the underlying HttpServletResponse. After serialization the returned
51 * value will be null.
52 *
53 * @return
54 */
55 HttpServletResponse getResponse();
56
57 /**
58 * The number of milliseconds elapsed from 1/1/1970 until logging event was
59 * created.
60 */
61 long getTimeStamp();
62
63 String getRequestURI();
64
65 /**
66 * The first line of the request.
67 */
68 String getRequestURL();
69
70 String getRemoteHost();
71
72 String getRemoteUser();
73
74 String getProtocol();
75
76 String getMethod();
77
78 String getServerName();
79
80 String getRemoteAddr();
81
82 String getRequestHeader(String key);
83
84 Enumeration getRequestHeaderNames();
85
86 Map<String, String> getRequestHeaderMap();
87
88 Map<String, String[]> getRequestParameterMap();
89
90 /**
91 * Attributes are not serialized
92 *
93 * @param key
94 */
95 String getAttribute(String key);
96
97 String[] getRequestParameter(String key);
98
99 String getCookie(String key);
100
101 long getContentLength();
102
103 int getStatusCode();
104
105 String getRequestContent();
106
107 String getResponseContent();
108
109 int getLocalPort();
110
111 ServerAdapter getServerAdapter();
112
113 String getResponseHeader(String key);
114
115 Map<String, String> getResponseHeaderMap();
116
117 List<String> getResponseHeaderNameList();
118 }