org.apache.lokahi.core.api.alert
Class AlertDAO

java.lang.Object
  extended by org.apache.lokahi.core.api.alert.AlertDAO
All Implemented Interfaces:
Collectable, Dao, Datable

public class AlertDAO
extends java.lang.Object
implements Datable, Dao, Collectable

Version:
$Id: AlertDAO.java,v 1.4 2006/03/07 20:18:56 drtobes Exp $
Author:
Stephen Toback

Constructor Summary
AlertDAO()
           
AlertDAO(int id, java.lang.String title, int authorId, java.util.Date submissionDate, java.lang.String Link, java.sql.Blob content)
           
AlertDAO(java.lang.String title, java.lang.String content, User author)
           
AlertDAO(java.lang.String title, User author, java.lang.String Content)
           
 
Method Summary
 java.lang.String buildHTML()
           
 org.jdom.Element buildShortXMLRepresentation()
           
 org.jdom.Element buildXMLRepresention()
           
static boolean delete(AlertDAO al)
           
 boolean deleteRelationToProjs()
           
 boolean equals(java.lang.Object o)
           
 AlertDAO fillObject(java.sql.ResultSet r)
          Creates the Dao from the passed resultset, internally calling the appriate constructor.
static AlertDAO getAlertById(int id)
           
 User getAuthor()
           
 int getAuthorId()
           
 java.lang.String getContent()
           
static java.util.Collection<AlertDAO> getCurrentAlertsForAll()
           
 boolean getFormat()
           
 java.lang.String getLink()
           
 java.lang.String getName()
          Gets the name.
 int getPk()
          Gets the primary key
 java.util.Date getSortOnDate()
           
 java.util.Date getSubmissionDate()
           
 java.lang.String getSubmissionDateAsText()
           
 int hashCode()
           
 void setAuthor(User author)
           
 void setAuthorId(int authorId)
           
 void setContent(java.lang.String content)
           
 void setEntry(java.sql.Blob content)
           
 void setFormat(boolean flag)
           
 void setLink(java.lang.String link)
           
 void setLink(java.net.URL link)
           
 void setName(java.lang.String name)
           
 void setPk(int pk)
           
 void setSubmissionDate(java.util.Date submissionDate)
           
static AlertDAO store(AlertDAO al)
           
 void storeRelatedProjects()
           
 java.lang.String toString()
           
static void update(AlertDAO al)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlertDAO

public AlertDAO()

AlertDAO

public AlertDAO(int id,
                java.lang.String title,
                int authorId,
                java.util.Date submissionDate,
                java.lang.String Link,
                java.sql.Blob content)
         throws java.sql.SQLException
Throws:
java.sql.SQLException

AlertDAO

public AlertDAO(java.lang.String title,
                User author,
                java.lang.String Content)

AlertDAO

public AlertDAO(java.lang.String title,
                java.lang.String content,
                User author)
Method Detail

getPk

public int getPk()
Description copied from interface: Collectable
Gets the primary key

Specified by:
getPk in interface Collectable
Returns:
the int primary key

setPk

public void setPk(int pk)

getName

public java.lang.String getName()
Description copied from interface: Collectable
Gets the name.

Specified by:
getName in interface Collectable
Returns:
the String name.

setName

public void setName(java.lang.String name)

setLink

public void setLink(java.lang.String link)
             throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

setLink

public void setLink(java.net.URL link)

getLink

public java.lang.String getLink()

getContent

public java.lang.String getContent()

setEntry

public void setEntry(java.sql.Blob content)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setContent

public void setContent(java.lang.String content)

getAuthorId

public int getAuthorId()

setAuthorId

public void setAuthorId(int authorId)

getFormat

public boolean getFormat()

setFormat

public void setFormat(boolean flag)

getAuthor

public User getAuthor()

setAuthor

public void setAuthor(User author)

getSubmissionDate

public java.util.Date getSubmissionDate()

getSubmissionDateAsText

public java.lang.String getSubmissionDateAsText()

setSubmissionDate

public void setSubmissionDate(java.util.Date submissionDate)

fillObject

public AlertDAO fillObject(java.sql.ResultSet r)
                    throws java.sql.SQLException
Description copied from interface: Dao
Creates the Dao from the passed resultset, internally calling the appriate constructor.

Specified by:
fillObject in interface Dao
Parameters:
r - the resultset from a database call, should include the entire object
Returns:
Object populated from the resultset
Throws:
java.sql.SQLException

buildHTML

public java.lang.String buildHTML()

delete

public static boolean delete(AlertDAO al)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

deleteRelationToProjs

public boolean deleteRelationToProjs()
                              throws java.sql.SQLException
Throws:
java.sql.SQLException

store

public static AlertDAO store(AlertDAO al)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

update

public static void update(AlertDAO al)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

storeRelatedProjects

public void storeRelatedProjects()
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

getCurrentAlertsForAll

public static java.util.Collection<AlertDAO> getCurrentAlertsForAll()
                                                             throws java.sql.SQLException
Throws:
java.sql.SQLException

getAlertById

public static AlertDAO getAlertById(int id)

getSortOnDate

public java.util.Date getSortOnDate()
Specified by:
getSortOnDate in interface Datable

buildXMLRepresention

public org.jdom.Element buildXMLRepresention()

buildShortXMLRepresentation

public org.jdom.Element buildShortXMLRepresentation()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object