incubator-lokahi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tob...@apache.org
Subject svn commit: r581309 - in /incubator/lokahi/lokahi/trunk: ./ conf/ database/ database/mysql/ database/oracle/ src/java/org/apache/lokahi/core/api/file/ src/java/org/apache/lokahi/core/common/database/ src/java/org/apache/lokahi/core/controller/ src/java...
Date Tue, 02 Oct 2007 17:00:52 GMT
Author: toback
Date: Tue Oct  2 10:00:50 2007
New Revision: 581309

URL: http://svn.apache.org/viewvc?rev=581309&view=rev
Log:
Merged MySQL branch into trunk.

Added:
    incubator/lokahi/lokahi/trunk/database/mysql/
      - copied from r581286, incubator/lokahi/lokahi/branches/mysql/database/mysql/
    incubator/lokahi/lokahi/trunk/database/mysql/README-MYSQL.txt
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/mysql/README-MYSQL.txt
    incubator/lokahi/lokahi/trunk/database/mysql/procs.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/mysql/procs.sql
    incubator/lokahi/lokahi/trunk/database/mysql/tables.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/mysql/tables.sql
    incubator/lokahi/lokahi/trunk/database/mysql/tmc_instance_data.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/mysql/tmc_instance_data.sql
    incubator/lokahi/lokahi/trunk/database/mysql/tmc_rel_function_user_data.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/mysql/tmc_rel_function_user_data.sql
    incubator/lokahi/lokahi/trunk/database/mysql/tmc_user_data.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/mysql/tmc_user_data.sql
    incubator/lokahi/lokahi/trunk/database/mysql/views.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/mysql/views.sql
    incubator/lokahi/lokahi/trunk/database/oracle/
      - copied from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/
    incubator/lokahi/lokahi/trunk/database/oracle/functions.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/functions.sql
    incubator/lokahi/lokahi/trunk/database/oracle/install.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/install.sql
    incubator/lokahi/lokahi/trunk/database/oracle/packages.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/packages.sql
    incubator/lokahi/lokahi/trunk/database/oracle/procs.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/procs.sql
    incubator/lokahi/lokahi/trunk/database/oracle/recompile.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/recompile.sql
    incubator/lokahi/lokahi/trunk/database/oracle/schema_priv.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/schema_priv.sql
    incubator/lokahi/lokahi/trunk/database/oracle/sequences.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/sequences.sql
    incubator/lokahi/lokahi/trunk/database/oracle/tables.sql
      - copied, changed from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/tables.sql
    incubator/lokahi/lokahi/trunk/database/oracle/tmc_instance_data.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/tmc_instance_data.sql
    incubator/lokahi/lokahi/trunk/database/oracle/tmc_rel_function_user_data.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/tmc_rel_function_user_data.sql
    incubator/lokahi/lokahi/trunk/database/oracle/tmc_user_data.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/tmc_user_data.sql
    incubator/lokahi/lokahi/trunk/database/oracle/triggers.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/triggers.sql
    incubator/lokahi/lokahi/trunk/database/oracle/views.sql
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/views.sql
    incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/common/database/MySqlBroker.java
      - copied unchanged from r581286, incubator/lokahi/lokahi/branches/mysql/src/java/org/apache/lokahi/core/common/database/MySqlBroker.java
Removed:
    incubator/lokahi/lokahi/trunk/database/functions.sql
    incubator/lokahi/lokahi/trunk/database/install.sql
    incubator/lokahi/lokahi/trunk/database/packages.sql
    incubator/lokahi/lokahi/trunk/database/procs.sql
    incubator/lokahi/lokahi/trunk/database/recompile.sql
    incubator/lokahi/lokahi/trunk/database/schema_priv.sql
    incubator/lokahi/lokahi/trunk/database/sequences.sql
    incubator/lokahi/lokahi/trunk/database/tables.sql
    incubator/lokahi/lokahi/trunk/database/tmc_instance_data.sql
    incubator/lokahi/lokahi/trunk/database/tmc_rel_function_user_data.sql
    incubator/lokahi/lokahi/trunk/database/tmc_user_data.sql
    incubator/lokahi/lokahi/trunk/database/triggers.sql
    incubator/lokahi/lokahi/trunk/database/views.sql
Modified:
    incubator/lokahi/lokahi/trunk/STATUS
    incubator/lokahi/lokahi/trunk/build.properties
    incubator/lokahi/lokahi/trunk/conf/db.properties
    incubator/lokahi/lokahi/trunk/conf/lokahi.properties
    incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/api/file/File.java
    incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/common/database/CachingBroker.java
    incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/common/database/ConnBean.java
    incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/controller/AdminBean.java
    incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/gui/www/TMCStartupServlet.java

Modified: incubator/lokahi/lokahi/trunk/STATUS
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/STATUS?rev=581309&r1=581308&r2=581309&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/STATUS (original)
+++ incubator/lokahi/lokahi/trunk/STATUS Tue Oct  2 10:00:50 2007
@@ -1,6 +1,12 @@
 Current To-do:
 ======================
 
+Make the org.apache.lokahi.core.controller.AdminBean able to support databases other than
oracle.
+
+
+
+
+
 Major:
 ======================
 Refactor the TMC* classes to a final Lokahi name to provide a final api.

Modified: incubator/lokahi/lokahi/trunk/build.properties
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/build.properties?rev=581309&r1=581308&r2=581309&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/build.properties (original)
+++ incubator/lokahi/lokahi/trunk/build.properties Tue Oct  2 10:00:50 2007
@@ -26,14 +26,7 @@
 # Set tomcat.home to be the path to your installation of Tomcat
 # on your build server.
 #
-tomcat.home=/opt/tmc/tomcat5.5.9/
-
-
-# Set java.home to be the path to your installation of JDK 1.5
-# on your build server.
-#
-java.home=/usr/local/java/jdk1.5.0_04/
-
+tomcat.home=/usr/local/tomcat-5.5.20/
 
 #
 #
@@ -52,7 +45,7 @@
 #app.virtualhost.name=www.mydomain.com
 #app.virtualhost.name=hostname:1234
 #
-app.virtualhost.name=hostname:8058
+app.virtualhost.name=192.168.0.5:8050
 
 # By default, app.authenticationmodule is set to NoAuthentication
 # so you can get it working relatively quickly.
@@ -74,7 +67,7 @@
 # This file will exist only on the machines hosting the
 # Lokahi GUI and controller.
 #
-console.log.location=/www/httpd/logs/websites/lokahi_log4j.log
+console.log.location=/tmp/lokahi_log4j.log
 
 
 # Set agent.log.location to the path where you want log messages
@@ -82,7 +75,7 @@
 # managed by Lokahi will have the Lokahi agent installed
 # on them, and will record their messages in this location.
 #
-agent.log.location=/www/httpd/logs/websites/agent_log4j.log
+agent.log.location=/tmp/agent_log4j.log
 
 
 # This release of Lokahi supports only Oracle databases.
@@ -92,10 +85,10 @@
 #database.password=<PASSWORD>
 #database.driver=<DRIVER>
 #
-database.uri=jdbc:oracle:thin:@<HOST_ALIAS>:<PORT>:<SCHEMA>
-database.user=<USERNAME>
-database.password=<PASSWORD>
-database.driver=oracle.jdbc.driver.OracleDriver
+database.uri=jdbc:mysql://192.168.0.5:3306/lokahi
+database.user=lokdb
+database.password=lokdbpass
+database.driver=com.mysql.jdbc.Driver
 
 
 # Lokahi pre-populates your database with the initial instance
@@ -103,12 +96,12 @@
 # see the glossary on the Lokahi website.
 # http://incubator.apache.org/lokahi/glossary.html
 #
