Package ch.qos.logback.access.sift

# Class AccessEventDiscriminator

java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.sift.AbstractDiscriminator<IAccessEvent>
ch.qos.logback.access.sift.AccessEventDiscriminator

All Implemented Interfaces:
  `Discriminator<IAccessEvent>`, `ContextAware`, `LifeCycle`

public class AccessEventDiscriminator extends AbstractDiscriminator<IAccessEvent>
AccessEventDiscriminator's job is to return the value of a designated field in an `IAccessEvent` instance.

The field is specified via the `AccessEventDiscriminator.FieldName` property.

Author:
  Ceki Gülcü

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`AccessEventDiscriminator.FieldName`
At present time the followed fields can be designated: COOKIE, REQUEST_ATTRIBUTE, SESSION_ATTRIBUTE, REMOTE_ADDRESS, LOCAL_PORT,REQUEST_URI

## Field Summary

### Fields inherited from class ch.qos.logback.core.sift.AbstractDiscriminator

`started`

### Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase

`context`

## Constructor Summary

Constructors
Constructor
Description
`AccessEventDiscriminator()`

## Method Summary

Modifier and Type
Method
Description
`String`
`getAdditionalKey()`
`String`
`getDefaultValue()`
`String`
`getDiscriminatingValue(IAccessEvent acccessEvent)`
Given event 'e' return a discriminating value.
`AccessEventDiscriminator.FieldName`
`getFieldName()`
`String`
`getKey()`
The key or variable name under which the discriminating value should be exported into the host environment.
`String`
`getRawDiscriminatingValue(IAccessEvent acccessEvent)`
`void`
`setAdditionalKey(String additionalKey)`
`void`
`setDefaultValue(String defaultValue)`
The default value returned by this discriminator in case it cannot compute the discriminating value from the access event.
`void`
`setFieldName(AccessEventDiscriminator.FieldName fieldName)`
`void`
`setKey(String key)`
`void`
`start()`

### Methods inherited from class ch.qos.logback.core.sift.AbstractDiscriminator

`isStarted, stop`

### Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase

`addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext`

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

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

## Constructor Details

### AccessEventDiscriminator

public AccessEventDiscriminator()

## Method Details

### getDiscriminatingValue

public String getDiscriminatingValue(IAccessEvent acccessEvent)
Description copied from interface: `Discriminator`
Given event 'e' return a discriminating value.

Returns:

### getRawDiscriminatingValue

public String getRawDiscriminatingValue(IAccessEvent acccessEvent)

### start

public void start()

Specified by:
  `start` in interface `LifeCycle`
Overrides:
  `start` in class `AbstractDiscriminator<IAccessEvent>`

### setFieldName

public void setFieldName(AccessEventDiscriminator.FieldName fieldName)

### getFieldName

public AccessEventDiscriminator.FieldName getFieldName()

### getAdditionalKey

public String getAdditionalKey()

### setAdditionalKey

public void setAdditionalKey(String additionalKey)

### getDefaultValue

public String getDefaultValue()

Returns:
See Also:
  - `setDefaultValue(String)`

### setDefaultValue

public void setDefaultValue(String defaultValue)
The default value returned by this discriminator in case it cannot compute the discriminating value from the access event.

Parameters:
  `defaultValue` -

### getKey

public String getKey()
Description copied from interface: `Discriminator`
The key or variable name under which the discriminating value should be exported into the host environment.

Returns:

### setKey

public void setKey(String key)