Class AccessRequester
java.lang.Object
com.sap.cloud.sdk.cloudplatform.auditlog.AccessRequester
Represents the requester of an access to an object in the context of an audit log.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault user Id, used in case of an unknown remote user.static final AccessRequesterField representing an unknown requester. -
Constructor Summary
ConstructorsConstructorDescriptionAccessRequester(String tenantId, String principalId, String ipAddress, String channel) AccessRequester(javax.servlet.http.HttpServletRequest request) Creates an AccessRequester based on the given request.AccessRequester(javax.servlet.http.HttpServletRequest request, Tenant tenant) Creates an AccessRequester based on the given request and tenant. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanio.vavr.control.Option<String>The connection channel used, e.g.io.vavr.control.Option<String>The IP address of the remote user requesting access.io.vavr.control.Option<String>The Id of the remote user requesting access.io.vavr.control.Option<String>The tenant or zone Id of the remote user requesting access.inthashCode()static AccessRequesterof(javax.servlet.http.HttpServletRequest request) Creates a request based on the given, nullable request.static AccessRequesterCreates a request based on the given, nullable request and tenant.static AccessRequesterCreates a request based on the current request.static AccessRequesterofJakarta(jakarta.servlet.http.HttpServletRequest request) Creates a request based on the given, nullable request.static AccessRequesterCreates a request based on the given, nullable request.toString()
-
Field Details
-
UNKNOWN
Field representing an unknown requester. -
UNAUTHENTICATED_USER
Default user Id, used in case of an unknown remote user.- See Also:
-
-
Constructor Details
-
AccessRequester
public AccessRequester(@Nonnull javax.servlet.http.HttpServletRequest request) Creates an AccessRequester based on the given request.- Parameters:
request- The request which tries to access an object.
-
AccessRequester
public AccessRequester(@Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull Tenant tenant) Creates an AccessRequester based on the given request and tenant.- Parameters:
request- The request which tries to access an object.tenant- The tenant which tries to access an object.
-
AccessRequester
-
-
Method Details
-
getPrincipalId
The Id of the remote user requesting access.- Returns:
- An
Optioncontaining the user Id.
-
getTenantId
The tenant or zone Id of the remote user requesting access.- Returns:
- An
Optioncontaining the tenant or zone Id.
-
getIpAddress
The IP address of the remote user requesting access.- Returns:
- An
Optioncontaining the IP address.
-
getChannel
The connection channel used, e.g. http, or https.- Returns:
- An
Optioncontaining the connection channel.
-
of
Creates a request based on the given, nullable request.- Parameters:
request- The request which tries to access an object.- Returns:
- An AccessRequester for the given request. Never
null.
-
of
@Nonnull public static AccessRequester of(@Nullable javax.servlet.http.HttpServletRequest request, @Nullable Tenant tenant) Creates a request based on the given, nullable request and tenant.- Parameters:
request- The request which tries to access an object.tenant- The tenant which tries to access an object.- Returns:
- An AccessRequester for the given request. Never
null.
-
ofJakarta
@Nonnull public static AccessRequester ofJakarta(@Nullable jakarta.servlet.http.HttpServletRequest request) Creates a request based on the given, nullable request.- Parameters:
request- The request which tries to access an object.- Returns:
- An AccessRequester for the given request. Never
null.
-
ofJakarta
@Nonnull public static AccessRequester ofJakarta(@Nullable jakarta.servlet.http.HttpServletRequest req, @Nullable Tenant tenant) Creates a request based on the given, nullable request.- Parameters:
req- The request which tries to access an object.tenant- The tenant which tries to access an object.- Returns:
- An AccessRequester for the given request. Never
null.
-
ofCurrentRequest
Creates a request based on the current request.- Returns:
- An AccessRequester for the current request. Never
null.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-