-initial.instance.name=
+initial.instance.name=ASF
 
 
 # Set initial.user.name to the userID of the superuser account.
 #
-initial.user.name=
+initial.user.name=toback
 
 
 # Set install.location to where you want the Lokahi home directory to be.
@@ -118,13 +111,13 @@
 #
 # Agent install location, also refered to as $AGENT_HOME
 #
-agent.install.location=
+agent.install.location=/tmp/agent
 
 app.home=.
 app.lib=${app.home}/lib
 app.conf=${app.home}/conf
 app.src=${app.home}/src
-app.src.db=${app.home}/database
+app.src.db=${app.home}/database/oracle
 app.src.doc=${app.home}/docs
 app.src.java=${app.src}/java
 app.src.www=${app.src}/www

Modified: incubator/lokahi/lokahi/trunk/conf/db.properties
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/conf/db.properties?rev=581309&r1=581308&r2=581309&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/conf/db.properties (original)
+++ incubator/lokahi/lokahi/trunk/conf/db.properties Tue Oct  2 10:00:50 2007
@@ -222,4 +222,221 @@
 oracle.apache.server.by.name=F_AM_GET_APACHE_BY_name
 oracle.tomcat.worker.by.server=F_TM_GET_TW_BY_TM
 oracle.apache.worker.by.server=F_AM_GET_AW_BY_AID
