org.apache.lokahi.core.api.project
Class Project

java.lang.Object
  extended by org.apache.lokahi.core.common.interfaces.RestObject
      extended by org.apache.lokahi.core.common.interfaces.TMCDao<T>
          extended by org.apache.lokahi.core.common.interfaces.FunctionableEntity<Project>
              extended by org.apache.lokahi.core.api.project.Project
All Implemented Interfaces:
Collectable, Dao<Project>, Entity, Restable

public class Project
extends FunctionableEntity<Project>

Version:
$Id: Project.java,v 1.3 2006/03/07 22:05:23 drtobes Exp $
Author:
Stephen Toback

Constructor Summary
Project()
           
Project(int projectId, java.lang.String projectName)
           
Project(java.lang.String projectName)
           
 
Method Summary
 boolean addTomcatContexts(java.util.Collection<TomcatContext> c)
           
 boolean addTomcatContexts(TomcatContext tc)
           
 boolean addVirtualHost(VirtualHost vh)
           
 boolean addVirtualHosts(java.util.Collection<VirtualHost> c)
           
 java.lang.StringBuilder buildShortXMLRepresentation()
          Builds a short xml representation of this object containing name, and primary key.
 java.lang.StringBuilder buildXMLRepresention()
          Builds a xml representation of this object
 boolean containsObject(Dao object)
           
 boolean equals(java.lang.Object o)
           
 Project fillObject(java.sql.ResultSet r)
          Creates the Dao from the passed resultset, internally calling the appriate constructor.
 Project get(int id)
           
 java.util.Collection getEnvs()
           
 java.util.SortedSet<JobPool> getJobPools()
           
 java.lang.String getName()
          Gets the name.
 int getObjectId()
           
 FunctionableEntity getParent()
           
 int getPk()
          Gets the primary key
static Project getProject(int id)
          Deprecated.  
static java.util.Collection<Project> getProjects()
           
static java.util.Collection<Project> getProjects(java.lang.String name)
           
static java.util.Collection<Project> getProjects(TomcatContext tc)
           
static java.util.Collection<Project> getProjects(User u)
           
static java.util.Collection<Project> getProjects(VirtualHost vh)
           
static java.util.Collection<Project> getRecentProjects(User u)
           
 java.util.Collection<TomcatContext> getTomcatContexts()
           
 java.util.Collection<User> getUsers()
           
 java.util.Collection<VirtualHost> getVirtualHosts()
           
 java.util.Collection<VirtualHost> getVirtualHostsNoDB()
           
 int hashCode()
           
 void removeTomcatContext(TomcatContext tc)
           
 void setName(java.lang.String name)
           
 void setPk(int pk)
           
 void setTomcatContexts(java.util.Collection<TomcatContext> tomcatContexts)
           
 void setVirtualHosts(java.util.Collection<VirtualHost> virtualHosts)
           
static Project store(Project p)
           
 java.lang.String toString()
           
static boolean update(Project p)
           
 
Methods inherited from class org.apache.lokahi.core.common.interfaces.RestObject
elementBuilder, elementBuilder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Project

public Project()

Project

public Project(int projectId,
               java.lang.String projectName)

Project

public Project(java.lang.String projectName)
Method Detail

getObjectId

public int getObjectId()
Specified by:
getObjectId in class FunctionableEntity<Project>

getPk

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

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.

Returns:
the String name.

setName

public void setName(java.lang.String name)

get

public Project get(int id)
            throws java.sql.SQLException
Specified by:
get in class TMCDao<Project>
Throws:
java.sql.SQLException

getParent

public FunctionableEntity getParent()
Specified by:
getParent in class FunctionableEntity<Project>

getVirtualHostsNoDB

public java.util.Collection<VirtualHost> getVirtualHostsNoDB()

getVirtualHosts

public java.util.Collection<VirtualHost> getVirtualHosts()

addVirtualHost

public boolean addVirtualHost(VirtualHost vh)

addVirtualHosts

public boolean addVirtualHosts(java.util.Collection<VirtualHost> c)

setVirtualHosts

public void setVirtualHosts(java.util.Collection<VirtualHost> virtualHosts)

getUsers

public java.util.Collection<User> getUsers()

getTomcatContexts

public java.util.Collection<TomcatContext> getTomcatContexts()

removeTomcatContext

public void removeTomcatContext(TomcatContext tc)

addTomcatContexts

public boolean addTomcatContexts(TomcatContext tc)

addTomcatContexts

public boolean addTomcatContexts(java.util.Collection<TomcatContext> c)

getEnvs

public java.util.Collection getEnvs()

setTomcatContexts

public void setTomcatContexts(java.util.Collection<TomcatContext> tomcatContexts)

getJobPools

public java.util.SortedSet<JobPool> getJobPools()

getProject

public static Project getProject(int id)
                          throws java.sql.SQLException
Deprecated. 

Parameters:
id -
Returns:
Throws:
java.sql.SQLException

getProjects

public static java.util.Collection<Project> getProjects(java.lang.String name)
                                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

getProjects

public static java.util.Collection<Project> getProjects(User u)
                                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

getProjects

public static java.util.Collection<Project> getProjects(TomcatContext tc)
                                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

getProjects

public static java.util.Collection<Project> getProjects(VirtualHost vh)
                                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

getProjects

public static java.util.Collection<Project> getProjects()
                                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

getRecentProjects

public static java.util.Collection<Project> getRecentProjects(User u)
                                                       throws java.sql.SQLException
Throws:
java.sql.SQLException

update

public static boolean update(Project p)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

containsObject

public boolean containsObject(Dao object)

store

public static Project store(Project p)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

fillObject

public Project 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.

Parameters:
r - the resultset from a database call, should include the entire object
Returns:
Object populated from the resultset
Throws:
java.sql.SQLException

buildShortXMLRepresentation

public java.lang.StringBuilder buildShortXMLRepresentation()
Description copied from interface: Restable
Builds a short xml representation of this object containing name, and primary key.

Returns:
the xml representation

buildXMLRepresention

public java.lang.StringBuilder buildXMLRepresention()
Description copied from interface: Restable
Builds a xml representation of this object

Returns:
the xml representation

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