org.apache.lokahi.httpd.api.worker
Class ApacheWorker

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

public class ApacheWorker
extends TMCDao<ApacheWorker>
implements Server

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

Constructor Summary
ApacheWorker()
           
ApacheWorker(int apacheId, int hardwareId)
           
ApacheWorker(int pk, int stateId, Apache apache, Hardware h)
           
ApacheWorker(int pk, int apacheId, int stateId, int hardwareId)
           
ApacheWorker(State state, Hardware hardware, Apache apache, ApachePool aPool)
           
 
Method Summary
 java.lang.String buildConfForWeb()
           
 java.lang.StringBuilder buildShortXMLRepresentation()
          Builds a short xml representation of this object containing name, and primary key.
 java.lang.String buildWorkersProperties()
           
 java.lang.StringBuilder buildXMLRepresention()
          Builds a xml representation of this object
static boolean delete(ApacheWorker aw)
           
 boolean equals(java.lang.Object o)
           
 ApacheWorker fillObject(java.sql.ResultSet r)
          Creates the Dao from the passed resultset, internally calling the appriate constructor.
 ApacheWorker get(int id)
           
 Apache getApache()
           
 int getApacheId()
           
static ApacheWorker getApacheWorker(int id, boolean cache)
           
static ApacheWorker getApacheWorker(int apacheId, int hardwareId, boolean cache)
           
static java.util.Collection<ApacheWorker> getApacheWorkers(Apache a, boolean cache)
           
static java.util.Collection<ApacheWorker> getApacheWorkers(boolean cache)
           
static java.util.Collection<ApacheWorker> getApacheWorkers(Hardware h, boolean cache)
           
static java.util.Collection<ApacheWorker> getApacheWorkers(int poolId, boolean cache)
           
static java.util.Collection<ApacheWorker> getApacheWorkers(java.lang.String name, boolean cache)
           
static java.util.Collection<ApacheWorker> getApacheWorkers(java.lang.String name, Instance i, boolean cache)
           
 Hardware getHardware()
           
 int getHardwareId()
           
 java.lang.String getName()
          Gets the name.
 int getPk()
          Gets the primary key
 int getPoolId()
           
 State getState()
           
 int getStateId()
           
 int hashCode()
           
 boolean isActive()
           
 void setApache(Apache apache)
           
 void setApacheId(int apacheId)
           
 void setHardware(Hardware hardware)
           
 void setHardwareId(int hardwareId)
           
 void setName(java.lang.String name)
           
 void setPk(int pk)
           
 void setPoolId(int poolId)
           
 void setState(State state)
           
 void setStateId(int stateId)
           
static ApacheWorker store(ApacheWorker aw)
           
 java.lang.String toString()
           
static void update(ApacheWorker aw)
           
 
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

ApacheWorker

public ApacheWorker()

ApacheWorker

public ApacheWorker(State state,
                    Hardware hardware,
                    Apache apache,
                    ApachePool aPool)

ApacheWorker

public ApacheWorker(int apacheId,
                    int hardwareId)

ApacheWorker

public ApacheWorker(int pk,
                    int apacheId,
                    int stateId,
                    int hardwareId)

ApacheWorker

public ApacheWorker(int pk,
                    int stateId,
                    Apache apache,
                    Hardware h)
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)

getApacheId

public int getApacheId()

setApacheId

public void setApacheId(int apacheId)

getStateId

public int getStateId()

setStateId

public void setStateId(int stateId)

getHardwareId

public int getHardwareId()

setHardwareId

public void setHardwareId(int hardwareId)

getState

public State getState()

setState

public void setState(State state)

getHardware

public Hardware getHardware()

setHardware

public void setHardware(Hardware hardware)

getApache

public Apache getApache()

setApache

public void setApache(Apache apache)

getPoolId

public int getPoolId()

setPoolId

public void setPoolId(int poolId)

isActive

public boolean isActive()

get

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

getApacheWorker

public static ApacheWorker getApacheWorker(int id,
                                           boolean cache)
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getApacheWorker

public static ApacheWorker getApacheWorker(int apacheId,
                                           int hardwareId,
                                           boolean cache)
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getApacheWorkers

public static java.util.Collection<ApacheWorker> getApacheWorkers(boolean cache)
                                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getApacheWorkers

public static java.util.Collection<ApacheWorker> getApacheWorkers(int poolId,
                                                                  boolean cache)
                                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getApacheWorkers

public static java.util.Collection<ApacheWorker> getApacheWorkers(java.lang.String name,
                                                                  boolean cache)
                                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getApacheWorkers

public static java.util.Collection<ApacheWorker> getApacheWorkers(java.lang.String name,
                                                                  Instance i,
                                                                  boolean cache)
                                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getApacheWorkers

public static java.util.Collection<ApacheWorker> getApacheWorkers(Hardware h,
                                                                  boolean cache)
                                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getApacheWorkers

public static java.util.Collection<ApacheWorker> getApacheWorkers(Apache a,
                                                                  boolean cache)
                                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

fillObject

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

store

public static ApacheWorker store(ApacheWorker aw)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

update

public static void update(ApacheWorker aw)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

delete

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

buildConfForWeb

public java.lang.String buildConfForWeb()

buildWorkersProperties

public java.lang.String buildWorkersProperties()
                                        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