Class AuditLogger
java.lang.Object
com.sap.cloud.sdk.cloudplatform.auditlog.AuditLogger
Main class of the audit log functionality.
This class handles all logging request by delegating the calls to the AuditLog implementation given by the
AuditLogFacade.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AuditLogReturns theAuditLog.static AuditLogFacadeReturns theAuditLogFacadeinstance.static voidlogConfigChange(AccessRequester initiator, AuditedDataObject object, Throwable error, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the change of some attributes of configuration data.static voidlogConfigChange(AuditedDataObject object, Throwable error, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the change of some attributes of configuration data by the current request.static voidlogConfigChangeBeginning(AccessRequester initiator, AuditedDataObject object, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the start of a change of some attributes of configuration data.static voidlogConfigChangeBeginning(AuditedDataObject object, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the start of a change of some attributes of configuration data by the current request.static voidlogDataRead(AccessRequester initiator, AuditedDataObject object, AuditedDataSubject subject, Throwable error, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the read access to some attributes of an object.static voidlogDataRead(AuditedDataObject object, AuditedDataSubject subject, Throwable error, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the read access to some attributes of an object by the current request.static voidlogDataReadAttempt(AccessRequester initiator, AuditedDataObject object, AuditedDataSubject subject, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the attempt to read some attributes from an object.static voidlogDataReadAttempt(AuditedDataObject object, AuditedDataSubject subject, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the attempt to read some attributes from an object by the current request.static voidlogDataWrite(AccessRequester initiator, AuditedDataObject object, AuditedDataSubject subject, Throwable error, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the modification of some attributes of an object.static voidlogDataWrite(AuditedDataObject object, AuditedDataSubject subject, Throwable error, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the modification of some attributes of an object by the current request.static voidlogDataWriteAttempt(AccessRequester initiator, AuditedDataObject object, AuditedDataSubject subject, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the attempt to write to some attributes of an object.static voidlogDataWriteAttempt(AuditedDataObject object, AuditedDataSubject subject, AccessedAttribute attributeAffected, AccessedAttribute... attributesAffected) Logs the attempt to write to some attributes of an object by the current request.static voidlogSecurityEvent(AccessRequester initiator, String message, Throwable throwable) Logs a generic security event.static voidlogSecurityEvent(String message, Throwable throwable) Logs a generic security event by the current request.static voidlogSecurityEventBeginning(AccessRequester initiator, String message) Logs the start of a generic security event.static voidlogSecurityEventBeginning(String message) Logs the start of a generic security event by the current request.static voidsetAuditLogFacade(AuditLogFacade auditLogFacade) Replaces the defaultAuditLogFacadeinstance.static io.vavr.control.Try<AuditLog>Returns aTryof theAuditLog.static io.vavr.control.Try<AuditLogFacade>Returns aTryof theAuditLogFacadeinstance.
-
Constructor Details
-
AuditLogger
public AuditLogger()
-
-
Method Details
-
getAuditLogFacade
Returns theAuditLogFacadeinstance. For internal use only.- Returns:
- The
AuditLogFacadeinstance, ornull.
-
tryGetAuditLogFacade
Returns aTryof theAuditLogFacadeinstance. For internal use only.- Returns:
- A
Tryof theAuditLogFacadeinstance.
-
setAuditLogFacade
Replaces the defaultAuditLogFacadeinstance. This method is for internal use only.- Parameters:
auditLogFacade- An instance ofAuditLogFacade.
-
getAuditLog
Returns theAuditLog.- Returns:
- The
AuditLog. - Throws:
AuditLogAccessException- If there is an issue while accessing theAuditLog.
-
tryGetAuditLog
Returns aTryof theAuditLog.- Returns:
- A
Tryof theAuditLog.
-
logSecurityEventBeginning
public static void logSecurityEventBeginning(@Nonnull AccessRequester initiator, @Nullable String message) throws AuditLogAccessException Logs the start of a generic security event.- Parameters:
initiator- Information about the user that starts performing the security event.message- Descriptive log message.- Throws:
AuditLogAccessException- If there is an issue while accessing theAuditLog.
-
logSecurityEventBeginning
Logs the start of a generic security event by the current request.- Parameters:
message- Descriptive log message.
-
logSecurityEvent
public static void logSecurityEvent(@Nonnull AccessRequester initiator, @Nullable String message, @Nullable Throwable throwable) Logs a generic security event.- Parameters:
initiator- Information about the user that performed the security event.message- Descriptive log message.throwable- The exception in case of an error.
-
logSecurityEvent
Logs a generic security event by the current request.- Parameters:
message- Descriptive log message.throwable- The exception in case of an error.
-
logConfigChangeBeginning
public static void logConfigChangeBeginning(@Nonnull AccessRequester initiator, @Nonnull AuditedDataObject object, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the start of a change of some attributes of configuration data.- Parameters:
initiator- Information about the user starting to modify the configuration.object- An instance ofAuditedDataObjectthat represents the object that will be modified.attributeAffected- An attribute that will be changed.attributesAffected- An arbitrary number of attributes that will be changed.
-
logConfigChangeBeginning
public static void logConfigChangeBeginning(@Nonnull AuditedDataObject object, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the start of a change of some attributes of configuration data by the current request.- Parameters:
object- An instance ofAuditedDataObjectthat represents the object that will be modified.attributeAffected- An attribute that will be changed.attributesAffected- An arbitrary number of attributes that will be changed.
-
logConfigChange
public static void logConfigChange(@Nonnull AccessRequester initiator, @Nonnull AuditedDataObject object, @Nullable Throwable error, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the change of some attributes of configuration data.- Parameters:
initiator- Information about the user modifying the configuration.object- An instance ofAuditedDataObjectthat represents the object that has been modified.error- The exception in case of an error.attributeAffected- An attribute that has been changed.attributesAffected- An arbitrary number of attributes that have been changed.
-
logConfigChange
public static void logConfigChange(@Nonnull AuditedDataObject object, @Nullable Throwable error, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the change of some attributes of configuration data by the current request.- Parameters:
object- An instance ofAuditedDataObjectthat represents the object that has been modified.error- The exception in case of an error.attributeAffected- An attribute that has been changed.attributesAffected- An arbitrary number of attributes that have been changed.
-
logDataReadAttempt
public static void logDataReadAttempt(@Nonnull AccessRequester initiator, @Nonnull AuditedDataObject object, @Nonnull AuditedDataSubject subject, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the attempt to read some attributes from an object.- Parameters:
initiator- Information about the user trying to the read the attributes.object- An instance ofAuditedDataObjectthat represents the object to be read.subject- An instance ofAuditedDataSubjectthat represents the owner of the data to be read.attributeAffected- An attribute that should be read.attributesAffected- An arbitrary number of attributes that should be read.
-
logDataReadAttempt
public static void logDataReadAttempt(@Nonnull AuditedDataObject object, @Nonnull AuditedDataSubject subject, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the attempt to read some attributes from an object by the current request.- Parameters:
object- An instance ofAuditedDataObjectthat represents the object to be read.subject- An instance ofAuditedDataSubjectthat represents the owner of the data to be read.attributeAffected- An attribute that should be read.attributesAffected- An arbitrary number of attributes that should be read.
-
logDataRead
public static void logDataRead(@Nonnull AccessRequester initiator, @Nonnull AuditedDataObject object, @Nonnull AuditedDataSubject subject, @Nullable Throwable error, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the read access to some attributes of an object.- Parameters:
initiator- Information about the user reading the attributes.object- An instance ofAuditedDataObjectthat represents the object that has been read.subject- An instance ofAuditedDataSubjectthat represents the owner of the data that has been read.error- The exception in case of an error.attributeAffected- An attribute that has been read.attributesAffected- An arbitrary number of attributes that have been read.
-
logDataRead
public static void logDataRead(@Nonnull AuditedDataObject object, @Nonnull AuditedDataSubject subject, @Nullable Throwable error, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the read access to some attributes of an object by the current request.- Parameters:
object- An instance ofAuditedDataObjectthat represents the object that has been read.subject- An instance ofAuditedDataSubjectthat represents the owner of the data that has been read.error- The exception in case of an error.attributeAffected- An attribute that has been read.attributesAffected- An arbitrary number of attributes that have been read.
-
logDataWriteAttempt
public static void logDataWriteAttempt(@Nonnull AccessRequester initiator, @Nonnull AuditedDataObject object, @Nonnull AuditedDataSubject subject, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the attempt to write to some attributes of an object.- Parameters:
initiator- Information about the user trying to write to some attributes.object- An instance ofAuditedDataObjectthat represents the object that is about to be modified.subject- An instance ofAuditedDataSubjectthat represents the owner of the data that is about to be modified.attributeAffected- An attribute that should be modified, containing the old and new value.attributesAffected- An arbitrary number of attributes that should be modified, containing the old and new values.
-
logDataWriteAttempt
public static void logDataWriteAttempt(@Nonnull AuditedDataObject object, @Nonnull AuditedDataSubject subject, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the attempt to write to some attributes of an object by the current request.- Parameters:
object- An instance ofAuditedDataObjectthat represents the object that is about to be modified.subject- An instance ofAuditedDataSubjectthat represents the owner of the data that is about to be modified.attributeAffected- An attribute that should be modified, containing the old and new value.attributesAffected- An arbitrary number of attributes that should be modified, containing the old and new values.
-
logDataWrite
public static void logDataWrite(@Nonnull AccessRequester initiator, @Nonnull AuditedDataObject object, @Nonnull AuditedDataSubject subject, @Nullable Throwable error, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the modification of some attributes of an object.- Parameters:
initiator- Information about the user changing the attributes.object- An instance ofAuditedDataObjectthat represents the object that has been modified.subject- An instance ofAuditedDataSubjectthat represents the owner of the data that has been modified.error- The exception in case of an error.attributeAffected- An attribute that has been modified, containing the old and new value.attributesAffected- An arbitrary number of attributes that have been modified, containing the old and new values.
-
logDataWrite
public static void logDataWrite(@Nonnull AuditedDataObject object, @Nonnull AuditedDataSubject subject, @Nullable Throwable error, @Nonnull AccessedAttribute attributeAffected, @Nullable AccessedAttribute... attributesAffected) Logs the modification of some attributes of an object by the current request.- Parameters:
object- An instance ofAuditedDataObjectthat represents the object that has been modified.subject- An instance ofAuditedDataSubjectthat represents the owner of the data that has been modified.error- The exception in case of an error.attributeAffected- An attribute that has been modified, containing the old and new value.attributesAffected- An arbitrary number of attributes that have been modified, containing the old and new values.
-