org.apache.lokahi.httpd.api.pool
Class ApachePool

java.lang.Object
  extended by org.apache.lokahi.core.common.interfaces.RestObject
      extended by org.apache.lokahi.core.common.interfaces.TMCDao<ApachePool>
          extended by org.apache.lokahi.httpd.api.pool.ApachePool
All Implemented Interfaces:
Collectable, Dao<ApachePool>, Pool, Restable

public class ApachePool
extends TMCDao<ApachePool>
implements Pool

Version:
$Id: ApachePool.java,v 1.3 2006/03/07 20:18:53 drtobes Exp $
Author:
Stephen Toback

Constructor Summary
ApachePool()
           
ApachePool(Environment env, java.lang.String name)
           
ApachePool(int id, java.lang.String name, int envId)
           
 
Method Summary
 boolean addWorker(ApacheWorker aw)
           
 boolean addWorkers(java.util.Collection<ApacheWorker> 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
static boolean delete(ApachePool ap)
           
 boolean equals(java.lang.Object o)
           
 ApachePool fillObject(java.sql.ResultSet r)
          Creates the Dao from the passed resultset, internally calling the appriate constructor.
 ApachePool get(int id)
           
 java.util.Collection<VirtualHost> getAllVirtualhosts()
           
static ApachePool getApachePool(int id)
           
static ApachePool getApachePool(VirtualHost vh)
           
static java.util.Collection<ApachePool> getApachePools()
           
static java.util.Collection<ApachePool> getApachePools(ApacheWorker aw)
           
static java.util.Collection<ApachePool> getApachePools(java.lang.String name)
           
 java.util.Collection<ApacheWorker> getApaches()
           
 java.util.Collection<ApacheWorker> getApaches(Instance i)
           
 Environment getEnv()
           
 int getEnvId()
           
 java.util.Collection<Hardware> getHardwares()
           
 java.lang.String getName()
          Gets the name.
 int getPk()
          Gets the primary key
 int hashCode()
           
 boolean removeWorker(ApacheWorker aw)
           
 boolean removeWorkers(java.util.Collection<ApacheWorker> c)
           
 void setApaches(java.util.Collection<ApacheWorker> apaches)
           
 void setEnv(Environment env)
           
 void setEnvId(int envId)
           
 void setName(java.lang.String name)
           
 void setPk(int pk)
           
static ApachePool store(ApachePool ap)
           
 java.lang.String toString()
           
static boolean update(ApachePool ap)
           
 
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

ApachePool

public ApachePool()

ApachePool

public ApachePool(Environment env,
                  java.lang.String name)

ApachePool

public ApachePool(int id,
                  java.lang.String name,
                  int envId)
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

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)

setPk

public void setPk(int pk)

getEnv

public Environment getEnv()

setEnv

public void setEnv(Environment env)

getEnvId

public int getEnvId()

setEnvId

public void setEnvId(int envId)

getApaches

public java.util.Collection<ApacheWorker> getApaches()

getApaches

public java.util.Collection<ApacheWorker> getApaches(Instance i)

getHardwares

public java.util.Collection<Hardware> getHardwares()

setApaches

public void setApaches(java.util.Collection<ApacheWorker> apaches)

store

public static ApachePool store(ApachePool ap)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

update

public static boolean update(ApachePool ap)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

delete

public static boolean delete(ApachePool ap)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

get

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

getApachePool

public static ApachePool getApachePool(int id)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

getApachePools

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

getApachePool

public static ApachePool getApachePool(VirtualHost vh)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

getApachePools

public static java.util.Collection<ApachePool> getApachePools()
                                                       throws java.sql.SQLException
Throws:
java.sql.SQLException

getApachePools

public static java.util.Collection<ApachePool> getApachePools(ApacheWorker aw)
                                                       throws java.sql.SQLException
Throws:
java.sql.SQLException

fillObject

public ApachePool 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<ApachePool>
Parameters:
r - the resultset from a database call, should include the entire object
Returns:
Object populated from the resultset
Throws:
java.sql.SQLException

addWorker

public boolean addWorker(ApacheWorker aw)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

removeWorker

public boolean removeWorker(ApacheWorker aw)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

addWorkers

public boolean addWorkers(java.util.Collection<ApacheWorker> c)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getAllVirtualhosts

public java.util.Collection<VirtualHost> getAllVirtualhosts()
                                                     throws java.sql.SQLException
Throws:
java.sql.SQLException

removeWorkers

public boolean removeWorkers(java.util.Collection<ApacheWorker> c)
                      throws java.sql.SQLException
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.

Specified by:
buildShortXMLRepresentation in interface Restable
Returns:
the xml representation

buildXMLRepresention

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

Specified by:
buildXMLRepresention in interface Restable
Returns:
the xml representation

toString

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

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