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 AuditLogManager
instance
static java.lang.String
MBEAN_NAME
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
authFailure(QueryState state, java.lang.Exception cause)
void
authSuccess(QueryState state)
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)
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)
void
disableAuditLog()
Disables AuditLog, designed to be invoked only via JMX/ Nodetool, not from anywhere else in the codepath.void
enable(AuditLogOptions auditLogOptions)
Enables AuditLog, designed to be invoked only via JMX/ Nodetool, not from anywhere else in the codepath.void
executeFailure(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, java.lang.Exception cause)
void
executeSuccess(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, long queryTime, Message.Response response)
AuditLogOptions
getAuditLogOptions()
javax.management.openmbean.CompositeData
getAuditLogOptionsData()
Returns the current state of Audit Log framework.IAuditLogger
getLogger()
void
initialize()
boolean
isEnabled()
void
prepareFailure(CQLStatement stmt, java.lang.String query, QueryState state, java.lang.Exception cause)
void
prepareSuccess(CQLStatement statement, java.lang.String query, QueryState state, long queryTime, ResultMessage.Prepared response)
void
queryFailure(CQLStatement stmt, java.lang.String query, QueryOptions options, QueryState state, java.lang.Exception cause)
void
querySuccess(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:AuditLogManagerMBean
Returns the current state of Audit Log framework.- Specified by:
getAuditLogOptionsData
in 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:
querySuccess
in interfaceQueryEvents.Listener
-
queryFailure
public void queryFailure(CQLStatement stmt, java.lang.String query, QueryOptions options, QueryState state, java.lang.Exception cause)
- Specified by:
queryFailure
in interfaceQueryEvents.Listener
-
executeSuccess
public void executeSuccess(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, long queryTime, Message.Response response)
- Specified by:
executeSuccess
in interfaceQueryEvents.Listener
-
executeFailure
public void executeFailure(CQLStatement statement, java.lang.String query, QueryOptions options, QueryState state, java.lang.Exception cause)
- Specified by:
executeFailure
in 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:
batchSuccess
in 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:
batchFailure
in interfaceQueryEvents.Listener
-
prepareSuccess
public void prepareSuccess(CQLStatement statement, java.lang.String query, QueryState state, long queryTime, ResultMessage.Prepared response)
- Specified by:
prepareSuccess
in interfaceQueryEvents.Listener
-
prepareFailure
public void prepareFailure(@Nullable CQLStatement stmt, @Nullable java.lang.String query, QueryState state, java.lang.Exception cause)
- Specified by:
prepareFailure
in interfaceQueryEvents.Listener
-
authSuccess
public void authSuccess(QueryState state)
- Specified by:
authSuccess
in interfaceAuthEvents.Listener
-
authFailure
public void authFailure(QueryState state, java.lang.Exception cause)
- Specified by:
authFailure
in interfaceAuthEvents.Listener
-
-