-oracle.core.pool.by.tomcatpool=F_TM_GET_HPOOLS_BY_TPID
\ No newline at end of file
+oracle.core.pool.by.tomcatpool=F_TM_GET_HPOOLS_BY_TPID
+
+#
+# MySQL - Standard
+#
+
+mysql.apache.server.by.id=SELECT ap.CONTAINER_ID, ap.CONTAINER_NAME, ap.LOG_LOCATION, ap.ENV_VARIBLES,
ap.FORK_WAIT, ap.PIDFILE_LOCATION, ap.RESTART_COMMAND, ap.START_COMMAND, ap.STOP_COMMAND,
ap.SYS_GROUP, ap.SYS_USER, ap.SERVER_ROOT, ap.MAIN_ID FROM AM_CONTAINER ap WHERE ap.CONTAINER_ID
= ?
+mysql.apache.server.all=SELECT ap.CONTAINER_ID, ap.CONTAINER_NAME, ap.LOG_LOCATION, ap.ENV_VARIBLES,
ap.FORK_WAIT, ap.PIDFILE_LOCATION, ap.RESTART_COMMAND, ap.START_COMMAND, ap.STOP_COMMAND,
ap.SYS_GROUP, ap.SYS_USER, ap.SERVER_ROOT, ap.main_ID FROM AM_CONTAINER ap
+mysql.apache.server.store=sp_am_store_apache
+mysql.apache.server.update=sp_am_update_apache
+mysql.apache.server.delete=sp_am_drop_apache
+mysql.apache.pool.store=sp_am_store_pool
+mysql.apache.pool.update=sp_am_update_pool
+mysql.apache.pool.delete=sp_am_drop_pool
+mysql.apache.pool.by.id=SELECT p.POOL_ID, p.POOL_NAME, p.ENV_ID FROM AM_POOL p WHERE p.POOL_ID=?
+mysql.apache.pool.by.name=SELECT p.POOL_ID, p.POOL_NAME, p.ENV_ID FROM AM_POOL p WHERE lower(p.POOL_name)
like lower(?)
+mysql.apache.pool.by.vhost=SELECT p.POOL_ID, p.POOL_NAME, p.ENV_ID FROM AM_POOL p, TMC_REL_HOSTING_MODULES
rhp, AM_VHOST vh WHERE p.POOL_ID=rhp.AM_POOL_ID AND rhp.HOSTING_POOL_ID=vh.HOSTING_POOL_ID
AND vh.VHOST_ID=?
+mysql.apache.pool.all=SELECT p.POOL_ID, p.POOL_NAME, p.ENV_ID FROM AM_POOL p
+mysql.apache.pool.by.worker=SELECT p.POOL_ID, p.POOL_NAME, p.ENV_ID FROM AM_POOL p, AM_REL_POOL_WORKER
rel WHERE p.POOL_ID=rel.POOL_ID and rel.WORKER_ID=?
+mysql.apache.pool.rel.worker.add=sp_am_store_worker_pool
+mysql.apache.pool.rel.worker.delete=sp_am_delete_worker_pool
+mysql.apache.worker.by.id=SELECT * FROM AM_WORKER_VIEW aw where aw.WORKER_ID=?
+mysql.apache.worker.by.server.hardware=SELECT * FROM AM_WORKER_VIEW aw where aw.CONTAINER_ID=?
AND aw.HARDWARE_ID=?
+mysql.apache.worker.all=SELECT * FROM AM_WORKER_VIEW
+mysql.apache.worker.by.pool=SELECT worker_id, aw.container_id, aw.state_id, aw.hardware_id,
aw.container_name, aw.server_root, aw.log_location, aw.sys_user, aw.sys_group, aw.start_command,
aw.stop_command, aw.restart_command, aw.fork_wait, aw.pidfile_location, aw.env_varibles, aw.main_id,
aw.hardware_name, aw.physical_location, aw.comments, aw.instance_id, aw.env_id, aw.hardware_state_id,
aw.default_ip_id FROM (AM_WORKER_VIEW aw JOIN AM_REL_POOL_WORKER using (WORKER_ID)) where
pool_id=?
+mysql.apache.worker.by.name=SELECT * FROM AM_WORKER_VIEW aw where lower(hardware_name) like
lower(?)
+mysql.apache.worker.by.name.instance=SELECT * FROM AM_WORKER_VIEW aw where hardware_name
like "?" AND instance_id = ?
+mysql.apache.worker.by.hardware=SELECT * FROM AM_WORKER_VIEW aw where aw.HARDWARE_ID=?
+mysql.apache.worker.store=sp_am_store_worker
+mysql.apache.worker.update=sp_am_update_worker
+mysql.apache.worker.delete=sp_am_drop_worker
+mysql.core.environment.by.id=SELECT e.ENV_ID, e.ENV_NAME, e.COMMENTS FROM TMC_ENV e WHERE
e.ENV_ID = ?
+mysql.core.environment.by.project=SELECT unique e.env_id, e.env_name, e.comments FROM TMC_ENV
e, AM_REL_ENTITY_Project ag, AM_VHOST v where ag.vhost_id = v.vhost_id and v.env_id = e.env_id
and ag.project_id = ?
+mysql.core.environment.all=SELECT e.ENV_ID, e.ENV_NAME, e.COMMENTS FROM TMC_ENV e
+mysql.core.environment.store=sp_tmc_store_enviroment
+mysql.core.environment.update=sp_tmc_update_enviroment
+mysql.core.environment.delete=sp_tmc_drop_environment
+mysql.core.file.by.id=SELECT f.FILE_ID, f.FILE_NAME, f.FILE_DESCRIPTOR, f.FILE_PATH, f.file_content
FROM TMC_FILES f WHERE f.FILE_ID=?
+mysql.core.file.delete=sp_tmc_drop_file
+mysql.core.file.all=SELECT f.FILE_ID, f.FILE_NAME, f.FILE_DESCRIPTOR, f.FILE_PATH, f.file_content
FROM TMC_FILES f
+mysql.core.function.by.id=SELECT f.FUNCTION_ID, f.FUNCTION_COMMAND, f.FUNCTION_NAME FROM
TMC_FUNCTION f WHERE f.FUNCTION_ID = ?
+mysql.core.function.by.command=SELECT f.FUNCTION_COMMAND, f.FUNCTION_ID, f.FUNCTION_NAME
FROM TMC_FUNCTION f WHERE f.FUNCTION_COMMAND = v_command
+mysql.core.function.all=SELECT f.FUNCTION_ID, f.FUNCTION_COMMAND, f.FUNCTION_NAME FROM TMC_FUNCTION
f
+mysql.core.function.store=sp_tmc_store_function
+mysql.core.function.update=sp_tmc_update_function
+mysql.core.function.delete=sp_tmc_drop_function
+mysql.core.server.rel.ip.add=sp_tmc_add_hardware_ip
+mysql.core.server.rel.ip.delete=sp_tmc_delete_hardware_ip
+mysql.core.server.by.id=SELECT h.HARDWARE_ID, h.INSTANCE_ID, h.ENV_ID, h.PHYSICAL_LOCATION,
h.HARDWARE_NAME, h.STATUS_ID, h.COMMENTS, h.DEFAULT_IP_ID FROM TMC_HARDWARE h WHERE h.HARDWARE_ID
= ?
+mysql.core.server.by.name.instance=SELECT h.HARDWARE_ID, h.INSTANCE_ID, h.ENV_ID, h.PHYSICAL_LOCATION,
h.HARDWARE_NAME, h.STATUS_ID, h.COMMENTS, h.DEFAULT_IP_ID FROM TMC_HARDWARE h WHERE h.HARDWARE_NAME
= "?" AND h.INSTANCE_ID=?
+# TODO: Steve T. should check if this is adequate
+mysql.core.server.by.environment=SELECT h.HARDWARE_ID, h.INSTANCE_ID, h.ENV_ID, h.PHYSICAL_LOCATION,
h.HARDWARE_NAME, h.STATUS_ID, h.COMMENTS, h.DEFAULT_IP_ID FROM TMC_HARDWARE h WHERE h.ENV_ID
= ?
+mysql.core.server.all=SELECT h.HARDWARE_ID, h.INSTANCE_ID, h.ENV_ID, h.PHYSICAL_LOCATION,
h.HARDWARE_NAME, h.STATUS_ID, h.COMMENTS, h.DEFAULT_IP_ID FROM TMC_HARDWARE h
+mysql.core.server.store=sp_tmc_store_hardware
+mysql.core.server.update=sp_tmc_update_hardware
+mysql.core.server.delete=sp_tmc_drop_server
+mysql.core.state.store=sp_tmc_store_state
+mysql.core.state.update=sp_tmc_update_state
+mysql.core.state.all=SELECT s.STATE_NAME, s.STATE_ID, s.STATE_COLOR FROM TMC_STATE s
+mysql.core.state.delete=sp_tmc_drop_state
+mysql.core.state.by.id=SELECT s.STATE_NAME, s.STATE_ID, s.STATE_COLOR FROM TMC_STATE s WHERE
s.STATE_ID = ?
+mysql.core.pool.update=sp_tmc_update_hostingpool
+mysql.core.pool.store=sp_tmc_store_hostingpool
+mysql.core.pool.delete=sp_tmc_drop_hostingpool
+mysql.core.pool.by.id=SELECT hp.HOSTING_POOL_ID, hp.HOSTING_POOL_NAME, hp.ENV_ID, rel.AM_POOL_ID,
rel.TM_POOL_ID FROM TMC_Hosting_Pool hp, TMC_REL_HOSTING_MODULES rel Where rel.HOSTING_POOL_ID
= hp.HOSTING_POOL_ID AND hp.HOSTING_POOL_ID=?
+mysql.core.pool.all=SELECT hp.HOSTING_POOL_ID, hp.HOSTING_POOL_NAME, hp.ENV_ID, rel.AM_POOL_ID,
rel.TM_POOL_ID FROM TMC_Hosting_Pool hp, TMC_REL_HOSTING_MODULES rel Where rel.HOSTING_POOL_ID
= hp.HOSTING_POOL_ID
+mysql.core.pool.by.apacheworker=SELECT hp.HOSTING_POOL_ID, hp.HOSTING_POOL_NAME, hp.ENV_ID,
rel.AM_POOL_ID, rel.TM_POOL_ID FROM TMC_Hosting_Pool hp, TMC_REL_HOSTING_MODULES rel, AM_REL_POOL_WORKER
rpw Where rel.HOSTING_POOL_ID = hp.HOSTING_POOL_ID AND rel.AM_POOL_ID=rpw.POOL_ID AND rpw.WORKER_ID=v_id
+mysql.core.pool.by.name=SELECT hp.HOSTING_POOL_ID, hp.HOSTING_POOL_NAME, hp.ENV_ID, rel.AM_POOL_ID,
rel.TM_POOL_ID FROM TMC_Hosting_Pool hp, TMC_REL_HOSTING_MODULES rel Where rel.HOSTING_POOL_ID
= hp.HOSTING_POOL_ID AND lower(hp.HOSTING_POOL_name) like lower(?)
+mysql.core.pool.by.apachepool=SELECT hp.HOSTING_POOL_ID, hp.HOSTING_POOL_NAME, hp.ENV_ID,
rel.AM_POOL_ID, rel.TM_POOL_ID FROM TMC_Hosting_Pool hp, TMC_REL_HOSTING_MODULES rel, AM_REL_POOL_WORKER
rpw Where rel.HOSTING_POOL_ID = hp.HOSTING_POOL_ID AND rel.AM_POOL_ID=v_id
+mysql.core.instance.by.id=SELECT i.INSTANCE_NAME, i.INSTANCE_ID, i.COMMENTS FROM TMC_INSTANCE
i WHERE i.INSTANCE_ID = ?
+mysql.core.instance.all=SELECT i.INSTANCE_NAME, i.INSTANCE_ID, i.COMMENTS FROM TMC_INSTANCE
i
+mysql.core.instance.by.name=SELECT i.INSTANCE_NAME, i.INSTANCE_ID, i.COMMENTS FROM TMC_INSTANCE
i WHERE i.INSTANCE_NAME = ?
+mysql.core.instance.store=sp_tmc_store_instance
+mysql.core.instance.delete=sp_tmc_drop_instance
+mysql.core.instance.update=sp_tmc_update_instance
+mysql.core.ip.by.id=SELECT i.IP_ID, i.IP FROM TMC_IP i WHERE i.IP_ID = ?
+mysql.core.ip.by.name=SELECT i.IP_ID, i.IP FROM TMC_IP i WHERE i.IP = ?
+mysql.core.ip.by.hardware=SELECT hr.HARDWARE_ID, i.IP_ID, i.IP FROM TMC_REL_HARDWARE_IP hr,
TMC_IP i WHERE hr.HARDWARE_ID = ? AND i.IP_ID = hr.IP_ID
+mysql.core.ip.by.virtualhost=SELECT i.IP_ID, i.IP FROM TMC_IP i, AM_REL_VHOST_IP rel WHERE
i.IP_ID = rel.IP_ID AND rel.VHOST_ID=?
+mysql.core.ip.all=SELECT i.IP_ID, i.IP FROM TMC_IP i
+mysql.core.ip.store=sp_tmc_store_ip
+mysql.core.ip.update=sp_tmc_update_ip
+mysql.core.ip.delete=sp_tmc_drop_ip
+mysql.core.job.by.id=SELECT j.JOB_ID, j.POOL_ID, j.JOB_NAME, j.SERVER_ID, j.START_TIME, j.FINISH_TIME,
j.PARENT_ID, j.STATE_ID, j.OPTIONS, j.FUNCTION_ID, j.INSTANCE_ID, j.RESULT FROM TMC_JOB j
WHERE j.JOB_ID = ?
+mysql.core.job.all=SELECT j.JOB_ID, j.POOL_ID, j.JOB_NAME, j.SERVER_ID, j.START_TIME, j.FINISH_TIME,
j.PARENT_ID, j.STATE_ID, j.OPTIONS, j.FUNCTION_ID, j.INSTANCE_ID, j.RESULT FROM TMC_JOB j
+mysql.core.job.by.name=SELECT j.JOB_ID, j.POOL_ID, j.JOB_NAME, j.SERVER_ID, j.START_TIME,
j.FINISH_TIME, j.PARENT_ID, j.STATE_ID, j.OPTIONS, j.FUNCTION_ID, j.INSTANCE_ID, j.RESULT
FROM TMC_JOB j WHERE j.JOB_NAME = ?
+mysql.core.job.by.instance.state=SELECT j.JOB_ID, j.POOL_ID, j.JOB_NAME, j.SERVER_ID, j.START_TIME,
j.FINISH_TIME, j.PARENT_ID, j.STATE_ID, j.OPTIONS, j.FUNCTION_ID, j.INSTANCE_ID, j.RESULT
FROM TMC_JOB j, TMC_HARDWARE h WHERE j.INSTANCE_ID = ? AND j.STATE_ID=? AND h.hardware_id=j.SERVER_ID
AND h.status_id=8
+mysql.core.job.by.pool=SELECT j.JOB_ID, j.POOL_ID, j.JOB_NAME, j.SERVER_ID, j.START_TIME,
j.FINISH_TIME, j.PARENT_ID, j.STATE_ID, j.OPTIONS, j.FUNCTION_ID, j.INSTANCE_ID, j.RESULT
FROM TMC_JOB j WHERE j.POOL_ID = ?
+mysql.core.jobpool.update=sp_tmc_update_jobpool
+mysql.core.jobpool.store=sp_tmc_add_jobpool
+mysql.core.jobpool.finalize=sp_tmc_finalize_jobpool
+mysql.core.jobpool.by.id=SELECT JOB_POOL_ID, JOB_POOL_NAME, PROJECT_ID, USER_ID, START_TIME,
FINISH_TIME, STATE_ID, OPTIONS, FUNCTION_ID FROM TMC_JOB_POOL tjp WHERE JOB_POOL_ID = ?
+mysql.core.jobpool.by.project=SELECT JOB_POOL_ID, JOB_POOL_NAME, PROJECT_ID, USER_ID, START_TIME,
FINISH_TIME, STATE_ID, OPTIONS, FUNCTION_ID FROM TMC_JOB_POOL tjp WHERE Project_ID = ? ORDER
BY JOB_POOL_ID DESC
+mysql.core.jobpool.by.user=SELECT JOB_POOL_ID, JOB_POOL_NAME, PROJECT_ID, USER_ID, START_TIME,
FINISH_TIME, STATE_ID, OPTIONS, FUNCTION_ID FROM TMC_JOB_POOL tjp WHERE USER_ID = ? ORDER
BY JOB_POOL_ID DESC
+# TODO: Figure out how the filter string should be coded
+mysql.core.jobpool.search.user=SELECT JOB_POOL_ID, JOB_POOL_NAME, PROJECT_ID, USER_ID, START_TIME,
FINISH_TIME, STATE_ID, OPTIONS, FUNCTION_ID FROM TMC_JOB_POOL tjp WHERE USER_ID = ? AND JOB_POOL_NAME
LIKE ?
+mysql.core.jobpool.search.user.date=SELECT JOB_POOL_ID, JOB_POOL_NAME, PROJECT_ID, USER_ID,
START_TIME, FINISH_TIME, STATE_ID, OPTIONS, FUNCTION_ID FROM TMC_JOB_POOL tjp WHERE USER_ID
= ? AND JOB_POOL_NAME LIKE ? AND START_DATE >= ?
+mysql.core.jobpool.search.user.function=SELECT JOB_POOL_ID, JOB_POOL_NAME, PROJECT_ID, USER_ID,
START_TIME, FINISH_TIME, STATE_ID, OPTIONS, FUNCTION_ID FROM TMC_JOB_POOL tjp WHERE USER_ID
= ? AND JOB_POOL_NAME LIKE ? AND FUNCTION_ID = ?;
+mysql.core.jobpool.by.state=SELECT JOB_POOL_ID, JOB_POOL_NAME, PROJECT_ID, USER_ID, START_TIME,
FINISH_TIME, STATE_ID, OPTIONS, FUNCTION_ID FROM TMC_JOB_POOL tjp WHERE State_ID = ?
+mysql.core.jobpool.by.state.limited=SELECT JOB_POOL_ID, JOB_POOL_NAME, PROJECT_ID, USER_ID,
START_TIME, FINISH_TIME, STATE_ID, OPTIONS, FUNCTION_ID FROM TMC_JOB_POOL tjp WHERE State_ID
= ? and rownum < 21 order by job_pool_id
+# TODO: Check if adequate
+mysql.core.jobpool.all=SELECT JOB_POOL_ID, JOB_POOL_NAME, PROJECT_ID, USER_ID, START_TIME,
FINISH_TIME, STATE_ID, OPTIONS, FUNCTION_ID FROM TMC_JOB_POOL tjp
+mysql.core.project.store=sp_tmc_store_project
+mysql.core.project.update=sp_tmc_update_project
+# TODO: There is no data param send by the method call: so as i see it's the same function
than core.project.by.user
+# TODO: Convert to MySql, here is the plain Oracle statement: 
+#mysql.core.project.recent=(select max(job_pool_id), project_id  from tmc_job_pool where
user_id = ? group by project_id order by 1 desc) join tmc_project using (project_id) where
rownum <11;
+mysql.core.project.recent=SELECT proj.PROJECT_ID, proj.PROJECT_NAME FROM TMC_USER tu, TMC_REL_USER_PROJECT
rel, TMC_PROJECT proj WHERE tu.USER_ID = ? AND tu.USER_ID = rel.USER_ID AND rel.PROJECT_ID
= proj.PROJECT_ID
+mysql.core.project.all=SELECT proj.PROJECT_ID, proj.PROJECT_NAME FROM TMC_PROJECT proj
+mysql.core.project.delete=sp_tmc_delete_project
+mysql.core.project.rel.context.store=sp_TM_STORE_CTXT_REL_PROJECT
+mysql.core.project.rel.context.delete=sp_tm_drop_ctxt_rel_project
+mysql.core.project.rel.vhost.store=SP_AM_STORE_VHOSTS_REL_PROJECT
+mysql.core.project.rel.vhost.delete=sp_am_drop_vhosts_rel_project
+mysql.core.project.by.vhost=f_tmc_get_projects_by_vhost
+mysql.core.project.by.context=f_tmc_get_projects_by_context
+mysql.core.project.by.user=SELECT proj.PROJECT_ID, proj.PROJECT_NAME FROM TMC_USER tu, TMC_REL_USER_PROJECT
rel, TMC_PROJECT proj WHERE tu.USER_ID = ? AND tu.USER_ID = rel.USER_ID AND rel.PROJECT_ID
= proj.PROJECT_ID
+mysql.core.project.search=SELECT proj.PROJECT_ID, proj.PROJECT_NAME FROM TMC_PROJECT proj
WHERE lower(proj.PROJECT_NAME) like lower(?)
+mysql.core.project.by.id=SELECT proj.PROJECT_ID, proj.PROJECT_NAME FROM TMC_PROJECT proj
WHERE proj.PROJECT_ID = ?
+mysql.tomcat.server.update=sp_tm_update_tomcat4
+mysql.tomcat.server.store=sp_tm_store_tomcat4
+mysql.tomcat.server.all=SELECT * FROM TM_CONTAINER tc
+mysql.tomcat.server.by.id=SELECT * FROM TM_CONTAINER tc WHERE tc.CONTAINER_ID = ?
+mysql.tomcat.server.delete=sp_tm_drop_server
+mysql.tomcat.entity.by.projectId=SELECT * FROM TM_ENTITY_VIEW join TM_REL_ENTITY_PROJECT
USING (ENTITY_ID) where project_id = ?
+mysql.tomcat.entity.all=SELECT * FROM TM_ENTITY_VIEW tc
+mysql.tomcat.entity.by.vhost=SELECT tc.* FROM TM_ENTITY_view tc, TMC_REL_VHOST_CONTEXT rel
WHERE tc.ENTITY_ID=rel.CONTEXT_ID AND rel.VHOST_ID=?
+mysql.tomcat.entity.by.pool=SELECT * FROM TM_ENTITY_VIEW tc WHERE tc.TOMCAT_POOL_ID=?
+mysql.tomcat.entity.by.worker=SELECT tc.* FROM TM_ENTITY_view tc, TM_REL_POOL_WORKER rel
WHERE rel.WORKER_ID=? AND rel.POOL_ID=tc.TOMCAT_POOL_ID
+mysql.tomcat.entity.by.id=SELECT tc.* FROM TM_ENTITY_view tc WHERE tc.ENTITY_ID=?
+mysql.tomcat.entity.by.name=SELECT * FROM TM_ENTITY_view where lower(entity_name) like lower('%'||?||'%')
+mysql.tomcat.entity.update=sp_tm_update_entity
+mysql.tomcat.entity.store=sp_tm_store_entity
+mysql.tomcat.entity.delete=sp_tm_drop_entity
+mysql.tomcat.pool.rel.worker.add= sp_tm_store_worker_pool
+mysql.tomcat.pool.rel.worker.delete=sp_tm_delete_worker_pool
+mysql.tomcat.pool.update=sp_tm_update_pool
+mysql.tomcat.pool.delete=sp_tm_drop_pool
+mysql.tomcat.pool.store=sp_tm_store_pool
+mysql.tomcat.pool.by.id=SELECT p.POOL_ID, p.POOL_NAME, p.ENV_ID FROM TM_POOL p WHERE p.POOL_ID=?
+mysql.tomcat.pool.by.context=SELECT p.POOL_ID, p.POOL_NAME, p.ENV_ID FROM TM_POOL p, TM_ENTITY
e WHERE p.POOL_ID=e.TOMCAT_POOL_ID AND e.ENTITY_ID=?
+mysql.tomcat.pool.all=SELECT p.POOL_ID, p.POOL_NAME, p.ENV_ID FROM TM_POOL p
+mysql.tomcat.pool.by.name=SELECT p.POOL_ID, p.POOL_NAME, p.ENV_ID FROM TM_POOL p WHERE lower(p.pool_name)
like lower(?)
+mysql.tomcat.pool.by.worker=SELECT p.POOL_ID, p.POOL_NAME, p.ENV_ID FROM TM_POOL p, TM_REL_POOL_WORKER
rel WHERE p.POOL_ID=rel.POOL_ID AND rel.WORKER_ID=?
+mysql.tomcat.worker.update=sp_tm_update_worker
+mysql.tomcat.worker.delete=sp_tm_drop_worker
+mysql.tomcat.worker.store=sp_tm_store_worker
+mysql.tomcat.worker.by.pool=SELECT * FROM (TM_WORKER_VIEW tw JOIN TM_REL_POOL_WORKER using
(WORKER_ID)) WHERE POOL_ID= ?
+mysql.tomcat.worker.all=SELECT * FROM TM_WORKER_VIEW
+mysql.tomcat.worker.by.id=SELECT * FROM TM_WORKER_VIEW tw WHERE tw.WORKER_ID = ?
+mysql.tomcat.worker.by.hardware.server=SELECT * FROM TM_WORKER_VIEW tw WHERE tw.CONTAINER_ID
= ? AND tw.HARDWARE_ID = v_hId
+mysql.tomcat.worker.by.hardware=SELECT * FROM TM_WORKER_VIEW tw WHERE tw.HARDWARE_ID = ?
+mysql.tomcat.worker.by.name=SELECT * FROM TM_WORKER_VIEW tw WHERE lower(hardware_name) like
lower(?)
+mysql.tomcat.worker.by.name.instance=SELECT * FROM TM_WORKER_VIEW tw WHERE hardware_name
like "?" and instance_id = ?
+mysql.core.user.rel.project.add=sp_tmc_store_user_proj
+mysql.core.user.rel.project.delete=sp_tmc_delete_user_proj
+mysql.core.user.by.username=SELECT u.USER_ID, u.COMMENTS, u.JOB_TITLE, u.FIRST_NAME, u.LAST_NAME,
u.EMAIL, u.USER_NAME, U.State_id FROM TMC_USER u WHERE u.USER_NAME = ?
+mysql.core.user.by.id=SELECT u.USER_ID, u.COMMENTS, u.JOB_TITLE, u.FIRST_NAME, u.LAST_NAME,
u.EMAIL, u.USER_NAME, U.State_id FROM TMC_USER u WHERE u.USER_ID = ?
+mysql.core.user.all=SELECT u.USER_ID, u.COMMENTS, u.JOB_TITLE, u.FIRST_NAME, u.LAST_NAME,
u.EMAIL, u.USER_NAME, U.STATE_ID FROM TMC_USER u
+mysql.core.user.by.project=SELECT u.USER_ID, u.COMMENTS, u.JOB_TITLE, u.FIRST_NAME, u.LAST_NAME,
u.EMAIL, u.USER_NAME, u.State_id FROM TMC_USER u, TMC_REL_USER_PROJECT rel WHERE u.USER_ID
= rel.user_ID AND rel.project_ID = ?
+mysql.core.user.update=sp_tmc_update_user
+mysql.core.user.store=sp_tmc_store_user
+mysql.core.user.delete=sp_tmc_drop_user
+mysql.apache.entity.rel.ip.add=sp_am_store_vhosts_rel_ip
+mysql.apache.entity.rel.context.add=sp_am_store_vhosts_rel_context
+mysql.apache.entity.delete=sp_am_drop_entity
+mysql.apache.entity.rel.ip.delete=sp_am_drop_vhost_rel_ip
+mysql.apache.entity.rel.context.delete=sp_am_drop_vhost_rel_ctxt
+mysql.apache.entity.update=sp_am_update_vhost
+mysql.apache.entity.store=sp_am_store_vhost
+mysql.apache.entity.all=SELECT * FROM AM_ENTITY_VIEW
+mysql.apache.entity.by.projectid=SELECT * FROM AM_ENTITY_VIEW join AM_REL_ENTITY_PROJECT
USING (VHOST_ID) where project_id = ?
+mysql.apache.entity.by.hostingpool=SELECT * FROM AM_ENTITY_VIEW vh where vh.hosting_POOL_ID=?
+mysql.apache.entity.by.worker=SELECT vh.VHOST_ID, vh.ENV_ID, vh.STATE_ID, vh.VHOST_NAME,
vh.HOSTING_POOL_ID, vh.NAMEBASED, vh.CATCHALL, vh.VHOST_ENTRY, vh.EX_PROJECT_ID, vh.POOL_ID,
vh.POOL_NAME, vh.POOL_ENV_ID FROM AM_ENTITY_VIEW vh, AM_REL_POOL_WORKER aw where vh.pool_id
= aw.pool_ID AND aw.WORKER_ID=?
+mysql.apache.entity.by.id=SELECT * FROM AM_ENTITY_VIEW vh where vh.vhost_ID=?
+mysql.apache.entity.by.name=SELECT * FROM AM_ENTITY_VIEW vh where lower(vh.vhost_name) like
lower(?)
+mysql.util.alert.all=SELECT a.ALERT_ID, a.SUBMISION_DATE, a.SUBMITTER_ID, a.ALERT_TITLE,
a.ALERT_LINK, a.alert_contents FROM TMC_ALERTS a;
+mysql.util.alert.by.id=SELECT a.ALERT_ID, a.SUBMISION_DATE, a.SUBMITTER_ID, a.ALERT_TITLE,
a.ALERT_LINK, a.alert_contents FROM TMC_ALERTS a where a.ALERT_ID=?
+mysql.util.alert.delete=sp_tmc_drop_alert
+mysql.util.alert.delete.rel.project=sp_tmc_drop_alert_rel
+mysql.util.alert.store=sp_tmc_store_alert
+mysql.util.alert.update=sp_tmc_update_alert
+mysql.util.alert.rel.project.store=sp_tmc_store_alert_rel
+mysql.util.help.by.id=SELECT hi.HELP_ITEM_ID, hi.HELP_ITEM_TITLE, hi.VALID, hi.SUMMARY, hi.content,
top.TOPIC_NAME, hi.FUNCTION_ID, st.TOPIC_NAME as SUBTOPIC_NAME FROM TMC_HELP_ITEM hi, TMC_TOPIC
top, TMC_TOPIC st, TMC_REL_HELP_TOPIC th WHERE hi.HELP_ITEM_ID=? AND th.HELP_ITEM_ID=hi.HELP_ITEM_ID
AND top.TOPIC_ID = th.TOPIC_ID AND st.TOPIC_ID = th.SUBTOPIC_ID
+mysql.util.help.by.function=SELECT hi.HELP_ITEM_ID, hi.HELP_ITEM_TITLE, hi.VALID, hi.content,
hi.SUMMARY, top.TOPIC_NAME, hi.FUNCTION_ID, st.TOPIC_NAME as SUBTOPIC_NAME FROM TMC_HELP_ITEM
hi, TMC_TOPIC top, TMC_TOPIC st, TMC_REL_HELP_TOPIC th WHERE hi.FUNCTION_ID=? AND hi.valid
= ? AND th.HELP_ITEM_ID=hi.HELP_ITEM_ID AND top.TOPIC_ID = th.TOPIC_ID AND st.TOPIC_ID = th.SUBTOPIC_ID
+mysql.util.help.all=SELECT hi.HELP_ITEM_ID, hi.HELP_ITEM_TITLE, hi.VALID, hi.SUMMARY, hi.content,
top.TOPIC_NAME, hi.FUNCTION_ID, st.TOPIC_NAME as SUBTOPIC_NAME FROM TMC_HELP_ITEM hi, TMC_TOPIC
top, TMC_TOPIC st, TMC_REL_HELP_TOPIC th WHERE th.HELP_ITEM_ID=hi.HELP_ITEM_ID AND top.TOPIC_ID
= th.TOPIC_ID AND st.TOPIC_ID = th.SUBTOPIC_ID
+mysql.util.help.by.keyword=SELECT hi.HELP_ITEM_ID, hi.HELP_ITEM_TITLE, hi.VALID, hi.content,hi.SUMMARY,
top.TOPIC_NAME, hi.FUNCTION_ID, st.TOPIC_NAME as SUBTOPIC_NAME FROM TMC_HELP_ITEM hi, TMC_TOPIC
top, TMC_TOPIC st, TMC_REL_HELP_TOPIC th, TMC_REL_HELP_keyword tk, TMC_KEYWORD kw WHERE kw.KEYWORD_NAME
like '%'|| "?" ||'%' AND tk.KEYWORD_ID = kw.KEYWORD_ID AND hi.HELP_ITEM_ID = tk.HELP_ITEM_ID
AND hi.valid = ? AND th.HELP_ITEM_ID = hi.HELP_ITEM_ID AND top.TOPIC_ID = th.TOPIC_ID AND
st.TOPIC_ID = th.SUBTOPIC_ID
+mysql.util.help.store=sp_tmc_store_help_item
+mysql.util.help.delete=sp_tmc_drop_help_item
+mysql.util.help.update=sp_tmc_update_help_item
+mysql.util.help.keyword.add=sp_tmc_store_keyword
+mysql.util.help.topic.store=sp_tmc_store_topic
+mysql.util.help.rel.topic.add=sp_tmc_store_help_rel_topic
+mysql.util.help.rel.topic.update=sp_tmc_update_help_rel_topic
+mysql.util.help.rel.keyword.add=sp_tmc_store_help_rel_keyword
+mysql.util.help.rel.keyword.update=sp_tmc_update_help_rel_keyword
+mysql.core.ability.rel.user.delete=sp_tmc_delete_user_abil
+mysql.core.ability.rel.user.store=sp_tmc_store_user_abil
+mysql.core.ability.by.user=SELECT USER_ID, PROJECT_ID, OBJECT_TYPE, OBJECT_ID, FUNCTION_ID
FROM TMC_rel_function_user WHERE USER_ID = ?
+mysql.core.exproject.add=sp_tmc_store_ex_project
+mysql.core.exproject.delete=sp_tmc_delete_ex_project
+mysql.core.file.content.update=UPDATE TMC_FILES SET FILE_CONTENT = ? where FILE_id=?
+mysql.core.file.content.lock=SELECT FILE_CONTENT FROM TMC_FILES where FILE_id=? FOR UPDATE
+mysql.core.file.store=sp_tmc_store_file
+mysql.core.file.update=sp_tmc_update_file
+mysql.core.job.store=sp_tmc_store_job
+mysql.core.job.set.result=UPDATE TMC_JOB  SET RESULT = ? where job_id=?
+mysql.core.job.lock.result=SELECT RESULT FROM TMC_JOB where job_id=? FOR UPDATE
+mysql.core.job.store.finish=sp_tmc_add_job2
+mysql.core.job.update=sp_tmc_job_update
+mysql.core.file.prep.blob={call sp_tmc_prep_file_content(?,?)}
+mysql.core.job.prep.blob={call sp_TMC_prep_job(?,EMPTY_BLOB())}
+mysql.tomcat.server.by.name=SELECT * FROM TM_CONTAINER tc WHERE lower(tc.CONTAINER_NAME)
like lower(?)
+mysql.core.server.by.name=SELECT h.HARDWARE_ID, h.INSTANCE_ID, h.ENV_ID, h.PHYSICAL_LOCATION,
h.HARDWARE_NAME, h.STATUS_ID, h.COMMENTS, h.DEFAULT_IP_ID FROM TMC_HARDWARE h WHERE lower(h.HARDWARE_NAME)
like lower(?)
+mysql.apache.server.by.name=SELECT ap.CONTAINER_ID, ap.CONTAINER_NAME, ap.LOG_LOCATION, ap.ENV_VARIBLES,
ap.FORK_WAIT, ap.PIDFILE_LOCATION, ap.RESTART_COMMAND, ap.START_COMMAND, ap.STOP_COMMAND,
ap.SYS_GROUP, ap.SYS_USER, ap.SERVER_ROOT, ap.MAIN_ID FROM AM_CONTAINER ap WHERE lower(ap.CONTAINER_name)
like lower(?)
+mysql.tomcat.worker.by.server=SELECT * FROM TM_WORKER_VIEW tw WHERE tw.CONTAINER_ID = ?
+mysql.apache.worker.by.server=SELECT * FROM AM_WORKER_VIEW aw where aw.CONTAINER_ID=?
+mysql.core.pool.by.tomcatpool=SELECT hp.HOSTING_POOL_ID, hp.HOSTING_POOL_NAME, hp.ENV_ID,
rel.AM_POOL_ID, rel.TM_POOL_ID FROM TMC_Hosting_Pool hp, TMC_REL_HOSTING_MODULES rel Where
rel.HOSTING_POOL_ID = hp.HOSTING_POOL_ID AND rel.TM_POOL_ID=v_id

