⇒ Index (Frames) | ⇒ Index (No Frames) | ⇒ Package | ⇒ Package Tree | ⇒ Full Tree 
com.tildemh.debbug

Class Listing

java.lang.Object|
+--com.tildemh.debbug.ListingStub|
+--com.tildemh.debbug.Listing

All Implemented Interfaces:
BugListener, java.io.Serializable, java.io.Serializable


publicclass Listing
extends ListingStub
implements java.io.Serializable, BugListener

Contains bug listings for a particular package, source package, pseudo package, or maintainer.

Note: Listings are now supposed to be singly instantiable. Do not try to create two similar listings. Instead, obtain listings using the BTS class. If you don't, all sorts of problems might happen.

Note: this class was formerly called Package, but renamed due to name conflict. Many places will refer to it as Package.

This is released under the terms of the GNU Lesser General Public License (LGPL). See the COPYING file for details.

Author:
© Mark Howard <mh@debian.org> 2002

Method Summary

synchronized void

addListener(ListingListener listener)

Register an object to receive notification of events on this object

void

bugDownloaded(Bug bug)

Called when downloading of a bug report has completed

boolean

bugException(Bug bug,Exception e)

Called when an exception occurs with a bug (e.g.

void

bugSeverityChanged(Bug bug,Severity oldseverity)

void

bugStatusChanged(Bug bug,Status oldStatus)

Called whenever the read/unread status of bug changes.

void

bugUpdated(Bug bug)

Called when a bug is updated

static int

findListener(Vector list,Object listener)

Give us a way to locate a specific listener in a Vector.

synchronized int

getAllCount()

synchronized int

getAllUnreadCount()

synchronized Hashtable

getBugs()

boolean

getComplete()

synchronized int

getFPCount()

synchronized int

getFPUnreadCount()

synchronized int

getINCount()

synchronized int

getINUnreadCount()

synchronized Long

getLastUpdated()

Returns the date when the listing was last updated.

synchronized int

getMWCount()

synchronized int

getMWUnreadCount()

synchronized int

getRCCount()

synchronized int

getRCUnreadCount()

void

loadReports()

Loads all the reports into memory setting listeners and calls bugAdded events for each

static Listing

makeListing(ListingType type,String name)

Constructs a new listing WARNING: Do not do this! it will mess things up.

synchronized void

removeListener(ListingListener listener)

Unregister an object that was receiving event notification.

void

retrievingBug(Bug bug)

Called when a bug is being retrieved, If verbose progress notifications have been requested

synchronized void

setAllCount(int count)

synchronized void

setAllUnreadCount(int unreadCount)

void

setComplete(boolean complete)

synchronized void

setFPCount(int count)

synchronized void

setFPUnreadCount(int unreadCount)

synchronized void

setINCount(int count)

synchronized void

setINUnreadCount(int unreadCount)

synchronized void

setLastUpdated(Long lastUpdated)

TODO: unix time! Sets the last updated field

synchronized void

setMWCount(int count)

synchronized void

setMWUnreadCount(int unreadCount)

synchronized void

setRCCount(int count)

synchronized void

setRCUnreadCount(int unreadCount)

synchronized void

setUpdated()

TODO: unix time! Sets the last updated field to the present time

void

update()

Downloads an updated version of the listing from the server and downloads any bug reports which are of a newer version on the server.

Method Details

addListener

publicsynchronized voidaddListener(ListingListener listener)

Register an object to receive notification of events on this object

Parameters:
listener

bugDownloaded

publicvoidbugDownloaded(Bug bug)

Called when downloading of a bug report has completed

Parameters:
bug

bugException

publicbooleanbugException(Bug bug,Exception e)

Called when an exception occurs with a bug (e.g. error contacting server)

Parameters:
bug
e
Returns:
true if execution should continue

bugSeverityChanged

publicvoidbugSeverityChanged(Bug bug,Severity oldseverity)

Parameters:
bug
oldseverity

bugStatusChanged

publicvoidbugStatusChanged(Bug bug,Status oldStatus)

Called whenever the read/unread status of bug changes.

Parameters:
bug
oldStatus

bugUpdated

publicvoidbugUpdated(Bug bug)

Called when a bug is updated

Parameters:
bug

findListener

protectedstatic intfindListener(Vector list,Object listener)

Give us a way to locate a specific listener in a Vector.

Parameters:
list - The Vector of listeners to search.
listener - The object that is to be located in the Vector.
Returns:
Returns the index of the listener in the Vector, or -1 if the listener is not contained in the Vector.

getAllCount

publicsynchronized intgetAllCount()


getAllUnreadCount

publicsynchronized intgetAllUnreadCount()


getBugs

publicsynchronized HashtablegetBugs()


getComplete

publicbooleangetComplete()


getFPCount

publicsynchronized intgetFPCount()


getFPUnreadCount

publicsynchronized intgetFPUnreadCount()


getINCount

publicsynchronized intgetINCount()


getINUnreadCount

publicsynchronized intgetINUnreadCount()


getLastUpdated

publicsynchronized LonggetLastUpdated()

Returns the date when the listing was last updated.


getMWCount

publicsynchronized intgetMWCount()


getMWUnreadCount

publicsynchronized intgetMWUnreadCount()


getRCCount

publicsynchronized intgetRCCount()


getRCUnreadCount

publicsynchronized intgetRCUnreadCount()


loadReports

publicvoidloadReports()

Loads all the reports into memory setting listeners and calls bugAdded events for each


makeListing

publicstatic ListingmakeListing(ListingType type,String name)

Constructs a new listing WARNING: Do not do this! it will mess things up. Use the BTS class to obtain listings.

Parameters:
type
name

removeListener

publicsynchronized voidremoveListener(ListingListener listener)

Unregister an object that was receiving event notification.

Parameters:
listener - The object that is to no longer receive

retrievingBug

publicvoidretrievingBug(Bug bug)

Called when a bug is being retrieved, If verbose progress notifications have been requested

Parameters:
bug

setAllCount

publicsynchronized voidsetAllCount(int count)

Parameters:
count

setAllUnreadCount

publicsynchronized voidsetAllUnreadCount(int unreadCount)

Parameters:
unreadCount

setComplete

publicvoidsetComplete(boolean complete)

Parameters:
complete

setFPCount

publicsynchronized voidsetFPCount(int count)

Parameters:
count

setFPUnreadCount

publicsynchronized voidsetFPUnreadCount(int unreadCount)

Parameters:
unreadCount

setINCount

publicsynchronized voidsetINCount(int count)

Parameters:
count

setINUnreadCount

publicsynchronized voidsetINUnreadCount(int unreadCount)

Parameters:
unreadCount

setLastUpdated

publicsynchronized voidsetLastUpdated(Long lastUpdated)

TODO: unix time! Sets the last updated field

Parameters:
lastUpdated

setMWCount

publicsynchronized voidsetMWCount(int count)

Parameters:
count

setMWUnreadCount

publicsynchronized voidsetMWUnreadCount(int unreadCount)

Parameters:
unreadCount

setRCCount

publicsynchronized voidsetRCCount(int count)

Parameters:
count

setRCUnreadCount

publicsynchronized voidsetRCUnreadCount(int unreadCount)

Parameters:
unreadCount

setUpdated

publicsynchronized voidsetUpdated()

TODO: unix time! Sets the last updated field to the present time


update

publicvoidupdate()

Downloads an updated version of the listing from the server and downloads any bug reports which are of a newer version on the server.

To obtain progress information about this update, attach a ListingListener to this object.