Package ch.qos.logback.access.spi

## Class AccessEvent

- java.lang.Object
- - ch.qos.logback.access.spi.AccessEvent

All Implemented Interfaces:
  `IAccessEvent`, `DeferredProcessingAware`, `java.io.Serializable`

    public class AccessEvent
    extends java.lang.Object
    implements java.io.Serializable, IAccessEvent

The Access module's internal representation of logging events. When the logging component instance is called in the container to log then a `AccessEvent` instance is created. This instance is passed around to the different logback components.

Author:
  Ceki Gülcü, Sébastien Pennec
See Also:
  Serialized Form

### Field Summary

### Fields inherited from interface ch.qos.logback.access.spi.IAccessEvent

`NA, SENTINEL`

### Constructor Summary

Constructors
`AccessEvent​(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, ServerAdapter adapter)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `buildRequestHeaderMap()`
`void` `buildRequestParameterMap()`
`java.lang.String` `getAttribute​(java.lang.String key)`
`long` `getContentLength()`
`java.lang.String` `getCookie​(java.lang.String key)`
`long` `getElapsedSeconds()` The number of seconds elapsed between receiving the request and logging it.
`long` `getElapsedTime()` The time elapsed between receiving the request and logging it in milliseconds.
`int` `getLocalPort()`
`java.lang.String` `getMethod()`
`java.lang.String` `getProtocol()`
`java.lang.String` `getQueryString()`
`java.lang.String` `getRemoteAddr()`
`java.lang.String` `getRemoteHost()`
`java.lang.String` `getRemoteUser()`
`javax.servlet.http.HttpServletRequest` `getRequest()` Returns the underlying HttpServletRequest.
`java.lang.String` `getRequestContent()`
`java.lang.String` `getRequestHeader​(java.lang.String key)`
`java.util.Map<java.lang.String,​java.lang.String>` `getRequestHeaderMap()`
`java.util.Enumeration<java.lang.String>` `getRequestHeaderNames()`
`java.lang.String[]` `getRequestParameter​(java.lang.String key)`
`java.util.Map<java.lang.String,​java.lang.String[]>` `getRequestParameterMap()`
`java.lang.String` `getRequestURI()`
`java.lang.String` `getRequestURL()` The first line of the request.
`javax.servlet.http.HttpServletResponse` `getResponse()` Returns the underlying HttpServletResponse.
`java.lang.String` `getResponseContent()`
`java.lang.String` `getResponseHeader​(java.lang.String key)`
`java.util.Map<java.lang.String,​java.lang.String>` `getResponseHeaderMap()`
`java.util.List<java.lang.String>` `getResponseHeaderNameList()`
`ServerAdapter` `getServerAdapter()`
`java.lang.String` `getServerName()`
`java.lang.String` `getSessionID()`
`int` `getStatusCode()`
`java.lang.String` `getThreadName()`
`long` `getTimeStamp()` The number of milliseconds elapsed from 1/1/1970 until logging event was created.
`void` `prepareForDeferredProcessing()`
`void` `setThreadName​(java.lang.String threadName)`
`void` `setTimeStamp​(long timeStamp)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AccessEvent

    public AccessEvent​(javax.servlet.http.HttpServletRequest httpRequest,
                       javax.servlet.http.HttpServletResponse httpResponse,
                       ServerAdapter adapter)

### Method Detail

#### getRequest

    public javax.servlet.http.HttpServletRequest getRequest()

Returns the underlying HttpServletRequest. After serialization the returned value will be null.

Specified by:
  `getRequest` in interface `IAccessEvent`
Returns:

#### getResponse

    public javax.servlet.http.HttpServletResponse getResponse()

Returns the underlying HttpServletResponse. After serialization the returned value will be null.

Specified by:
  `getResponse` in interface `IAccessEvent`
Returns:

#### getTimeStamp

    public long getTimeStamp()

Description copied from interface: `IAccessEvent`
The number of milliseconds elapsed from 1/1/1970 until logging event was created.

Specified by:
  `getTimeStamp` in interface `IAccessEvent`

#### setTimeStamp

    public void setTimeStamp​(long timeStamp)

#### setThreadName

    public void setThreadName​(java.lang.String threadName)

Specified by:
  `setThreadName` in interface `IAccessEvent`
Parameters:
  `threadName` - The threadName to set.

#### getThreadName

    public java.lang.String getThreadName()

Specified by:
  `getThreadName` in interface `IAccessEvent`

#### getRequestURI

    public java.lang.String getRequestURI()

Specified by:
  `getRequestURI` in interface `IAccessEvent`

