org.axonframework.auditing
Class CorrelationAuditDataProvider

java.lang.Object
  extended by org.axonframework.auditing.CorrelationAuditDataProvider
All Implemented Interfaces:
AuditDataProvider

public class CorrelationAuditDataProvider
extends Object
implements AuditDataProvider

AuditDataProvider implementation that attaches the command identifier to each Event generated as result of that Command.

Since:
2.0
Author:
Allard Buijze

Field Summary
static String DEFAULT_CORRELATION_KEY
          The default meta-data key, which is used when an instance is created using the default constructor
 
Constructor Summary
CorrelationAuditDataProvider()
          Initializes the CorrelationAuditDataProvider which attaches the Command Identifier to an Event's MetaData using the default key (""command-identifier"").
CorrelationAuditDataProvider(String correlationIdKey)
          Initializes the CorrelationAuditDataProvider which attaches the Command Identifier to an Event's MetaData using the given correlationIdKey.
 
Method Summary
 Map<String,Object> provideAuditDataFor(CommandMessage<?> command)
          Return the relevant auditing information for the given command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CORRELATION_KEY

public static final String DEFAULT_CORRELATION_KEY
The default meta-data key, which is used when an instance is created using the default constructor

See Also:
Constant Field Values
Constructor Detail

CorrelationAuditDataProvider

public CorrelationAuditDataProvider()
Initializes the CorrelationAuditDataProvider which attaches the Command Identifier to an Event's MetaData using the default key (""command-identifier"").


CorrelationAuditDataProvider

public CorrelationAuditDataProvider(String correlationIdKey)
Initializes the CorrelationAuditDataProvider which attaches the Command Identifier to an Event's MetaData using the given correlationIdKey.

Parameters:
correlationIdKey - the key under which to store the Command Identifier in the resulting Event's MetaData
Method Detail

provideAuditDataFor

public Map<String,Object> provideAuditDataFor(CommandMessage<?> command)
Description copied from interface: AuditDataProvider
Return the relevant auditing information for the given command. This method is called exactly once for each time the command is dispatched.

Specified by:
provideAuditDataFor in interface AuditDataProvider
Parameters:
command - The command being dispatched
Returns:
a map containing key-value pairs of relevant information to include in audit logs.


Copyright © 2010-2016. All Rights Reserved.