com.atlassian.jira.auditing
Class DefaultAuditingService

java.lang.Object
  extended by com.atlassian.jira.auditing.DefaultAuditingService
All Implemented Interfaces:
AuditingService

public class DefaultAuditingService
extends Object
implements AuditingService

Default implementation of service for managing auditing records

Since:
v6.3

Field Summary
static Integer MAX_LEN
           
 
Constructor Summary
DefaultAuditingService(PermissionManager permissionManager, I18nHelper.BeanFactory i18nFactory, AuditingManager auditingManager, FeatureManager featureManager, JiraAuthenticationContext jiraAuthenticationContext, com.atlassian.plugin.PluginAccessor pluginAccessor)
           
 
Method Summary
 ServiceOutcome<Records> getRecords(Integer offset, Integer maxResults, AuditingFilter filter)
           
 Long getTotalNumberOfRecords()
          Returns total number of audit records
 ErrorCollection storeRecord(String category, String summary, AssociatedItem objectItem, Iterable<ChangedValue> changedValues, Iterable<AssociatedItem> associatedItems)
          Store record in Auditing Log
 ErrorCollection storeRecord(String category, String summary, String eventSourceKey, AssociatedItem objectItem, Iterable<ChangedValue> changedValues, Iterable<AssociatedItem> associatedItems)
          /** Store record in Auditing Log along with plugin name created the event
protected  void validateAssociatedItem(String fieldId, AssociatedItem objectItem, ErrorCollection errorCollection, I18nHelper i18nBean)
           
protected  void validateAssociatedItems(String fieldId, Iterable<AssociatedItem> associatedItems, ErrorCollection errorCollection, I18nHelper i18nBean)
           
protected  void validateCategoryAndSummary(String category, String summary, ErrorCollection errorCollection, I18nHelper i18nBean)
           
protected  void validateChangedValue(String fieldId, ChangedValue value, ErrorCollection errorCollection, I18nHelper i18nBean)
           
protected  void validateChangedValues(String fieldId, Iterable<ChangedValue> values, ErrorCollection errorCollection, I18nHelper i18nBean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_LEN

public static final Integer MAX_LEN
Constructor Detail

DefaultAuditingService

public DefaultAuditingService(PermissionManager permissionManager,
                              I18nHelper.BeanFactory i18nFactory,
                              AuditingManager auditingManager,
                              FeatureManager featureManager,
                              JiraAuthenticationContext jiraAuthenticationContext,
                              com.atlassian.plugin.PluginAccessor pluginAccessor)
Method Detail

getRecords

@Nonnull
public ServiceOutcome<Records> getRecords(@Nullable
                                                  Integer offset,
                                                  @Nullable
                                                  Integer maxResults,
                                                  @Nullable
                                                  AuditingFilter filter)
Specified by:
getRecords in interface AuditingService
Parameters:
offset - the offset from which search starts
maxResults - maximum number of returned results
filter - defines how records should be filtered out before being returned, if null records will not be filtered
Returns:
Records instance wrapped in ServiceOutcome

storeRecord

@Nonnull
public ErrorCollection storeRecord(@Nullable
                                           String category,
                                           @Nullable
                                           String summary,
                                           @Nonnull
                                           String eventSourceKey,
                                           @Nullable
                                           AssociatedItem objectItem,
                                           @Nullable
                                           Iterable<ChangedValue> changedValues,
                                           @Nullable
                                           Iterable<AssociatedItem> associatedItems)
Description copied from interface: AuditingService
/** Store record in Auditing Log along with plugin name created the event

Specified by:
storeRecord in interface AuditingService
Parameters:
category - - category of the log record
summary - - description of the change
eventSourceKey - - key of plugin which creates the record
objectItem - - changed object
changedValues - - changed values of the object item
associatedItems - - other objects that were affected by this change

storeRecord

@Nonnull
public ErrorCollection storeRecord(@Nonnull
                                           String category,
                                           @Nonnull
                                           String summary,
                                           @Nullable
                                           AssociatedItem objectItem,
                                           @Nullable
                                           Iterable<ChangedValue> changedValues,
                                           @Nullable
                                           Iterable<AssociatedItem> associatedItems)
Description copied from interface: AuditingService
Store record in Auditing Log

Specified by:
storeRecord in interface AuditingService
Parameters:
category - - category of the log record
summary - - description of the change
objectItem - - changed object
changedValues - - changed values of the object item
associatedItems - - other objects that were affected by this change

getTotalNumberOfRecords

@Nonnull
public Long getTotalNumberOfRecords()
Description copied from interface: AuditingService
Returns total number of audit records

Specified by:
getTotalNumberOfRecords in interface AuditingService
Returns:
total number of records

validateCategoryAndSummary

protected void validateCategoryAndSummary(String category,
                                          String summary,
                                          ErrorCollection errorCollection,
                                          I18nHelper i18nBean)

validateChangedValues

protected void validateChangedValues(@Nonnull
                                     String fieldId,
                                     @Nonnull
                                     Iterable<ChangedValue> values,
                                     @Nonnull
                                     ErrorCollection errorCollection,
                                     @Nonnull
                                     I18nHelper i18nBean)

validateChangedValue

protected void validateChangedValue(@Nonnull
                                    String fieldId,
                                    @Nonnull
                                    ChangedValue value,
                                    @Nonnull
                                    ErrorCollection errorCollection,
                                    @Nonnull
                                    I18nHelper i18nBean)

validateAssociatedItems

protected void validateAssociatedItems(@Nonnull
                                       String fieldId,
                                       @Nonnull
                                       Iterable<AssociatedItem> associatedItems,
                                       @Nonnull
                                       ErrorCollection errorCollection,
                                       @Nonnull
                                       I18nHelper i18nBean)

validateAssociatedItem

protected void validateAssociatedItem(@Nonnull
                                      String fieldId,
                                      @Nonnull
                                      AssociatedItem objectItem,
                                      @Nonnull
                                      ErrorCollection errorCollection,
                                      @Nonnull
                                      I18nHelper i18nBean)


Copyright © 2002-2014 Atlassian. All Rights Reserved.