org.apache.lokahi.tomcat.api.worker
Class TomcatWorker

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

public class TomcatWorker
extends TMCDao<TomcatWorker>
implements Server

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

Constructor Summary
TomcatWorker()
           
TomcatWorker(Hardware hardware, State state, Tomcat tomcat)
           
TomcatWorker(Hardware h, Tomcat t)
           
TomcatWorker(int tomcatId, int hardwareId)
           
TomcatWorker(int workerId, int hardwareId, int stateId, int tomcatId)
          Deprecated.  
TomcatWorker(int workerId, int stateId, Tomcat t, Hardware h)
           
 
Method Summary
 java.lang.String buildConfForWeb()
           
 java.lang.String buildServerXML()
          Deprecated.  
 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(TomcatWorker tw)
           
 boolean equals(java.lang.Object o)
           
 TomcatWorker fillObject(java.sql.ResultSet r)
          Creates the Dao from the passed resultset, internally calling the appriate constructor.
 TomcatWorker get(int id)
           
 java.util.Collection<TomcatContext> getAllContexts()
           
 Hardware getHardware()
           
 int getHardwareId()
           
 java.lang.String getName()
          Gets the name.
 int getPk()
          Gets the primary key
 State getState()
           
 int getStateId()
           
 Tomcat getTomcat()
           
 int getTomcatId()
           
static TomcatWorker getTomcatWorker(Hardware h, Tomcat t, boolean cache)
           
static TomcatWorker getTomcatWorker(int id, boolean cache)
           
static java.util.Collection<TomcatWorker> getTomcatWorkers(boolean cache)
           
static java.util.Collection<TomcatWorker> getTomcatWorkers(Hardware h, boolean cache)
           
static java.util.Collection<TomcatWorker> getTomcatWorkers(int poolId, boolean cache)
           
static java.util.Collection<TomcatWorker> getTomcatWorkers(java.lang.String name, boolean cache)
           
static java.util.Collection<TomcatWorker> getTomcatWorkers(java.lang.String name, Instance i, boolean cache)
           
static java.util.Collection<TomcatWorker> getTomcatWorkers(Tomcat t, boolean cache)
           
static java.util.Collection<TomcatWorker> getTomcatWorkers(TomcatPool tp, boolean cache)
           
 int getType()
           
 int getWorkerId()
           
 java.lang.String getWorkerName()
           
 int hashCode()
           
 boolean isActive()
           
 void setHardware(Hardware hardware)
           
 void setHardwareId(int hardwareId)
           
 void setName(java.lang.String name)
           
 void setPk(int pk)
           
 void setState(State state)
           
 void setStateId(int stateId)
           
 void setTomcat(Tomcat tomcat)
           
 void setTomcatId(int workerId)
           
 void setWorkerId(int workerId)
           
static TomcatWorker store(TomcatWorker tw)
           
static void update(TomcatWorker tw)
           
 
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, toString, wait, wait, wait
 

Constructor Detail

TomcatWorker

public TomcatWorker()

TomcatWorker

public TomcatWorker(Hardware hardware,
                    State state,
                    Tomcat tomcat)

TomcatWorker

public TomcatWorker(int workerId,
                    int hardwareId,
                    int stateId,
                    int tomcatId)
Deprecated. 


TomcatWorker

public TomcatWorker(int workerId,
                    int stateId,
                    Tomcat t,
                    Hardware h)

TomcatWorker

public TomcatWorker(int tomcatId,
                    int hardwareId)

TomcatWorker

public TomcatWorker(Hardware h,
                    Tomcat t)
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)

getWorkerId

public int getWorkerId()

getTomcatId

public int getTomcatId()

setWorkerId

public void setWorkerId(int workerId)

setTomcatId

public void setTomcatId(int workerId)

getWorkerName

public java.lang.String getWorkerName()

getHardwareId

public int getHardwareId()

setHardwareId

public void setHardwareId(int hardwareId)

getStateId

public int getStateId()

setStateId

public void setStateId(int stateId)

getHardware

public Hardware getHardware()

setHardware

public void setHardware(Hardware hardware)

getTomcat

public Tomcat getTomcat()

setTomcat

public void setTomcat(Tomcat tomcat)

getState

public State getState()

setState

public void setState(State state)

isActive

public boolean isActive()

getType

public int getType()

getAllContexts

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

fillObject

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

buildServerXML

public java.lang.String buildServerXML()
                                throws java.sql.SQLException
Deprecated. 

Throws:
java.sql.SQLException

getTomcatWorkers

public static java.util.Collection<TomcatWorker> getTomcatWorkers(TomcatPool tp,
                                                                  boolean cache)
                                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

buildConfForWeb

public java.lang.String buildConfForWeb()

update

public static void update(TomcatWorker tw)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

delete

public static boolean delete(TomcatWorker tw)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

store

public static TomcatWorker store(TomcatWorker tw)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

getTomcatWorkers

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

getTomcatWorkers

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

get

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

getTomcatWorker

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

getTomcatWorker

public static TomcatWorker getTomcatWorker(Hardware h,
                                           Tomcat t,
                                           boolean cache)
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getTomcatWorkers

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

getTomcatWorkers

public static java.util.Collection<TomcatWorker> getTomcatWorkers(Tomcat t,
                                                                  boolean cache)
                                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getTomcatWorkers

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

getTomcatWorkers

public static java.util.Collection<TomcatWorker> getTomcatWorkers(java.lang.String name,
                                                                  Instance i,
                                                                  boolean cache)
                                                           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