#### getQueryString

    public java.lang.String getQueryString()

Specified by:
  `getQueryString` in interface `IAccessEvent`

#### getRequestURL

    public java.lang.String getRequestURL()

The first line of the request.

Specified by:
  `getRequestURL` in interface `IAccessEvent`

#### getRemoteHost

    public java.lang.String getRemoteHost()

Specified by:
  `getRemoteHost` in interface `IAccessEvent`

#### getRemoteUser

    public java.lang.String getRemoteUser()

Specified by:
  `getRemoteUser` in interface `IAccessEvent`

#### getProtocol

    public java.lang.String getProtocol()

Specified by:
  `getProtocol` in interface `IAccessEvent`

#### getMethod

    public java.lang.String getMethod()

Specified by:
  `getMethod` in interface `IAccessEvent`

#### getSessionID

    public java.lang.String getSessionID()

Specified by:
  `getSessionID` in interface `IAccessEvent`

#### getServerName

    public java.lang.String getServerName()

Specified by:
  `getServerName` in interface `IAccessEvent`

#### getRemoteAddr

    public java.lang.String getRemoteAddr()

Specified by:
  `getRemoteAddr` in interface `IAccessEvent`

#### getRequestHeader

    public java.lang.String getRequestHeader​(java.lang.String key)

Specified by:
  `getRequestHeader` in interface `IAccessEvent`

#### getRequestHeaderNames

    public java.util.Enumeration<java.lang.String> getRequestHeaderNames()

Specified by:
  `getRequestHeaderNames` in interface `IAccessEvent`

#### getRequestHeaderMap

    public java.util.Map<java.lang.String,​java.lang.String> getRequestHeaderMap()

Specified by:
  `getRequestHeaderMap` in interface `IAccessEvent`

#### buildRequestHeaderMap

    public void buildRequestHeaderMap()

#### buildRequestParameterMap

    public void buildRequestParameterMap()

#### getRequestParameterMap

    public java.util.Map<java.lang.String,​java.lang.String[]> getRequestParameterMap()

Specified by:
  `getRequestParameterMap` in interface `IAccessEvent`

#### getAttribute

    public java.lang.String getAttribute​(java.lang.String key)

Specified by:
  `getAttribute` in interface `IAccessEvent`

#### getRequestParameter

    public java.lang.String[] getRequestParameter​(java.lang.String key)

Specified by:
  `getRequestParameter` in interface `IAccessEvent`

#### getCookie

    public java.lang.String getCookie​(java.lang.String key)

Specified by:
  `getCookie` in interface `IAccessEvent`

#### getContentLength

    public long getContentLength()

Specified by:
  `getContentLength` in interface `IAccessEvent`

#### getStatusCode

    public int getStatusCode()

Specified by:
  `getStatusCode` in interface `IAccessEvent`

#### getElapsedSeconds

    public long getElapsedSeconds()

Description copied from interface: `IAccessEvent`
The number of seconds elapsed between receiving the request and logging it.

Specified by:
  `getElapsedSeconds` in interface `IAccessEvent`

#### getElapsedTime

    public long getElapsedTime()

Description copied from interface: `IAccessEvent`
The time elapsed between receiving the request and logging it in milliseconds.

Specified by:
  `getElapsedTime` in interface `IAccessEvent`

#### getRequestContent

    public java.lang.String getRequestContent()

Specified by:
  `getRequestContent` in interface `IAccessEvent`

#### getResponseContent

    public java.lang.String getResponseContent()

Specified by:
  `getResponseContent` in interface `IAccessEvent`

#### getLocalPort

    public int getLocalPort()

Specified by:
  `getLocalPort` in interface `IAccessEvent`

#### getServerAdapter

    public ServerAdapter getServerAdapter()

Specified by:
  `getServerAdapter` in interface `IAccessEvent`

#### getResponseHeader

    public java.lang.String getResponseHeader​(java.lang.String key)

Specified by:
  `getResponseHeader` in interface `IAccessEvent`

#### getResponseHeaderMap

    public java.util.Map<java.lang.String,​java.lang.String> getResponseHeaderMap()

Specified by:
  `getResponseHeaderMap` in interface `IAccessEvent`

#### getResponseHeaderNameList

    public java.util.List<java.lang.String> getResponseHeaderNameList()

Specified by:
  `getResponseHeaderNameList` in interface `IAccessEvent`

#### prepareForDeferredProcessing

    public void prepareForDeferredProcessing()

Specified by:
  `prepareForDeferredProcessing` in interface `DeferredProcessingAware`