org.apache.lokahi.core.api.pool
Class HostingPool

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

public class HostingPool
extends TMCDao<HostingPool>
implements Pool

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

Constructor Summary
HostingPool()
           
HostingPool(int id, java.lang.String name, int apachePoolid, int tomcatPoolId, int envId)
           
HostingPool(java.lang.String name, ApachePool apachePool, TomcatPool tomcatPool, Environment env)
           
 
Method Summary
 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 equals(java.lang.Object o)
           
 HostingPool fillObject(java.sql.ResultSet r)
          Creates the Dao from the passed resultset, internally calling the appriate constructor.
 HostingPool get(int id)
           
 ApachePool getApachePool()
           
 int getApachePoolId()
           
 Environment getEnv()
           
 int getEnvId()
           
static HostingPool getHostingPool(int id, boolean fromCache)
           
static java.util.Collection<HostingPool> getHostingPools()
           
static java.util.Collection<HostingPool> getHostingPools(ApachePool ap, boolean fromCache)
           
static java.util.Collection<HostingPool> getHostingPools(ApacheWorker aw, boolean fromCache)
           
static java.util.Collection<HostingPool> getHostingPools(java.lang.String name, boolean fromCache)
           
static java.util.Collection<HostingPool> getHostingPools(TomcatPool tp, boolean fromCache)
           
 java.util.Collection<Ip> getIps()
           
 java.lang.String getName()
          Gets the name.
 int getPk()
          Gets the primary key
 TomcatPool getTomcatPool()
           
 int getTomcatPoolId()
           
 java.util.Collection<VirtualHost> getVirtualhosts()
           
 int hashCode()
           
 boolean isContextAllowed(java.util.Collection<TomcatContext> c)
           
 boolean isContextAllowed(java.lang.String contextName)
           
 boolean isContextAllowed(java.lang.String[] names)
           
 boolean isContextAllowed(TomcatContext tc)
          This method returns true if the vhost name does not already exist in any of our apache workers vhost tables.
 boolean isVhostAllowed(java.lang.String vhostName)
           
 boolean isVhostAllowed(VirtualHost vh)
          This method returns true if the vhost name does not already exist in any of our apache workers vhost tables.
 void setApachePool(ApachePool apachePool)
           
 void setApachePoolId(int apachePoolId)
           
 void setEnv(Environment env)
           
 void setEnvId(int envId)
           
 void setName(java.lang.String name)
           
 void setPk(int id)
           
 void setTomcatPool(TomcatPool tomcatPool)
           
 void setTomcatPoolId(int tomcatPoolId)
           
 void setVirtualhosts(java.util.Collection<VirtualHost> virtualhosts)
           
 java.lang.String toString()
           
 
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

HostingPool

public HostingPool()

HostingPool

public HostingPool(java.lang.String name,
                   ApachePool apachePool,
                   TomcatPool tomcatPool,
                   Environment env)

HostingPool

public HostingPool(int id,
                   java.lang.String name,
                   int apachePoolid,
                   int tomcatPoolId,
                   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

setPk

public void setPk(int id)

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)

getApachePoolId

public int getApachePoolId()

setApachePoolId

public void setApachePoolId(int apachePoolId)

getTomcatPoolId

public int getTomcatPoolId()

setTomcatPoolId

public void setTomcatPoolId(int tomcatPoolId)

getEnvId

public int getEnvId()

setEnvId

public void setEnvId(int envId)

getEnv

public Environment getEnv()

setEnv

public void setEnv(Environment env)

getTomcatPool

public TomcatPool getTomcatPool()

setTomcatPool

public void setTomcatPool(TomcatPool tomcatPool)

getApachePool

public ApachePool getApachePool()

setApachePool

public void setApachePool(ApachePool apachePool)

getVirtualhosts

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

setVirtualhosts

public void setVirtualhosts(java.util.Collection<VirtualHost> virtualhosts)

fillObject

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

isVhostAllowed

public boolean isVhostAllowed(VirtualHost vh)
This method returns true if the vhost name does not already exist in any of our apache workers vhost tables.


isVhostAllowed

public boolean isVhostAllowed(java.lang.String vhostName)

isContextAllowed

public boolean isContextAllowed(TomcatContext tc)
This method returns true if the vhost name does not already exist in any of our apache workers vhost tables.


isContextAllowed

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

isContextAllowed

public boolean isContextAllowed(java.lang.String contextName)

isContextAllowed

public boolean isContextAllowed(java.lang.String[] names)

getIps

public java.util.Collection<Ip> getIps()

getHostingPool

public static HostingPool getHostingPool(int id,
                                         boolean fromCache)
                                  throws java.sql.SQLException
Throws:
java.sql.SQLException

getHostingPools

public static java.util.Collection<HostingPool> getHostingPools()
                                                         throws java.sql.SQLException
Throws:
java.sql.SQLException

getHostingPools

public static java.util.Collection<HostingPool> getHostingPools(ApacheWorker aw,
                                                                boolean fromCache)
                                                         throws java.sql.SQLException
Throws:
java.sql.SQLException

getHostingPools

public static java.util.Collection<HostingPool> getHostingPools(java.lang.String name,
                                                                boolean fromCache)
                                                         throws java.sql.SQLException
Throws:
java.sql.SQLException

getHostingPools

public static java.util.Collection<HostingPool> getHostingPools(ApachePool ap,
                                                                boolean fromCache)
                                                         throws java.sql.SQLException
Throws:
java.sql.SQLException

getHostingPools

public static java.util.Collection<HostingPool> getHostingPools(TomcatPool tp,
                                                                boolean fromCache)
                                                         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

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

get

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