org.davesag.tasktracker
Class ListEntry

java.lang.Object
  |
  +--org.pronoic.cos.core.CosEntryTemplate
        |
        +--org.pronoic.cos.entry.CosEntry
              |
              +--org.davesag.tasktracker.ListEntry
All Implemented Interfaces:
Archivable, Cloneable, CosEntryInterface, Distributable, Entry, Serializable
Direct Known Subclasses:
ProjectList, UserListEntry

public class ListEntry
extends CosEntry
implements Archivable

ListEntry is a named vector that is useful for small lists of things you need global access to. Extend this ListEntry to make your own custom lists. Right now the archive and dearchive methods just return true. A better way may be to write DoItYourBloodySelfException.

See Also:
CosConnector, Serialized Form

Field Summary
 Vector mList
          the list.
 String mListname
          the name of this list
 
Fields inherited from class org.pronoic.cos.entry.CosEntry
mAppContext, mCreated, mCreationEnsembleName, mLastModified
 
Fields inherited from class org.pronoic.cos.core.CosEntryTemplate
mEntryVersionNumber, mUniqueServiceEntryId
 
Constructor Summary
ListEntry()
          default constructor to satisfy an entry or make a template for matching.
ListEntry(String listname)
          use this constuctor when actually creating an entry.
ListEntry(String listname, Vector v)
          use this constuctor when actually creating an entry and you wish to load it quickly.
 
Method Summary
 void add(Object item)
          add an item to the list.
 void add(Object[] items)
          add an array of items to the list.
 boolean archive(SpaceConnectable spconn, Connection jdbcconn)
          Method that is used as the core serve method inside the Karen service which takes an object, and requires it to archive itself.
 boolean equals(ListEntry b)
          equals just tests the suppled ListEntry for name equality with this category list.
 boolean extract(SpaceConnectable spconn, Connection jdbcconn)
          Method to bootstrap entries of a given class from the SQL database.
 Vector getList()
          Gets the internal list as a Vector.
 String getListname()
           
 int getSize()
          a shortcut utility to get the size of the internal list vector.
 void makeNullTemplate()
           
 
Methods inherited from class org.pronoic.cos.entry.CosEntry
created, getAppContext, getCreationEnsembleName, setAppContext, setCreationEnsembleName, updated
 
Methods inherited from class org.pronoic.cos.core.CosEntryTemplate
clone, getUniqueServiceEntryId, getVersion, incrementVersion, setUniqueServiceEntryId
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pronoic.cos.entry.CosEntryInterface
created, getAppContext, getCreationEnsembleName, getUniqueServiceEntryId, getVersion, incrementVersion, setAppContext, setCreationEnsembleName, setUniqueServiceEntryId, updated
 

Field Detail

mListname

public String mListname
the name of this list

mList

public Vector mList
the list.
Constructor Detail

ListEntry

public ListEntry()
default constructor to satisfy an entry or make a template for matching.

ListEntry

public ListEntry(String listname)
use this constuctor when actually creating an entry.
Parameters:
listname - the arbitrary name for this list.

ListEntry

public ListEntry(String listname,
                 Vector v)
use this constuctor when actually creating an entry and you wish to load it quickly.
Parameters:
listname - the arbitrary name for this list.
v - A clone of this vector is used to initialise the mList Vector internally.
Method Detail

getListname

public String getListname()

makeNullTemplate

public void makeNullTemplate()
Specified by:
makeNullTemplate in interface CosEntryInterface
Overrides:
makeNullTemplate in class CosEntry

getList

public Vector getList()
Gets the internal list as a Vector.
Returns:
A Vector of listed objects.

getSize

public int getSize()
a shortcut utility to get the size of the internal list vector. returns -1 if the list is unpopulated.

add

public void add(Object item)
add an item to the list.
Parameters:
item - The item you wish to add. Note if you try to add an item that is already listed then that item will not be added. Lists only hold unique entries.

add

public void add(Object[] items)
add an array of items to the list.
Parameters:
items - The items you wish to add

equals

public boolean equals(ListEntry b)
equals just tests the suppled ListEntry for name equality with this category list.
Parameters:
b - The TaskCategoryList you wish to test.
Returns:
true if their list names are equal or if b is null, false if not.

archive

public boolean archive(SpaceConnectable spconn,
                       Connection jdbcconn)
                throws CriticalObjectStoreException
Method that is used as the core serve method inside the Karen service which takes an object, and requires it to archive itself. Right now this just returns true.
Specified by:
archive in interface Archivable
Parameters:
spconn - A space connector that implements the SpaceConnectable Interface that is a wrapper to a Javaspace.
jdbcconn - A connection to the database
Returns:
true always right now while in development.
Throws:
CriticalObjectStoreException - if the space has gone bad.

extract

public boolean extract(SpaceConnectable spconn,
                       Connection jdbcconn)
                throws CriticalObjectStoreException
Method to bootstrap entries of a given class from the SQL database. Currently, this is done on a class basis (i.e. this method will bootstrap an entire class). Thus, while it should be static, interfaces dont allow static methods. Just return true for now while testing.
Specified by:
extract in interface Archivable
Parameters:
spconn - A space connector that implements the SpaceConnectable Interface that is a wrapper to a Javaspace.
jdbcconn - A connection to the database
Returns:
true if it extracted okay, false if not.
Throws:
CriticalObjectStoreException - if the space has gone bad.


tasktracker API version 0.1 pre-release Copyright 2002 Dave Sag. Released under the BSD Licence.