use of org.apache.cassandra.audit.AuditLogContext in project cassandra by apache.
the class SchemaAnnouncementEvent method toMap.
public Map<String, Serializable> toMap() {
HashMap<String, Serializable> ret = new HashMap<>();
if (schemaDestinationEndpoints != null) {
Set<String> eps = schemaDestinationEndpoints.stream().map(Object::toString).collect(Collectors.toSet());
ret.put("endpointDestinations", new HashSet<>(eps));
}
if (schemaEndpointsIgnored != null) {
Set<String> eps = schemaEndpointsIgnored.stream().map(Object::toString).collect(Collectors.toSet());
ret.put("endpointIgnored", new HashSet<>(eps));
}
if (statement != null) {
AuditLogContext logContext = statement.getAuditLogContext();
if (logContext != null) {
HashMap<String, String> log = new HashMap<>();
if (logContext.auditLogEntryType != null)
log.put("type", logContext.auditLogEntryType.name());
if (logContext.keyspace != null)
log.put("keyspace", logContext.keyspace);
if (logContext.scope != null)
log.put("table", logContext.scope);
ret.put("statement", log);
}
}
if (sender != null)
ret.put("sender", sender.toString());
return ret;
}
Aggregations