Package org.apache.cassandra.audit
Class AuditLogManager
- java.lang.Object
-
- org.apache.cassandra.audit.AuditLogManager
-
- All Implemented Interfaces:
AuditLogManagerMBean,AuthEvents.Listener,QueryEvents.Listener
public class AuditLogManager extends java.lang.Object implements QueryEvents.Listener, AuthEvents.Listener, AuditLogManagerMBean
Central location for managing the logging of client/user-initated actions (like queries, log in commands, and so on).
-
-
Field Summary
Fields Modifier and Type Field Description static AuditLogManagerinstancestatic java.lang.StringMBEAN_NAME
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthFailure(QueryState state, java.lang.Exception cause)voidauthSuccess(QueryState state)voidbatchFailure(BatchStatement.Type batchType, java.util.List<? extends CQLStatement> statements, java.util.List<java.lang.String> queries, java.util.List<java.util.List<java.nio.ByteBuffer>> values, QueryOptions options, QueryState state, java.lang.Exception cause)voidbatchSuccess(BatchStatement.Type batchType, java.util.List<? extends CQLStatement> statements, java.util.List<java.lang.String> queries, java.util.List<java.util.List<java.nio.ByteBuffer>> values, QueryOptions options, QueryState state, long queryTime, Message.Response response)voiddisableAuditLog()Disables AuditLog, designed to be invoked only via JMX/ Nodetool, not from anywhere else in the codepath.voidenable(AuditLogOptions auditLogOptions)Enables AuditLog, designed to be invoked only via JMX/ Nodetool, not from anywhere else in the codepath.voidexecuteFailure(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, java.lang.Exception cause)voidexecuteSuccess(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, long queryTime, Message.Response response)AuditLogOptionsgetAuditLogOptions()javax.management.openmbean.CompositeDatagetAuditLogOptionsData()Returns the current state of Audit Log framework.IAuditLoggergetLogger()voidinitialize()booleanisEnabled()voidprepareFailure(CQLStatement stmt, java.lang.String query, QueryState state, java.lang.Exception cause)voidprepareSuccess(CQLStatement statement, java.lang.String query, QueryState state, long queryTime, ResultMessage.Prepared response)voidqueryFailure(CQLStatement stmt, java.lang.String query, QueryOptions options, QueryState state, java.lang.Exception cause)voidquerySuccess(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, long queryTime, Message.Response response)
-
-
-
Field Detail
-
MBEAN_NAME
public static final java.lang.String MBEAN_NAME
- See Also:
- Constant Field Values
-
instance
public static final AuditLogManager instance
-
-
Method Detail
-
initialize
public void initialize()
-
getLogger
public IAuditLogger getLogger()
-
isEnabled
public boolean isEnabled()
-
getAuditLogOptions
public AuditLogOptions getAuditLogOptions()
-
getAuditLogOptionsData
public javax.management.openmbean.CompositeData getAuditLogOptionsData()
Description copied from interface:AuditLogManagerMBeanReturns the current state of Audit Log framework.- Specified by:
getAuditLogOptionsDatain interfaceAuditLogManagerMBean
-
disableAuditLog
public void disableAuditLog()
Disables AuditLog, designed to be invoked only via JMX/ Nodetool, not from anywhere else in the codepath.
-
enable
public void enable(AuditLogOptions auditLogOptions) throws ConfigurationException
Enables AuditLog, designed to be invoked only via JMX/ Nodetool, not from anywhere else in the codepath.- Parameters:
auditLogOptions- AuditLogOptions to be used for enabling AuditLog- Throws:
ConfigurationException- It can throw configuration exception when provided logger class does not exist in the classpath
-
querySuccess
public void querySuccess(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, long queryTime, Message.Response response)
- Specified by:
querySuccessin interfaceQueryEvents.Listener
-
queryFailure
public void queryFailure(CQLStatement stmt, java.lang.String query, QueryOptions options, QueryState state, java.lang.Exception cause)
- Specified by:
queryFailurein interfaceQueryEvents.Listener
-
executeSuccess
public void executeSuccess(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, long queryTime, Message.Response response)
- Specified by:
executeSuccessin interfaceQueryEvents.Listener
-
executeFailure
public void executeFailure(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, java.lang.Exception cause)
- Specified by:
executeFailurein interfaceQueryEvents.Listener
-
batchSuccess
public void batchSuccess(BatchStatement.Type batchType, java.util.List<? extends CQLStatement> statements, java.util.List<java.lang.String> queries, java.util.List<java.util.List<java.nio.ByteBuffer>> values, QueryOptions options, QueryState state, long queryTime, Message.Response response)
- Specified by:
batchSuccessin interfaceQueryEvents.Listener
-
batchFailure
public void batchFailure(BatchStatement.Type batchType, java.util.List<? extends CQLStatement> statements, java.util.List<java.lang.String> queries, java.util.List<java.util.List<java.nio.ByteBuffer>> values, QueryOptions options, QueryState state, java.lang.Exception cause)
- Specified by:
batchFailurein interfaceQueryEvents.Listener
-
prepareSuccess
public void prepareSuccess(CQLStatement statement, java.lang.String query, QueryState state, long queryTime, ResultMessage.Prepared response)
- Specified by:
prepareSuccessin interfaceQueryEvents.Listener
-
prepareFailure
public void prepareFailure(@Nullable CQLStatement stmt, @Nullable java.lang.String query, QueryState state, java.lang.Exception cause)- Specified by:
prepareFailurein interfaceQueryEvents.Listener
-
authSuccess
public void authSuccess(QueryState state)
- Specified by:
authSuccessin interfaceAuthEvents.Listener
-
authFailure
public void authFailure(QueryState state, java.lang.Exception cause)
- Specified by:
authFailurein interfaceAuthEvents.Listener
-
-