Modified: incubator/lokahi/lokahi/trunk/conf/lokahi.properties
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/conf/lokahi.properties?rev=581309&r1=581308&r2=581309&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/conf/lokahi.properties (original)
+++ incubator/lokahi/lokahi/trunk/conf/lokahi.properties Tue Oct  2 10:00:50 2007
@@ -46,9 +46,14 @@
 SleepTimeForMainThread=60
 SleepTimeForChildThread=60
 
-wap.function.HostingPool=RestartTomcat,StartTomcat,StopTomcat,DeployTomcatConfig,DeployApacheConfig,ConfigtestApache,GracefulApache,
-StopApache,StartApache
+wap.function.HostingPool=RestartTomcat,StartTomcat,StopTomcat,DeployTomcatConfig,DeployApacheConfig,ConfigtestApache,GracefulApache,StopApache,StartApache
 wap.function.ApachePool=DeployApacheConfig,ConfigtestApache,GracefulApache,StopApache,StartApache
 wap.function.TomcatPool=RestartTomcat,StartTomcat,StopTomcat,DeployTomcatConfig
 wap.function.ApacheWorker=DeployApacheConfig,ConfigtestApache,GracefulApache,StopApache,StartApache
-wap.function.TomcatWorker=RestartTomcat,StartTomcat,StopTomcat,DeployTomcatConfig
\ No newline at end of file
+wap.function.TomcatWorker=RestartTomcat,StartTomcat,StopTomcat,DeployTomcatConfig
+
+# Generic DB support
+#lokahi.broker.implementation=org.apache.lokahi.core.common.database.MySqlBroker
+lokahi.broker.implementation=org.apache.lokahi.core.common.database.OracleBroker
+lokahi.broker.autocommit=true
+

