public class AccessRequester extends Object
Therefore this class stores identifiable information of the requester. Information about the field accessed as well
as about the access time are handled in the implementation of the AuditLog
interface.
Modifier and Type | Field and Description |
---|---|
static String |
UNAUTHENTICATED_USER
Default user Id, used in case of an unknown remote user.
|
static AccessRequester |
UNKNOWN
Null-Object representing an unknown requester.
|
Constructor and Description |
---|
AccessRequester(javax.servlet.http.HttpServletRequest request)
Creates an AccessRequester based on the given request.
|
AccessRequester(String userId,
String ipAddress,
String channel) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
com.google.common.base.Optional<String> |
getChannel()
The connection channel used, e.g. http, or https.
|
com.google.common.base.Optional<String> |
getIpAddress()
The IP address of the remote user requesting access to an attribute.
|
com.google.common.base.Optional<String> |
getUserId()
The Id of the remote user requesting access to an attribute.
|
int |
hashCode() |
static AccessRequester |
of(javax.servlet.http.HttpServletRequest request)
Creates a request based on the given, nullable request.
|
static AccessRequester |
ofCurrentRequest()
Creates a request based on the current request.
|
String |
toString() |
public static final AccessRequester UNKNOWN
public static final String UNAUTHENTICATED_USER
public AccessRequester(@NonNull javax.servlet.http.HttpServletRequest request)
request
- The request which tries to access an attribute.public com.google.common.base.Optional<String> getUserId()
Optional
containing the user Id.public com.google.common.base.Optional<String> getIpAddress()
Optional
containing the IP address.public com.google.common.base.Optional<String> getChannel()
Optional
containing the connection channel.@Nullable public static AccessRequester of(@Nullable javax.servlet.http.HttpServletRequest request)
request
- The request which tries to access an attribute.null
.@Nullable public static AccessRequester ofCurrentRequest()
null
.Copyright © 2018 SAP SE. All rights reserved.