com.atlassian.bamboo.brokenbuildtracker.data
Class TrackingEntryManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.brokenbuildtracker.data.TrackingEntryManagerImpl
All Implemented Interfaces:
TrackingEntryManager

public class TrackingEntryManagerImpl
extends java.lang.Object
implements TrackingEntryManager


Constructor Summary
TrackingEntryManagerImpl(TrackingEntryDao trackingEntryDao)
           
 
Method Summary
 void addResult(TrackingEntry entry, long resultId, int buildNumber)
          Add a result to an existing tracking entry
 void addUser(TrackingEntry entry, java.lang.String user, java.lang.String userWhoUpdated)
          Add a responsible user to an existing tracking entry
 void closeTrackingEntry(TrackingEntry entry)
          Close a tracking entry.
 TrackingEntry createTrackingEntry(long planId, boolean active)
          Create a brand new tracking entry for this plan.
 java.util.Collection<TrackingEntry> getActiveTrackingEntriesForUser(java.lang.String username)
          Find any active tracking entries for a given user.
 TrackingEntry getActiveTrackingEntryForPlan(long id)
          Returns the currently open tracking entry for plan.
 TrackingEntry getTrackingEntryById(int id)
          Find tracking entry by database id
 TrackingEntry getTrackingEntryByResultId(long resultId)
          Find the tracking entry for a given chain result.
 TrackingEntry getTrackingEntryWithBuildNumber(long planId, int buildNumber)
          Find the tracking entry with given build number.
 void removeAllUsers(TrackingEntry entry)
          Removes all existing responsible users from the existing tracking entry.
 void removeTrackingEntry(TrackingEntry trackingEntry)
          Remove entire tracking entry.
 void removeTrackingForPlan(long idOfDeletedItem)
          Remove any tracking information for a given plan
 void removeTrackingForResult(long idOfDeletedItem)
          Remove any tracking information for a given result
 void removeUser(TrackingEntry entry, java.lang.String user)
          Remove a responsible user from existing tracking entry
 void setActiveEntry(TrackingEntry trackingEntry)
          Sets tracing entry to active.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrackingEntryManagerImpl

public TrackingEntryManagerImpl(TrackingEntryDao trackingEntryDao)
Method Detail

getTrackingEntryById

public TrackingEntry getTrackingEntryById(int id)
Description copied from interface: TrackingEntryManager
Find tracking entry by database id

Specified by:
getTrackingEntryById in interface TrackingEntryManager
Parameters:
id - of tracking entry to find
Returns:
tracking entry with given id if found, otherwise null

getTrackingEntryByResultId

public TrackingEntry getTrackingEntryByResultId(long resultId)
Description copied from interface: TrackingEntryManager
Find the tracking entry for a given chain result.

Specified by:
getTrackingEntryByResultId in interface TrackingEntryManager
Parameters:
resultId - of the result
Returns:
tracking entry for the given result. null if none exists (e.g if result is green!)

getActiveTrackingEntryForPlan

public TrackingEntry getActiveTrackingEntryForPlan(long id)
Description copied from interface: TrackingEntryManager
Returns the currently open tracking entry for plan. Only one tracking entry is allowed open per plan at any one time. If multiple are found. They are all closed and this method will return null. Will also return null if there is no currently active entry (i.e the plan is currently passing)

Specified by:
getActiveTrackingEntryForPlan in interface TrackingEntryManager
Parameters:
id - of the plan
Returns:
currently active tracking entry for the plan if there is one

getActiveTrackingEntriesForUser

@NotNull
public java.util.Collection<TrackingEntry> getActiveTrackingEntriesForUser(@NotNull
                                                                                   java.lang.String username)
Description copied from interface: TrackingEntryManager
Find any active tracking entries for a given user. This represents the plans they currently are responsible for

Specified by:
getActiveTrackingEntriesForUser in interface TrackingEntryManager
Parameters:
username - of the user
Returns:
any active tracking entries for the given user.

addResult

public void addResult(@NotNull
                      TrackingEntry entry,
                      long resultId,
                      int buildNumber)
Description copied from interface: TrackingEntryManager
Add a result to an existing tracking entry

Specified by:
addResult in interface TrackingEntryManager
Parameters:
entry - to add result to
resultId - id of the result to add

addUser

public void addUser(@NotNull
                    TrackingEntry entry,
                    @NotNull
                    java.lang.String user,
                    @Nullable
                    java.lang.String userWhoUpdated)
Description copied from interface: TrackingEntryManager
Add a responsible user to an existing tracking entry

Specified by:
addUser in interface TrackingEntryManager
Parameters:
entry - to add user too
user - to add
userWhoUpdated - user who updated the responsibility entry. Null if responsibility has been automatically assigned

removeUser

public void removeUser(@NotNull
                       TrackingEntry entry,
                       @NotNull
                       java.lang.String user)
Description copied from interface: TrackingEntryManager
Remove a responsible user from existing tracking entry

Specified by:
removeUser in interface TrackingEntryManager
Parameters:
entry - to remove user from
user - to remove

removeAllUsers

public void removeAllUsers(@NotNull
                           TrackingEntry entry)
Description copied from interface: TrackingEntryManager
Removes all existing responsible users from the existing tracking entry.

Specified by:
removeAllUsers in interface TrackingEntryManager
Parameters:
entry - to remove users from

closeTrackingEntry

public void closeTrackingEntry(@NotNull
                               TrackingEntry entry)
Description copied from interface: TrackingEntryManager
Close a tracking entry. Essentially you do this when it no longer needs attention. e.g. if the build is now green.

Specified by:
closeTrackingEntry in interface TrackingEntryManager
Parameters:
entry - to close

createTrackingEntry

@NotNull
public TrackingEntry createTrackingEntry(long planId,
                                                 boolean active)
Description copied from interface: TrackingEntryManager
Create a brand new tracking entry for this plan. Will be active by default, ensure there are no other active tracking entries before creating a new one

Specified by:
createTrackingEntry in interface TrackingEntryManager
Parameters:
planId - of plan
active - should the new entry be created as active entry
Returns:
created tracking entry

removeTrackingForPlan

public void removeTrackingForPlan(long idOfDeletedItem)
Description copied from interface: TrackingEntryManager
Remove any tracking information for a given plan

Specified by:
removeTrackingForPlan in interface TrackingEntryManager
Parameters:
idOfDeletedItem - db id of the plan

removeTrackingForResult

public void removeTrackingForResult(long idOfDeletedItem)
Description copied from interface: TrackingEntryManager
Remove any tracking information for a given result

Specified by:
removeTrackingForResult in interface TrackingEntryManager
Parameters:
idOfDeletedItem - db if of the result

removeTrackingEntry

public void removeTrackingEntry(TrackingEntry trackingEntry)
Description copied from interface: TrackingEntryManager
Remove entire tracking entry.

Specified by:
removeTrackingEntry in interface TrackingEntryManager

setActiveEntry

public void setActiveEntry(TrackingEntry trackingEntry)
Description copied from interface: TrackingEntryManager
Sets tracing entry to active. Caller must ensure that there's no other open tracking entry.

Specified by:
setActiveEntry in interface TrackingEntryManager

getTrackingEntryWithBuildNumber

public TrackingEntry getTrackingEntryWithBuildNumber(long planId,
                                                     int buildNumber)
Description copied from interface: TrackingEntryManager
Find the tracking entry with given build number.

Specified by:
getTrackingEntryWithBuildNumber in interface TrackingEntryManager


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