View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, 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 ch.qos.logback.core.spi.DeferredProcessingAware;
17  
18  import javax.servlet.http.HttpServletRequest;
19  import javax.servlet.http.HttpServletResponse;
20  import java.util.Enumeration;
21  import java.util.List;
22  import java.util.Map;
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&uuml;lc&uuml;
33   * @author S&eacute;bastien Pennec
34   * @author J&ouml;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      /**
64       * The time elapsed between receiving the request and logging it in milliseconds.
65       */
66      long getElapsedTime();
67  
68      /**
69      * The number of seconds elapsed between receiving the request and logging it.
70      */
71      long getElapsedSeconds();
72  
73      String getRequestURI();
74  
75      /**
76       * The first line of the request.
77       */
78      String getRequestURL();
79  
80      String getRemoteHost();
81  
82      String getRemoteUser();
83  
84      String getProtocol();
85  
86      String getMethod();
87  
88      String getServerName();
89  
90      String getSessionID();
91  
92      void setThreadName(String threadName);
93      String getThreadName();
94      
95      String getQueryString();
96      
97      String getRemoteAddr();
98  
99      String getRequestHeader(String key);
100 
101     Enumeration<String> getRequestHeaderNames();
102 
103     Map<String, String> getRequestHeaderMap();
104 
105     Map<String, String[]> getRequestParameterMap();
106 
107     String getAttribute(String key);
108 
109     String[] getRequestParameter(String key);
110 
111     String getCookie(String key);
112 
113     long getContentLength();
114 
115     int getStatusCode();
116 
117     String getRequestContent();
118 
119     String getResponseContent();
120 
121     int getLocalPort();
122 
123     ServerAdapter getServerAdapter();
124 
125     String getResponseHeader(String key);
126 
127     Map<String, String> getResponseHeaderMap();
128 
129     List<String> getResponseHeaderNameList();
130 }