com.atlassian.bamboo.persister
Interface AuditLogService

All Known Implementing Classes:
DefaultAuditLogService

public interface AuditLogService

Service allowing you to register audit messages against the system or against plans. Audit messages allow you to track changes to configuration.


Nested Class Summary
static interface AuditLogService.FieldChange
          Simple interface that provides information about a changed field.
 
Method Summary
 List<AuditLogEntry> getAgentAuditLogsMessagesByAgentName(String agentName)
          Provide a list of audit log messages filter by Agent Name
 List<AuditLogEntry> getAuditLogMessagesForPlan(ImmutablePlan plan)
          Provide a list of all audit log messages written against a plan.
 List<AuditLogEntry> getAuditLogMessagesForPlan(ImmutablePlan plan, long startDate, long endDate)
          Provide a list of all audit log messages written against a plan between input dates.
 List<AuditLogEntry> getGlobalAuditLogMessages()
          Provide a list of all audit log messages written against the system.
 boolean isEnabled()
          Returns whether loggings is enabled
 void log(AuditLogEntry msg)
          Add a log to the audit log.
 void log(Collection<AuditLogService.FieldChange> changes, Key plan)
          Add 'field change' messages to the system audit log.
 void log(String msg)
          Add a message to the system audit log.
 void log(String msg, Key plan)
          Add a message to the plans audit log.
 void log(String s, Key planKey, AuditLogEntity entity)
          Add a message to the plans audit log.
 void log(String fieldName, String oldValue, String newValue, Key plan)
          Add 'field change' message to the system audit log.
 void log(String fieldName, String oldValue, String newValue, Key planKey, AuditLogEntity entity)
          Add 'field change' message to the system audit log.
 void log(com.atlassian.user.User user, String msg)
          Add a message to the system audit log.
 void log(com.atlassian.user.User user, String msg, Key plan)
          Add a message to the plans audit log.
 void log(com.atlassian.user.User user, String msg, Key planKey, AuditLogEntity entity)
          Add a message to the plans audit log.
 void removeAllAuditLogMessages()
          Deletes all log messages in the database
 void removeAuditLogMessagesForPlan(ImmutablePlan plan)
          Deletes all log messages for a given plan
 void removeGlobalAuditLogMessages()
          Deletes all Global audit log messages
 void setEnabled(boolean enabled)
          sets whether logging is enabled or not
 

Method Detail

log

void log(@NotNull
         AuditLogEntry msg)
Add a log to the audit log.

Parameters:
msg - (fully populated) to be logged

log

void log(@NotNull
         String msg)
Add a message to the system audit log. Message will be logged against the user that is currently set in the authentication context.

Parameters:
msg - the text of the message to add.

log

void log(@NotNull
         Collection<AuditLogService.FieldChange> changes,
         @Nullable
         Key plan)
Add 'field change' messages to the system audit log. The messages will be logged against the user that is currently set in the authentication context. If plan key is not null the message will be logged against the given plan.

Parameters:
changes -
plan -

log

void log(@NotNull
         String fieldName,
         @Nullable
         String oldValue,
         @Nullable
         String newValue,
         @Nullable
         Key plan)
Add 'field change' message to the system audit log. The messages will be logged against the user that is currently set in the authentication context. If plan key is not null the message will be logged against the given plan.

Parameters:
fieldName -
oldValue -
newValue -
plan -

log

void log(@NotNull
         String fieldName,
         @Nullable
         String oldValue,
         @Nullable
         String newValue,
         @Nullable
         Key planKey,
         @Nullable
         AuditLogEntity entity)
Add 'field change' message to the system audit log. The messages will be logged against the user that is currently set in the authentication context. If plan key is not null the message will be logged against the given plan.

Parameters:
fieldName -
oldValue -
newValue -
plan -
entity - job's task or chain's stage affected by the change

log

void log(@Nullable
         com.atlassian.user.User user,
         @NotNull
         String msg)
Add a message to the system audit log. Message will be logged against the current logged in user (if available)

Parameters:
user - who caused the event being logged
msg - the text of the message to add.

log

void log(@NotNull
         String msg,
         @Nullable
         Key plan)
Add a message to the plans audit log. Message will be logged against the current logged in user (if available)

Parameters:
msg - to log
plan - to log it against

log

void log(@NotNull
         String s,
         @Nullable
         Key planKey,
         @Nullable
         AuditLogEntity entity)
Add a message to the plans audit log. Message will be logged against the current logged in user (if available)

Parameters:
msg - to log
plan - to log it against
entity - job's task, chain' stage etc. to log against

log

void log(@Nullable
         com.atlassian.user.User user,
         @NotNull
         String msg,
         @Nullable
         Key plan)
Add a message to the plans audit log. Message will be logged against provided user

Parameters:
user - who caused the event being logged
msg - to be logged
plan - to log the message against.

log

void log(@Nullable
         com.atlassian.user.User user,
         @NotNull
         String msg,
         @Nullable
         Key planKey,
         @Nullable
         AuditLogEntity entity)
Add a message to the plans audit log. Message will be logged against provided user

Parameters:
user - who caused the event being logged
msg - to be logged
plan - to log the message against.
entity - header of job's task, chain' stage etc. to log against

getAuditLogMessagesForPlan

List<AuditLogEntry> getAuditLogMessagesForPlan(@NotNull
                                               ImmutablePlan plan)
Provide a list of all audit log messages written against a plan.

Parameters:
plan - to find audit messages for
Returns:
List of audit log entries for the given plan

getAuditLogMessagesForPlan

List<AuditLogEntry> getAuditLogMessagesForPlan(@NotNull
                                               ImmutablePlan plan,
                                               long startDate,
                                               long endDate)
Provide a list of all audit log messages written against a plan between input dates.

Parameters:
plan - to find audit messages for
startDate -
endDate -
Returns:
List of audit log entries for the given plan

getAgentAuditLogsMessagesByAgentName

List<AuditLogEntry> getAgentAuditLogsMessagesByAgentName(String agentName)
Provide a list of audit log messages filter by Agent Name

Parameters:
agentName - the name of the agent
Returns:
List of audit log entries for the given Agent Name

getGlobalAuditLogMessages

List<AuditLogEntry> getGlobalAuditLogMessages()
Provide a list of all audit log messages written against the system.

Returns:
a list of audit log entries for the system

removeGlobalAuditLogMessages

void removeGlobalAuditLogMessages()
Deletes all Global audit log messages


removeAuditLogMessagesForPlan

void removeAuditLogMessagesForPlan(@NotNull
                                   ImmutablePlan plan)
Deletes all log messages for a given plan

Parameters:
plan - to delete messages for

removeAllAuditLogMessages

void removeAllAuditLogMessages()
Deletes all log messages in the database


isEnabled

boolean isEnabled()
Returns whether loggings is enabled

Returns:

setEnabled

void setEnabled(boolean enabled)
sets whether logging is enabled or not

Parameters:
enabled -


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.