Copied: incubator/lokahi/lokahi/trunk/database/oracle/tables.sql (from r581286, incubator/lokahi/lokahi/branches/mysql/database/oracle/tables.sql)
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/database/oracle/tables.sql?p2=incubator/lokahi/lokahi/trunk/database/oracle/tables.sql&p1=incubator/lokahi/lokahi/branches/mysql/database/oracle/tables.sql&r1=581286&r2=581309&rev=581309&view=diff
==============================================================================
--- incubator/lokahi/lokahi/branches/mysql/database/oracle/tables.sql (original)
+++ incubator/lokahi/lokahi/trunk/database/oracle/tables.sql Tue Oct  2 10:00:50 2007
@@ -143,7 +143,7 @@
 CREATE TABLE TMC_USER ( FIRST_NAME VARCHAR2(30), LAST_NAME VARCHAR2(30), JOB_TITLE VARCHAR2(100),
COMMENTS VARCHAR2(2000), EMAIL VARCHAR2(60), USER_ID NUMBER NOT NULL, USER_NAME VARCHAR2(30)
NOT NULL, STATE_ID NUMBER DEFAULT 8, PASSWORD VARCHAR2(32) ) LOGGING NOCACHE NOPARALLEL;
 
 
-CREATE TABLE TM_CONTAINER ( CONTAINER_ID NUMBER NOT NULL, CONTAINER_NAME VARCHAR2(40), BASE_LOCATION
VARCHAR2(100), TOMCAT_HOME VARCHAR2(100), HTTP_PORT NUMBER, SYS_USER VARCHAR2(8), SYS_GROUP
VARCHAR2(8), CONF_ENTRY BLOB, TOMCAT_TYPE NUMBER DEFAULT 4, DESCRIPTION VARCHAR2(100), STD_OUT_LOG
VARCHAR2(40), START_CLASS VARCHAR2(40), JAVA_HOME VARCHAR2(40) ) LOGGING NOCACHE NOPARALLEL;
+CREATE TABLE TM_CONTAINER ( CONTAINER_ID NUMBER NOT NULL, CONTAINER_NAME VARCHAR2(40), BASE_LOCATION
VARCHAR2(100), TOMCAT_HOME VARCHAR2(100), HTTP_PORT NUMBER, SYS_USER VARCHAR2(8), SYS_GROUP
VARCHAR2(8), CONF_ENTRY BLOB, TOMCAT_TYPE NUMBER DEFAULT 4, DESCRIPTION VARCHAR2(100), STD_OUT_LOG
VARCHAR2(300), START_CLASS VARCHAR2(40), JAVA_HOME VARCHAR2(40) ) LOGGING NOCACHE NOPARALLEL;
 
 
 CREATE TABLE TM_ENTITY ( ENTITY_ID NUMBER NOT NULL, ENTITY_NAME VARCHAR2(60) NOT NULL, DOC_BASE
VARCHAR2(500) NOT NULL, ENTITY_STATE_ID NUMBER NOT NULL, ENV_ID NUMBER NOT NULL, TOMCAT_POOL_ID
NUMBER, ENTITY_DEFIN VARCHAR2(4000), EX_PROJECT_ID NUMBER DEFAULT 0 ) LOGGING NOCACHE NOPARALLEL;

Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/api/file/File.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/api/file/File.java?rev=581309&r1=581308&r2=581309&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/api/file/File.java (original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/api/file/File.java Tue Oct
 2 10:00:50 2007
@@ -168,10 +168,10 @@
   private static boolean storeBlob(int id, String toStore) throws SQLException {
     boolean ret = false;
     try {
-      broker.useSQL("core.file.prep.blob", id);
-      if (toStore == null) toStore = "";
-      byte[] blobBytes = toStore.getBytes();
-      broker.blobHack("core.file.content.lock", "core.file.content.update", id, blobBytes);
+        if ("oracle".equals(PropertiesFile.getConstantValue("lokahi.broker.type")))
+            storeBlobOracleImpl(id, toStore);
+        else
+            storeBlobStdImpl(id, toStore);
       ret = true;
     } catch (SQLException e) {
       if (logger.isInfoEnabled()) {
@@ -180,6 +180,19 @@
       throw e;
     }
     return ret;
+  }
+
+  private static void storeBlobOracleImpl(int id, String toStore) throws SQLException { 
 
+      broker.useSQL("core.file.prep.blob", id);
+      if (toStore == null) toStore = "";
+      byte[] blobBytes = toStore.getBytes();
+      broker.blobHack("core.file.content.lock", "core.file.content.update", id, blobBytes);
     
+  }
+
+  private static void storeBlobStdImpl(int id, String toStore) throws SQLException {
+      if (toStore == null) toStore = "";
+      byte[] blobBytes = toStore.getBytes();
+      broker.useSQL("core.file.prep.blob", id ,blobBytes);
   }
 
   static boolean delete(File f) throws SQLException {

Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/common/database/CachingBroker.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/common/database/CachingBroker.java?rev=581309&r1=581308&r2=581309&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/common/database/CachingBroker.java
(original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/common/database/CachingBroker.java
Tue Oct  2 10:00:50 2007
@@ -18,6 +18,7 @@
 */
 package org.apache.lokahi.core.common.database;
 
+import org.apache.log4j.Logger;
 import org.apache.lokahi.core.common.interfaces.Dao;
 import org.apache.lokahi.core.common.interfaces.TMCBroker;
 
@@ -29,9 +30,31 @@
  * @version $Id$
  */
 public class CachingBroker<T extends Dao> implements TMCBroker<T> {
-  private final TMCBroker<T> masterBroker = new OracleBroker<T>();
-  private final TMCBroker<T> cacheBroker = new DerbyBroker<T>();
-
+  static final Logger logger = Logger.getLogger(CachingBroker.class);
+    
+  public final static String DEFAULT_BROKER_IMPLEMENTATION = "org.apache.lokahi.core.common.database.OracleBroker";
+    
+  private static String masterBrokerClassName = DEFAULT_BROKER_IMPLEMENTATION;
+    
+  private TMCBroker<T> masterBroker;
+
+  private TMCBroker<T> cacheBroker = new DerbyBroker<T>();
+
+  public CachingBroker() {
+    super();
+    if (logger.isDebugEnabled())
+      logger.debug("Instantiate a '"+masterBrokerClassName+"' broker.");    
+    try {
+      masterBroker = (TMCBroker<T>) Class.forName(masterBrokerClassName).newInstance();
+    } catch (InstantiationException e) {
+        e.printStackTrace();
+    } catch (IllegalAccessException e) {
+        e.printStackTrace();
+    } catch (ClassNotFoundException e) {
+        e.printStackTrace();
+    }
+  }
+    
   public int save(String statement, Object... objects) throws SQLException {
     return masterBroker.save(statement, objects);
   }
@@ -66,5 +89,13 @@
 
   public String connectionReport() {
     return masterBroker.connectionReport() + cacheBroker.connectionReport();
+  }
+
+  public static String getMasterBrokerClassName() {
+    return masterBrokerClassName;
+  }
+
+  public static void setMasterBrokerClassName(String masterBrokerClassName) {
+    CachingBroker.masterBrokerClassName = masterBrokerClassName;
   }
 }

Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/common/database/ConnBean.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/common/database/ConnBean.java?rev=581309&r1=581308&r2=581309&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/common/database/ConnBean.java
(original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/common/database/ConnBean.java
Tue Oct  2 10:00:50 2007
@@ -63,7 +63,7 @@
     connPool.setTestOnReturn(true);
     connPool.setTestWhileIdle(true);
     connPool.setTimeBetweenEvictionRunsMillis(30000);
-    connPool.setValidationQuery("SELECT SYSDATE FROM DUAL");
+    connPool.setValidationQuery("SELECT COUNT(*) FROM TMC_PROJECT");
     //then close and then get connection again...
   }
 

Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/controller/AdminBean.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/controller/AdminBean.java?rev=581309&r1=581308&r2=581309&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/controller/AdminBean.java
(original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/controller/AdminBean.java
Tue Oct  2 10:00:50 2007
@@ -23,22 +23,24 @@
 
 package org.apache.lokahi.core.controller;
 
-import oracle.jdbc.driver.OracleTypes;
-import oracle.sql.ARRAY;
-import oracle.sql.STRUCT;
-import org.apache.log4j.Logger;
-import org.apache.lokahi.core.api.instance.Instance;
-import org.apache.lokahi.core.common.database.ConnBean;
-import org.apache.lokahi.core.common.util.PropertiesFile;
-
 import java.sql.CallableStatement;
 import java.sql.Connection;
+import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.Hashtable;
 import java.util.StringTokenizer;
 import java.util.Vector;
 
+import oracle.jdbc.driver.OracleTypes;
+import oracle.sql.ARRAY;
+import oracle.sql.STRUCT;
+
+import org.apache.log4j.Logger;
+import org.apache.lokahi.core.api.instance.Instance;
+import org.apache.lokahi.core.common.database.ConnBean;
+import org.apache.lokahi.core.common.util.PropertiesFile;
+
 public class AdminBean {  //todo scrap this entire thing
   static final Logger logger = Logger.getLogger(AdminBean.class);
 
@@ -98,8 +100,24 @@
     }
 
     Hashtable contHash = new Hashtable();
-    CallableStatement csmt;
     try {
+        if ("oracle".equals(PropertiesFile.getConstantValue("lokahi.broker.type")))
+            contHash = getAllAdminInfoOracleImpl(conn, contHash);
+        else
+            contHash = getAllAdminInfoStdImpl(conn, contHash);
+    } catch (SQLException e) {
+      if (logger.isInfoEnabled()) {
+        logger.info("Exception: " + e.getMessage());
+      }
+      contHash = null;
+    } finally {
+      if (fromDb) connBean.returnConn(conn);
+    }
+    return contHash;
+  } // end getAllAdminInfo
+
+  private Hashtable getAllAdminInfoOracleImpl(Connection conn, Hashtable contHash) throws
SQLException {
+      CallableStatement csmt;
       csmt = conn.prepareCall("{? = call  " + schema_owner + "." + stored_proc + "}");
 
       csmt.registerOutParameter(1, OracleTypes.ARRAY, "BI_LIST");
@@ -122,17 +140,35 @@
           contHash.put(val1, val2);
         }
       } // while rs.next
-      csmt.close();
-    } catch (SQLException e) {
-      if (logger.isInfoEnabled()) {
-        logger.info("Exception: " + e.getMessage());
-      }
-      contHash = null;
-    } finally {
-      if (fromDb) connBean.returnConn(conn);
-    }
-    return contHash;
-  } // end getAllAdminInfo
+      csmt.close();   
+      return contHash;
+  }
+
+  private Hashtable getAllAdminInfoStdImpl(Connection conn, Hashtable contHash) throws SQLException
{
+      PreparedStatement psmt;
+      psmt = conn.prepareStatement("select 'PRIMARY',primary_jvm,'BACKUP', backup_jvm, 'ALTERNATE',
alternate_jvm from TMC_ADMIN where INSTANCE_ID=?;");
+
+      psmt.setInt(1, this.getInstance().getPk());
+      psmt.execute();
+
+      // returns rows with 2 fields
+      // let us build a hashtable out of this, with first field as hashtable key and 2nd
as value for this key
+      // retrieve the array as an oracle array
+      ResultSet rs = psmt.getResultSet();
+      while (rs.next()) {
+          for (int i=0;i<rs.getMetaData().getColumnCount();i=i+2) {
+              Object attrs[] = { rs.getString(i), rs.getString(i+1)};
+              String val1 = (attrs[0] != null) ? (String) attrs[0] : null;
+              String val2 = (attrs[1] != null) ? (String) attrs[1] : "";
+              if (val1 != null) {
+                // overwrite the key if it already exists
+                contHash.put(val1, val2);
+              }              
+          }
+      } // while rs.next
+      psmt.close();   
+      return contHash;
+  }
 
   /**
    * This method changes the role of the machine:port supplied to primary/backup or alternate
@@ -200,14 +236,15 @@
       csmt.execute();
       csmt.close();
 
-      conn.commit();
+      if (!"true".equals(PropertiesFile.getConstantValue("lokahi.broker.autocommit")))
+      	conn.commit();
     } catch (SQLException e) {
       if (logger.isInfoEnabled()) {
         logger.info("Exception: " + e.getMessage());
       }
     } finally {
       if (fromDb) connBean.returnConn(conn);
-      return;
+          return;
     }
   } // end changeJvmAdminRole
 
@@ -232,7 +269,3 @@
   } // end split
 
 } // end AdminBean
-
-
-
-

Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/gui/www/TMCStartupServlet.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/gui/www/TMCStartupServlet.java?rev=581309&r1=581308&r2=581309&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/gui/www/TMCStartupServlet.java
(original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/core/gui/www/TMCStartupServlet.java
Tue Oct  2 10:00:50 2007
@@ -19,6 +19,7 @@
 package org.apache.lokahi.core.gui.www;
 
 import org.apache.log4j.xml.DOMConfigurator;
+import org.apache.lokahi.core.common.database.CachingBroker;
 import org.apache.lokahi.core.common.database.ConnBean;
 import org.apache.lokahi.core.common.database.DerbyBroker;
 import org.apache.lokahi.core.common.util.PropertiesFile;
@@ -53,6 +54,10 @@
     PropertiesFile.load(this.getClass().getClassLoader().getResourceAsStream(propsName));
     PropertiesFile.load(this.getClass().getClassLoader().getResourceAsStream("db.properties"));
 
+    if (PropertiesFile.getConstantValue("lokahi.broker.implementation")!=null) {
+        CachingBroker.setMasterBrokerClassName(PropertiesFile.getConstantValue("lokahi.broker.implementation"));
       
+    }
+    
     // check for some specific init values that need non-standard action
     ConnBean.initializePool(PropertiesFile.getConstantValue("tmc.database.uri"),
                             PropertiesFile.getConstantValue("tmc.database.user"),



Mime
View raw message