com.atlassian.bamboo.persister
Class DefaultAuditLogService

java.lang.Object
  extended by com.atlassian.bamboo.persister.DefaultAuditLogService
All Implemented Interfaces:
AuditLogService

public class DefaultAuditLogService
extends java.lang.Object
implements AuditLogService


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.bamboo.persister.AuditLogService
AuditLogService.FieldChange
 
Constructor Summary
DefaultAuditLogService(AuditLogDao auditLogDao, BambooAuthenticationContext authenticationContext, AdministrationConfigurationManager administrationConfigurationManager)
           
 
Method Summary
 java.util.List<AuditLogEntry> getAgentAuditLogsMessagesByAgentName(java.lang.String agentName)
          Provide a list of audit log messages filter by Agent Name
 java.util.List<AuditLogEntry> getAuditLogMessagesForPlan(ImmutablePlan plan)
          Provide a list of all audit log messages written against a plan.
 java.util.List<AuditLogEntry> getAuditLogMessagesForPlan(ImmutablePlan plan, long startDate, long endDate)
          Provide a list of all audit log messages written against a plan between input dates.
 java.util.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(java.util.Collection<AuditLogService.FieldChange> changes, Key plan)
          Add 'field change' messages to the system audit log.
 void log(java.lang.String msg)
          Add a message to the system audit log.
 void log(java.lang.String msg, Key planKey)
          Add a message to the plans audit log.
 void log(java.lang.String msg, Key planKey, AuditLogEntity entity)
          Add a message to the plans audit log.
 void log(java.lang.String username, java.lang.String msg, Key planKey)
           
 void log(java.lang.String username, java.lang.String msg, Key planKey, AuditLogEntity entity)
           
 void log(java.lang.String fieldName, java.lang.String oldValue, java.lang.String newValue, Key plan)
          Add 'field change' message to the system audit log.
 void log(java.lang.String fieldName, java.lang.String oldValue, java.lang.String newValue, Key planKey, AuditLogEntity entity)
          Add 'field change' message to the system audit log.
 void log(com.atlassian.user.User user, java.lang.String msg)
          Add a message to the system audit log.
 void log(com.atlassian.user.User user, java.lang.String msg, Key planKey)
          Add a message to the plans audit log.
 void log(com.atlassian.user.User user, java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAuditLogService

public DefaultAuditLogService(AuditLogDao auditLogDao,
                              BambooAuthenticationContext authenticationContext,
                              AdministrationConfigurationManager administrationConfigurationManager)
Method Detail

log

public void log(@NotNull
                AuditLogEntry msg)
Description copied from interface: AuditLogService
Add a log to the audit log.

Specified by:
log in interface AuditLogService
Parameters:
msg - (fully populated) to be logged

log

public void log(@NotNull
                java.lang.String msg)
Description copied from interface: AuditLogService
Add a message to the system audit log. Message will be logged against the user that is currently set in the authentication context.

Specified by:
log in interface AuditLogService
Parameters:
msg - the text of the message to add.

log

public void log(@Nullable
                com.atlassian.user.User user,
                @NotNull
                java.lang.String msg)
Description copied from interface: AuditLogService
Add a message to the system audit log. Message will be logged against the current logged in user (if available)

Specified by:
log in interface AuditLogService
Parameters:
user - who caused the event being logged
msg - the text of the message to add.

log

public void log(@NotNull
                java.lang.String msg,
                @Nullable
                Key planKey)
Description copied from interface: AuditLogService
Add a message to the plans audit log. Message will be logged against the current logged in user (if available)

Specified by:
log in interface AuditLogService
Parameters:
msg - to log
planKey - to log it against

log

public void log(@NotNull
                java.lang.String msg,
                @Nullable
                Key planKey,
                @Nullable
                AuditLogEntity entity)
Description copied from interface: AuditLogService
Add a message to the plans audit log. Message will be logged against the current logged in user (if available)

Specified by:
log in interface AuditLogService
entity - job's task, chain' stage etc. to log against

log

public void log(@Nullable
                com.atlassian.user.User user,
                @NotNull
                java.lang.String msg,
                @Nullable
                Key planKey)
Description copied from interface: AuditLogService
Add a message to the plans audit log. Message will be logged against provided user

Specified by:
log in interface AuditLogService
Parameters:
user - who caused the event being logged
msg - to be logged
planKey - to log the message against.

log

public void log(@Nullable
                com.atlassian.user.User user,
                @NotNull
                java.lang.String msg,
                @Nullable
                Key planKey,
                @Nullable
                AuditLogEntity entity)
Description copied from interface: AuditLogService
Add a message to the plans audit log. Message will be logged against provided user

Specified by:
log in interface AuditLogService
Parameters:
user - who caused the event being logged
msg - to be logged
entity - header of job's task, chain' stage etc. to log against

log

public void log(@Nullable
                java.lang.String username,
                @NotNull
                java.lang.String msg,
                @Nullable
                Key planKey)

log

public void log(@Nullable
                java.lang.String username,
                @NotNull
                java.lang.String msg,
                @Nullable
                Key planKey,
                @Nullable
                AuditLogEntity entity)

getAuditLogMessagesForPlan

public java.util.List<AuditLogEntry> getAuditLogMessagesForPlan(@NotNull
                                                                ImmutablePlan plan)
Description copied from interface: AuditLogService
Provide a list of all audit log messages written against a plan.

Specified by:
getAuditLogMessagesForPlan in interface AuditLogService
Parameters:
plan - to find audit messages for
Returns:
List of audit log entries for the given plan

getAuditLogMessagesForPlan

public java.util.List<AuditLogEntry> getAuditLogMessagesForPlan(@NotNull
                                                                ImmutablePlan plan,
                                                                long startDate,
                                                                long endDate)
Description copied from interface: AuditLogService
Provide a list of all audit log messages written against a plan between input dates.

Specified by:
getAuditLogMessagesForPlan in interface AuditLogService
Parameters:
plan - to find audit messages for
Returns:
List of audit log entries for the given plan

removeAuditLogMessagesForPlan

public void removeAuditLogMessagesForPlan(@NotNull
                                          ImmutablePlan plan)
Description copied from interface: AuditLogService
Deletes all log messages for a given plan

Specified by:
removeAuditLogMessagesForPlan in interface AuditLogService
Parameters:
plan - to delete messages for

removeGlobalAuditLogMessages

public void removeGlobalAuditLogMessages()
Description copied from interface: AuditLogService
Deletes all Global audit log messages

Specified by:
removeGlobalAuditLogMessages in interface AuditLogService

removeAllAuditLogMessages

public void removeAllAuditLogMessages()
Description copied from interface: AuditLogService
Deletes all log messages in the database

Specified by:
removeAllAuditLogMessages in interface AuditLogService

getGlobalAuditLogMessages

public java.util.List<AuditLogEntry> getGlobalAuditLogMessages()
Description copied from interface: AuditLogService
Provide a list of all audit log messages written against the system.

Specified by:
getGlobalAuditLogMessages in interface AuditLogService
Returns:
a list of audit log entries for the system

log

public void log(@NotNull
                java.util.Collection<AuditLogService.FieldChange> changes,
                @Nullable
                Key plan)
Description copied from interface: AuditLogService
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.

Specified by:
log in interface AuditLogService

log

public void log(@NotNull
                java.lang.String fieldName,
                @Nullable
                java.lang.String oldValue,
                @Nullable
                java.lang.String newValue,
                @Nullable
                Key plan)
Description copied from interface: AuditLogService
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.

Specified by:
log in interface AuditLogService

log

public void log(@NotNull
                java.lang.String fieldName,
                @Nullable
                java.lang.String oldValue,
                @Nullable
                java.lang.String newValue,
                @Nullable
                Key planKey,
                @Nullable
                AuditLogEntity entity)
Description copied from interface: AuditLogService
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.

Specified by:
log in interface AuditLogService
entity - job's task or chain's stage affected by the change

isEnabled

public boolean isEnabled()
Description copied from interface: AuditLogService
Returns whether loggings is enabled

Specified by:
isEnabled in interface AuditLogService
Returns:

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: AuditLogService
sets whether logging is enabled or not

Specified by:
setEnabled in interface AuditLogService

getAgentAuditLogsMessagesByAgentName

public java.util.List<AuditLogEntry> getAgentAuditLogsMessagesByAgentName(java.lang.String agentName)
Description copied from interface: AuditLogService
Provide a list of audit log messages filter by Agent Name

Specified by:
getAgentAuditLogsMessagesByAgentName in interface AuditLogService
Parameters:
agentName - the name of the agent
Returns:
List of audit log entries for the given Agent Name


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.