Package ch.qos.logback.access.spi

# Class AccessEvent

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

All Implemented Interfaces:
  `IAccessEvent`, `DeferredProcessingAware`, `Serializable`

public class AccessEvent extends Object implements 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
Constructor
Description
`AccessEvent(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, ServerAdapter adapter)`

## Method Summary

Modifier and Type
Method
Description
`void`
`buildRequestHeaderMap()`
`void`
`buildRequestParameterMap()`
`String`
`getAttribute(String key)`
`long`
`getContentLength()`
`String`
`getCookie(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()`
`String`
`getMethod()`
`String`
`getProtocol()`
`String`
`getQueryString()`
`String`
`getRemoteAddr()`
`String`
`getRemoteHost()`
`String`
`getRemoteUser()`
`javax.servlet.http.HttpServletRequest`
`getRequest()`
Returns the underlying HttpServletRequest.
`String`
`getRequestContent()`
`String`
`getRequestHeader(String key)`
`Map<String,String>`
`getRequestHeaderMap()`
`Enumeration<String>`
`getRequestHeaderNames()`
`String[]`
`getRequestParameter(String key)`
`Map<String,String[]>`
`getRequestParameterMap()`
`String`
`getRequestURI()`
`String`
`getRequestURL()`
The first line of the request.
`javax.servlet.http.HttpServletResponse`
`getResponse()`
Returns the underlying HttpServletResponse.
`String`
`getResponseContent()`
`String`
`getResponseHeader(String key)`
`Map<String,String>`
`getResponseHeaderMap()`
`List<String>`
`getResponseHeaderNameList()`
`ServerAdapter`
`getServerAdapter()`
`String`
`getServerName()`
`String`
`getSessionID()`
`int`
`getStatusCode()`
`String`
`getThreadName()`
`long`
`getTimeStamp()`
The number of milliseconds elapsed from 1/1/1970 until logging event was created.
`void`
`prepareForDeferredProcessing()`
`void`
`setThreadName(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 Details

### AccessEvent

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

## Method Details

### 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(String threadName)

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

### getThreadName

public String getThreadName()

Specified by:
  `getThreadName` in interface `IAccessEvent`

### getRequestURI

public String getRequestURI()

Specified by:
  `getRequestURI` in interface `IAccessEvent`

### getQueryString

public String getQueryString()

Specified by:
  `getQueryString` in interface `IAccessEvent`

### getRequestURL

public String getRequestURL()
The first line of the request.

Specified by:
  `getRequestURL` in interface `IAccessEvent`

### getRemoteHost

public String getRemoteHost()

Specified by:
  `getRemoteHost` in interface `IAccessEvent`

### getRemoteUser

public String getRemoteUser()

Specified by:
  `getRemoteUser` in interface `IAccessEvent`

### getProtocol

public String getProtocol()

Specified by:
  `getProtocol` in interface `IAccessEvent`

### getMethod

public String getMethod()

Specified by:
  `getMethod` in interface `IAccessEvent`

### getSessionID

public String getSessionID()

Specified by:
  `getSessionID` in interface `IAccessEvent`

### getServerName

public String getServerName()

Specified by:
  `getServerName` in interface `IAccessEvent`

### getRemoteAddr

public String getRemoteAddr()

Specified by:
  `getRemoteAddr` in interface `IAccessEvent`

### getRequestHeader

public String getRequestHeader(String key)

Specified by:
  `getRequestHeader` in interface `IAccessEvent`

### getRequestHeaderNames

public Enumeration<String> getRequestHeaderNames()

Specified by:
  `getRequestHeaderNames` in interface `IAccessEvent`

### getRequestHeaderMap

public Map<String,String> getRequestHeaderMap()

Specified by:
  `getRequestHeaderMap` in interface `IAccessEvent`

### buildRequestHeaderMap

public void buildRequestHeaderMap()

### buildRequestParameterMap

public void buildRequestParameterMap()

### getRequestParameterMap

public Map<String,String[]> getRequestParameterMap()

Specified by:
  `getRequestParameterMap` in interface `IAccessEvent`

### getAttribute

public String getAttribute(String key)

Specified by:
  `getAttribute` in interface `IAccessEvent`

### getRequestParameter

public String[] getRequestParameter(String key)

Specified by:
  `getRequestParameter` in interface `IAccessEvent`

### getCookie

public String getCookie(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 String getRequestContent()

Specified by:
  `getRequestContent` in interface `IAccessEvent`

### getResponseContent

public 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 String getResponseHeader(String key)

Specified by:
  `getResponseHeader` in interface `IAccessEvent`

### getResponseHeaderMap

public Map<String,String> getResponseHeaderMap()

Specified by:
  `getResponseHeaderMap` in interface `IAccessEvent`

### getResponseHeaderNameList

public List<String> getResponseHeaderNameList()

Specified by:
  `getResponseHeaderNameList` in interface `IAccessEvent`

### prepareForDeferredProcessing

public void prepareForDeferredProcessing()

Specified by:
  `prepareForDeferredProcessing` in interface `DeferredProcessingAware`