public class AuditEvent extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AuditEvent.EventType |
static class |
AuditEvent.Level |
static class |
AuditEvent.RequestType |
Modifier | Constructor and Description |
---|---|
protected |
AuditEvent() |
|
AuditEvent(AuditEvent.EventType eventType)
Empty event, must be filled by user using setters.
|
|
AuditEvent(AuditEvent.EventType eventType,
javax.servlet.http.HttpServletRequest httpRequest) |
|
AuditEvent(AuditEvent.EventType eventType,
javax.servlet.http.HttpServletRequest httpRequest,
AuthorizationContext authorizationContext)
Event based on request and AuthorizationContext.
|
|
AuditEvent(AuditEvent.EventType eventType,
javax.servlet.http.HttpServletRequest httpRequest,
AuthorizationContext authorizationContext,
double qTime,
Throwable exception)
Event to log completed requests.
|
|
AuditEvent(AuditEvent.EventType eventType,
Throwable exception,
javax.servlet.http.HttpServletRequest httpRequest)
Event based on an HttpServletRequest, typically used during authentication.
|
Modifier and Type | Method and Description |
---|---|
AuthorizationResponse |
getAutResponse()
The authorization response object from authorization plugin, or null authz has not happened
|
String |
getBaseUrl()
First part of URL of the request, but not including request parameters, or null if not set
|
String |
getClientIp()
IP address of the client doing the request
|
List<String> |
getCollections()
List of collection names involved in request
|
Map<String,Object> |
getContext()
A general purpose context map with potential extra information about the event
|
Date |
getDate()
Date that the event happened
|
AuditEvent.EventType |
getEventType()
EventType tells the outcome of the event such as REJECTED, UNAUTHORIZED or ERROR
|
Throwable |
getException()
In case of ERROR event, find the exception causing the error
|
Map<String,String> |
getHeaders()
Map of all HTTP request headers belonging to the request
|
String |
getHttpMethod()
The HTTP method.
|
String |
getHttpQueryString()
Query part of URL or null if query part
|
AuditEvent.Level |
getLevel()
Level of this event.
|
String |
getMessage()
The human readable message about this event
|
String |
getNodeName()
Node name of Solr node, on the internal format host:port_context, e.g.
|
double |
getQTime()
Request time in milliseconds for completed requests
|
AuditEvent.RequestType |
getRequestType()
Determines the type of request.
|
StringBuffer |
getRequestUrl()
Deprecated.
Please use
getBaseUrl() instead |
String |
getResource()
Identifies the resource being operated on.
|
String |
getSession()
Session identifier
|
String |
getSolrHost()
Host name of the Solr node logging the event
|
String |
getSolrIp()
IP address of the Solr node logging the event
|
String |
getSolrParamAsString(String key)
Gets first value of a certain Solr request parameter
|
Map<String,List<String>> |
getSolrParams()
Map of all Solr request parameters attached to the request.
|
int |
getSolrPort()
Port number of the Solr node logging the event
|
int |
getStatus()
HTTP status code of event, i.e.
|
String |
getUrl()
Full URL of the original request.
|
String |
getUsername()
Username of logged in user, or null if no authenticated user
|
protected String |
normalizeResourcePath(String resourcePath) |
AuditEvent |
setAutResponse(AuthorizationResponse autResponse) |
AuditEvent |
setBaseUrl(String baseUrl) |
AuditEvent |
setClientIp(String clientIp) |
AuditEvent |
setCollections(List<String> collections) |
AuditEvent |
setContext(Map<String,Object> context) |
AuditEvent |
setContextEntry(String key,
Object value) |
AuditEvent |
setDate(Date date) |
AuditEvent |
setException(Throwable exception) |
AuditEvent |
setHeaders(Map<String,String> headers) |
AuditEvent |
setHttpMethod(String httpMethod) |
AuditEvent |
setHttpQueryString(String httpQueryString) |
AuditEvent |
setLevel(AuditEvent.Level level) |
AuditEvent |
setMessage(String message) |
AuditEvent |
setQTime(double qTime) |
AuditEvent |
setRequestType(AuditEvent.RequestType requestType) |
AuditEvent |
setResource(String resource) |
AuditEvent |
setSession(String session) |
AuditEvent |
setSolrHost(String solrHost) |
AuditEvent |
setSolrIp(String solrIp) |
AuditEvent |
setSolrParams(Map<String,List<String>> solrParams) |
AuditEvent |
setSolrPort(int solrPort) |
AuditEvent |
setStatus(int status) |
AuditEvent |
setUsername(String username) |
public AuditEvent(AuditEvent.EventType eventType)
eventType
- a predefined or custom EventTypepublic AuditEvent(AuditEvent.EventType eventType, javax.servlet.http.HttpServletRequest httpRequest)
protected AuditEvent()
public AuditEvent(AuditEvent.EventType eventType, Throwable exception, javax.servlet.http.HttpServletRequest httpRequest)
eventType
- a predefined or custom EventTypehttpRequest
- the request to initialize frompublic AuditEvent(AuditEvent.EventType eventType, javax.servlet.http.HttpServletRequest httpRequest, AuthorizationContext authorizationContext)
eventType
- a predefined or custom EventTypehttpRequest
- the request to initialize fromauthorizationContext
- the context to initialize frompublic AuditEvent(AuditEvent.EventType eventType, javax.servlet.http.HttpServletRequest httpRequest, AuthorizationContext authorizationContext, double qTime, Throwable exception)
eventType
- a predefined or custom EventTypehttpRequest
- the request to initialize fromauthorizationContext
- the context to initialize fromqTime
- query timeexception
- exception from query response, or null if OKpublic String getMessage()
public AuditEvent.Level getLevel()
AuditEvent.Level
enumpublic Date getDate()
public String getUsername()
public String getSession()
public String getClientIp()
public Map<String,Object> getContext()
public String getResource()
public String getHttpMethod()
public String getHttpQueryString()
public AuditEvent.EventType getEventType()
AuditEvent.EventType
enumpublic String getSolrHost()
public String getSolrIp()
public int getSolrPort()
public Map<String,String> getHeaders()
public Map<String,List<String>> getSolrParams()
public String getSolrParamAsString(String key)
key
- name of request parameter to retrievepublic AuthorizationResponse getAutResponse()
public String getNodeName()
public AuditEvent.RequestType getRequestType()
AuditEvent.RequestType
enumpublic int getStatus()
public double getQTime()
public Throwable getException()
@Deprecated public StringBuffer getRequestUrl()
getBaseUrl()
insteadpublic String getUrl()
baseUrl
+ "?" + httpQueryString
.
Returns null if not setpublic String getBaseUrl()
public AuditEvent setBaseUrl(String baseUrl)
public AuditEvent setSession(String session)
public AuditEvent setClientIp(String clientIp)
public AuditEvent setContext(Map<String,Object> context)
public AuditEvent setContextEntry(String key, Object value)
public AuditEvent setMessage(String message)
public AuditEvent setLevel(AuditEvent.Level level)
public AuditEvent setDate(Date date)
public AuditEvent setUsername(String username)
public AuditEvent setCollections(List<String> collections)
public AuditEvent setResource(String resource)
public AuditEvent setHttpMethod(String httpMethod)
public AuditEvent setHttpQueryString(String httpQueryString)
public AuditEvent setSolrHost(String solrHost)
public AuditEvent setSolrPort(int solrPort)
public AuditEvent setSolrIp(String solrIp)
public AuditEvent setHeaders(Map<String,String> headers)
public AuditEvent setSolrParams(Map<String,List<String>> solrParams)
public AuditEvent setAutResponse(AuthorizationResponse autResponse)
public AuditEvent setRequestType(AuditEvent.RequestType requestType)
public AuditEvent setQTime(double qTime)
public AuditEvent setStatus(int status)
public AuditEvent setException(Throwable exception)
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.