You are viewing a plain text version of this content. The canonical link for it is here.
Posted to lokahi-commits@incubator.apache.org by to...@apache.org on 2007/01/05 22:22:25 UTC
svn commit: r493210 [1/2] - in /incubator/lokahi/lokahi/branches/jackrabbit:
lib/ src/java/org/apache/lokahi/core/agent/jmx/
src/java/org/apache/lokahi/core/api/environment/
src/java/org/apache/lokahi/core/api/file/
src/java/org/apache/lokahi/core/api/...
Author: toback
Date: Fri Jan 5 14:22:23 2007
New Revision: 493210
URL: http://svn.apache.org/viewvc?view=rev&rev=493210
Log:
Broke all the interfaces apart in preparation for splitting the Database access layer from the data objects.
Added:
incubator/lokahi/lokahi/branches/jackrabbit/lib/commons-chain-1.1.jar (with props)
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Poolable.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Stateable.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Worker.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/RestUtil.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/worker/TomcatWorkerDAO.java
Removed:
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/RestObject.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Server.java
Modified:
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/agent/jmx/JMXVirtualMachine.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/environment/Environment.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/file/File.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/function/Function.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/instance/Instance.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/job/Job.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/jobpool/JobPool.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/pool/HostingPool.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/server/Hardware.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/server/HardwareModel.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/state/State.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/user/User.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Application.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Dao.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Entity.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/FunctionableEntity.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Pool.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/TMCDao.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/TMCVelocityViewTool.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/WapTool.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/pool/ApachePool.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/worker/ApacheWorker.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/worker/ApacheWorkerModel.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/modjk/WorkersPropertiesFile.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/entity/TomcatContextModel.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TMPoolWorker.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TomcatPool.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TomcatPoolModel.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/server/Tomcat.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/worker/ServerXmlFile.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/worker/TomcatWorker.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/worker/TomcatWorkerModel.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/gui/www/TomcatPoolAction.java
incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/gui/www/TomcatWorkerAction.java
Added: incubator/lokahi/lokahi/branches/jackrabbit/lib/commons-chain-1.1.jar
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/lib/commons-chain-1.1.jar?view=auto&rev=493210
==============================================================================
Binary file - no diff available.
Propchange: incubator/lokahi/lokahi/branches/jackrabbit/lib/commons-chain-1.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/agent/jmx/JMXVirtualMachine.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/agent/jmx/JMXVirtualMachine.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/agent/jmx/JMXVirtualMachine.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/agent/jmx/JMXVirtualMachine.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -52,7 +52,7 @@
private String startClass; // the startClass line javaOptions to the vm. example "org.apache.catalina.Bootstrap start"
private String javaOptions; // the -D params passed to java
private String vmName; // the name of the vm? do we want this here?
- private MBeanServerConnection mbsc; // the MBean Server connection... duh.
+ private MBeanServerConnection mbsc; // the MBean Worker connection... duh.
public int getPid() {
return vmPid;
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/environment/Environment.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/environment/Environment.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/environment/Environment.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/environment/Environment.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,6 +24,7 @@
import org.apache.lokahi.core.common.interfaces.TMCBroker;
import org.apache.lokahi.core.common.interfaces.TMCDao;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -160,15 +161,15 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("href", PropertiesFile.getConstantValue("rest.servlet.url") + "environment/" + this.getPk() + '/');
- return elementBuilder("environment", map);
+ return RestUtil.elementBuilder("environment", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<environment>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
- ret.append(elementBuilder("comment", this.getComment()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("comment", this.getComment()));
ret.append("</environment>\n");
return ret;
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/file/File.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/file/File.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/file/File.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/file/File.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,6 +24,7 @@
import org.apache.lokahi.core.common.interfaces.TMCBroker;
import org.apache.lokahi.core.common.interfaces.TMCDao;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import java.sql.Blob;
import java.sql.ResultSet;
@@ -228,17 +229,17 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("href", PropertiesFile.getConstantValue("rest.servlet.url") + "file/" + this.getPk() + '/');
- return elementBuilder("file", map);
+ return RestUtil.elementBuilder("file", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<file>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
- ret.append(elementBuilder("content", this.getContent()));
- ret.append(elementBuilder("descriptor", this.getDescriptor()));
- ret.append(elementBuilder("path", this.getPath()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("content", this.getContent()));
+ ret.append(RestUtil.elementBuilder("descriptor", this.getDescriptor()));
+ ret.append(RestUtil.elementBuilder("path", this.getPath()));
ret.append("</file>\n");
return ret;
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/function/Function.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/function/Function.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/function/Function.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/function/Function.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,6 +23,7 @@
import org.apache.lokahi.core.common.interfaces.ReadOnlyBroker;
import org.apache.lokahi.core.common.interfaces.XMLDao;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import org.jdom.Element;
import java.io.Serializable;
@@ -210,15 +211,15 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("command", this.getCommand());
- return elementBuilder("function", map);
+ return RestUtil.elementBuilder("function", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<function>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
- ret.append(elementBuilder("command", this.getCommand()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("command", this.getCommand()));
ret.append("</function>\n");
return ret;
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/instance/Instance.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/instance/Instance.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/instance/Instance.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/instance/Instance.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,6 +23,7 @@
import org.apache.lokahi.core.common.interfaces.TMCBroker;
import org.apache.lokahi.core.common.interfaces.TMCDao;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -165,15 +166,15 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("href", PropertiesFile.getConstantValue("rest.servlet.url") + "instance/" + this.getPk() + '/');
- return elementBuilder("instance", map);
+ return RestUtil.elementBuilder("instance", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<instance>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
- ret.append(elementBuilder("comments", this.getComments()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("comments", this.getComments()));
ret.append("</instance>\n");
return ret;
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/job/Job.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/job/Job.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/job/Job.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/job/Job.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -32,6 +32,7 @@
import org.apache.lokahi.core.common.interfaces.TMCMessage;
import org.apache.lokahi.core.common.message.TMCSOAPMessage;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import org.apache.lokahi.core.controller.AdminBean;
import java.io.IOException;
@@ -776,17 +777,17 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("href", PropertiesFile.getConstantValue("rest.servlet.url") + "job/" + this.getPk() + '/');
- return elementBuilder("job", map);
+ return RestUtil.elementBuilder("job", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<job>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
- ret.append(elementBuilder("start-time", this.getStartTime().toString()));
- ret.append(elementBuilder("end-time", this.getFinishTime().toString()));
- ret.append(elementBuilder("options", this.getOptions()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("start-time", this.getStartTime().toString()));
+ ret.append(RestUtil.elementBuilder("end-time", this.getFinishTime().toString()));
+ ret.append(RestUtil.elementBuilder("options", this.getOptions()));
ret.append(this.getInstance().buildShortXMLRepresentation());
ret.append(this.getHardware().buildShortXMLRepresentation());
ret.append(this.getState().buildShortXMLRepresentation());
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/jobpool/JobPool.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/jobpool/JobPool.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/jobpool/JobPool.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/jobpool/JobPool.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -31,6 +31,7 @@
import org.apache.lokahi.core.common.interfaces.TMCBroker;
import org.apache.lokahi.core.common.interfaces.TMCDao;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -514,17 +515,17 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("href", PropertiesFile.getConstantValue("rest.servlet.url") + "jobpool/" + this.getPk() + '/');
- return elementBuilder("jobpool", map);
+ return RestUtil.elementBuilder("jobpool", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<jobpool>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
- ret.append(elementBuilder("start-time", this.getStartTime().toString()));
- ret.append(elementBuilder("end-time", this.getFinishTime().toString()));
- ret.append(elementBuilder("options", this.getOptions()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("start-time", this.getStartTime().toString()));
+ ret.append(RestUtil.elementBuilder("end-time", this.getFinishTime().toString()));
+ ret.append(RestUtil.elementBuilder("options", this.getOptions()));
ret.append(this.getUser().buildShortXMLRepresentation());
ret.append(this.getProject().buildShortXMLRepresentation());
ret.append(this.getFunction().buildShortXMLRepresentation());
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/pool/HostingPool.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/pool/HostingPool.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/pool/HostingPool.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/pool/HostingPool.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -28,6 +28,7 @@
import org.apache.lokahi.core.common.interfaces.TMCBroker;
import org.apache.lokahi.core.common.interfaces.TMCDao;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import org.apache.lokahi.httpd.api.entity.VirtualHost;
import org.apache.lokahi.httpd.api.pool.ApachePool;
import org.apache.lokahi.httpd.api.worker.ApacheWorker;
@@ -419,14 +420,14 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("href", PropertiesFile.getConstantValue("rest.servlet.url") + "hostingpool/" + this.getPk() + '/');
- return elementBuilder("hostingpool", map);
+ return RestUtil.elementBuilder("hostingpool", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<hostingpool>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
ret.append(this.getEnv().buildShortXMLRepresentation());
ret.append(this.getApachePool().buildShortXMLRepresentation());
ret.append(this.getTomcatPool().buildShortXMLRepresentation());
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/server/Hardware.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/server/Hardware.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/server/Hardware.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/server/Hardware.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,10 +26,10 @@
import org.apache.lokahi.core.common.collection.TMCCollectionImpl;
import org.apache.lokahi.core.common.collection.TMCSet;
import org.apache.lokahi.core.common.database.BrokerFactory;
-import org.apache.lokahi.core.common.interfaces.Server;
import org.apache.lokahi.core.common.interfaces.TMCBroker;
import org.apache.lokahi.core.common.interfaces.TMCDao;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -40,7 +40,7 @@
* @author Stephen Toback
* @version $Id$
*/
-public class Hardware extends TMCDao<Hardware> implements Server {
+public class Hardware extends TMCDao<Hardware> {
static final Logger logger = Logger.getLogger(Hardware.class);
private static final TMCBroker<Hardware> broker = new BrokerFactory<Hardware>().getBroker();
private String name;
@@ -491,20 +491,20 @@
map.put("name", this.getName());
map.put("instance", Integer.toString(this.getInstanceId()));
map.put("href", PropertiesFile.getConstantValue("rest.servlet.url") + "hardware/" + this.getPk() + '/');
- return elementBuilder("hardware", map);
+ return RestUtil.elementBuilder("hardware", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<hardware>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
- ret.append(elementBuilder("comments", this.getComments()));
- ret.append(elementBuilder("physicalLocation", this.getPhysicalLocation()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("comments", this.getComments()));
+ ret.append(RestUtil.elementBuilder("physicalLocation", this.getPhysicalLocation()));
ret.append(this.getInstance().buildShortXMLRepresentation());
ret.append(this.getStatus().buildShortXMLRepresentation());
ret.append(this.getEnv().buildShortXMLRepresentation());
- ret.append(elementBuilder("defaultIp", this.getDefaultIp().getName()));
+ ret.append(RestUtil.elementBuilder("defaultIp", this.getDefaultIp().getName()));
for (final Ip ip : this.getIpAddresses()) {
ret.append(ip.buildXMLRepresention());
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/server/HardwareModel.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/server/HardwareModel.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/server/HardwareModel.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/server/HardwareModel.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -29,6 +29,7 @@
import org.apache.lokahi.core.common.interfaces.LokahiModel;
import org.apache.lokahi.tomcat.api.server.Tomcat;
import org.apache.lokahi.tomcat.api.worker.TomcatWorker;
+import org.apache.lokahi.tomcat.api.worker.TomcatWorkerDAO;
import java.io.IOException;
import java.sql.SQLException;
@@ -116,10 +117,10 @@
}
public String buildJvmConf(Hardware h) throws SQLException {
- Collection<TomcatWorker> c = TomcatWorker.getTomcatWorkers(h, false);
+ Collection<TomcatWorker> c = TomcatWorkerDAO.getTomcatWorkers(h, false);
StringBuffer ret = new StringBuffer();
for (final TomcatWorker tw : c) {
- Tomcat t = tw.getTomcat();
+ Tomcat t = tw.getApplication();
if (t != null)
ret.append(t.buildJvmconfEntry());
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/state/State.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/state/State.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/state/State.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/state/State.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -20,11 +20,11 @@
import org.apache.lokahi.core.common.interfaces.Collectable;
import org.apache.lokahi.core.common.interfaces.Restable;
+import org.apache.lokahi.core.common.util.RestUtil;
import java.util.Collection;
import java.util.EnumSet;
import java.util.LinkedHashMap;
-import java.util.Map;
/**
* @author Stephen Toback
@@ -106,43 +106,16 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("color", this.getColor());
- return elementBuilder("state", map);
+ return RestUtil.elementBuilder("state", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<state>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
- ret.append(elementBuilder("color", this.getColor()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("color", this.getColor()));
ret.append("</state>\n");
- return ret;
- }
-
- protected static StringBuilder elementBuilder(String name, Map<String, String> a) {
- StringBuilder ret = new StringBuilder();
- ret.append('<');
- ret.append(name);
- ret.append(' ');
- for (final String s : a.keySet()) {
- ret.append(s);
- ret.append("=\"");
- ret.append(a.get(s));
- ret.append("\" ");
- }
- ret.append("/>\n");
- return ret;
- }
-
- protected static StringBuilder elementBuilder(String name, String value) {
- StringBuilder ret = new StringBuilder();
- ret.append('<');
- ret.append(name);
- ret.append('>');
- ret.append(value);
- ret.append("</");
- ret.append(name);
- ret.append(">\n");
return ret;
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/user/User.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/user/User.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/user/User.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/api/user/User.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -32,6 +32,7 @@
import org.apache.lokahi.core.common.interfaces.TMCBroker;
import org.apache.lokahi.core.common.interfaces.TMCDao;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import org.apache.lokahi.httpd.api.entity.VirtualHost;
import org.apache.lokahi.tomcat.api.entity.TomcatContext;
@@ -465,7 +466,7 @@
keepers.retainAll(newProjects);
if (newProjects != null)
newProjects.removeAll(keepers);
-
+
oldProjects.removeAll(keepers);
if (!oldProjects.isEmpty())
u.removeProject(oldProjects);
@@ -788,18 +789,18 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("href", PropertiesFile.getConstantValue("rest.servlet.url") + "user/" + this.getPk() + '/');
- return elementBuilder("user", map);
+ return RestUtil.elementBuilder("user", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<user>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
- ret.append(elementBuilder("firstName", this.getFirstName()));
- ret.append(elementBuilder("lastName", this.getLastName()));
- ret.append(elementBuilder("jobTitle", this.getJobTitle()));
- ret.append(elementBuilder("email", this.getEmail()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("firstName", this.getFirstName()));
+ ret.append(RestUtil.elementBuilder("lastName", this.getLastName()));
+ ret.append(RestUtil.elementBuilder("jobTitle", this.getJobTitle()));
+ ret.append(RestUtil.elementBuilder("email", this.getEmail()));
for (final Project p : this.getProjects()) {
ret.append(p.buildShortXMLRepresentation());
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Application.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Application.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Application.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Application.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -22,14 +22,14 @@
* @author Stephen Toback
* @version $Id$
*/
-public abstract class Application<T extends Application> extends TMCDao<T> {
- public abstract void setSysUser(String user);
+public interface Application<T extends Application> extends Restable {
+ void setSysUser(String user);
- public abstract void setSysGroup(String group);
+ void setSysGroup(String group);
- public abstract String getSysUser();
+ String getSysUser();
- public abstract String getSysGroup();
+ String getSysGroup();
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Dao.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Dao.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Dao.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Dao.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -28,7 +28,7 @@
* @version $Id$
* @see GenericDatabaseBroker
*/
-public interface Dao<T extends Dao> {
+public interface Dao<T extends Collectable> {
/**
* Creates the Dao from the passed resultset,
* internally calling the appriate constructor.
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Entity.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Entity.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Entity.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Entity.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -22,7 +22,7 @@
* @author Stephen Toback
* @version $Id$
*/
-public interface Entity {
+public interface Entity<T extends Entity> extends FunctionableEntity<T>, Restable{
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/FunctionableEntity.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/FunctionableEntity.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/FunctionableEntity.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/FunctionableEntity.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -22,10 +22,10 @@
* @author Stephen Toback
* @version $Id$
*/
-public abstract class FunctionableEntity<T extends FunctionableEntity> extends TMCDao<T> implements Entity {
- public abstract int getObjectId();
+public interface FunctionableEntity<T extends FunctionableEntity> {
+ int getObjectId();
- public abstract <T extends FunctionableEntity> T getParent();
+ T getParent();
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Pool.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Pool.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Pool.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Pool.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Added: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Poolable.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Poolable.java?view=auto&rev=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Poolable.java (added)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Poolable.java Fri Jan 5 14:22:23 2007
@@ -0,0 +1,23 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.lokahi.core.common.interfaces;
+
+/** User: toback */
+public interface Poolable extends Collectable, Restable{
+}
Added: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Stateable.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Stateable.java?view=auto&rev=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Stateable.java (added)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Stateable.java Fri Jan 5 14:22:23 2007
@@ -0,0 +1,29 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.lokahi.core.common.interfaces;
+
+import org.apache.lokahi.core.api.state.State;
+
+/** User: toback */
+public interface Stateable {
+ State getState();
+ void setState(State s);
+ boolean isActive();
+
+}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/TMCDao.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/TMCDao.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/TMCDao.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/TMCDao.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -24,6 +24,6 @@
* @author Stephen Toback
* @version $Id$
*/
-public abstract class TMCDao<T extends TMCDao> extends RestObject implements Dao<T>, Collectable {
+public abstract class TMCDao<T extends Collectable> implements Dao<T> {
public abstract T get(int id) throws SQLException;
}
Added: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Worker.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Worker.java?view=auto&rev=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Worker.java (added)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/interfaces/Worker.java Fri Jan 5 14:22:23 2007
@@ -0,0 +1,36 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.lokahi.core.common.interfaces;
+
+import org.apache.lokahi.core.api.server.Hardware;
+
+/**
+ * @author Stephen Toback
+ * @version $Id: Worker.java 422755 2006-07-17 16:20:15Z toback $
+ */
+public interface Worker<App extends Application> extends Restable, Stateable {
+ public Hardware getHardware();
+ public void setHardware(Hardware hardware);
+ public App getApplication();
+ public void setApplication(App a);
+
+}
+
+
+
Added: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/RestUtil.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/RestUtil.java?view=auto&rev=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/RestUtil.java (added)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/RestUtil.java Fri Jan 5 14:22:23 2007
@@ -0,0 +1,69 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.lokahi.core.common.util;
+
+import java.util.Map;
+
+/** User: toback */
+public class RestUtil {
+
+ /**
+ * Takes the name, and map of key, values and creates
+ * an xml represenatation.
+ *
+ * @param name of the xml object
+ * @param a Map of key, value pairs
+ *
+ * @return a xml object.
+ */
+ public static StringBuilder elementBuilder(String name, Map<String, String> a) {
+ StringBuilder ret = new StringBuilder();
+ ret.append('<');
+ ret.append(name);
+ ret.append(' ');
+ for (final String s : a.keySet()) {
+ ret.append(s);
+ ret.append("=\"");
+ ret.append(a.get(s));
+ ret.append("\" ");
+ }
+ ret.append("/>\n");
+ return ret;
+ }
+
+ /**
+ * builds an individual xml element.
+ *
+ * @param name of the element.
+ * @param value of the named element.
+ *
+ * @return representation of the element.
+ */
+ public static StringBuilder elementBuilder(String name, String value) {
+ StringBuilder ret = new StringBuilder();
+ ret.append('<');
+ ret.append(name);
+ ret.append('>');
+ ret.append(value);
+ ret.append("</");
+ ret.append(name);
+ ret.append(">\n");
+ return ret;
+ }
+}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/TMCVelocityViewTool.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/TMCVelocityViewTool.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/TMCVelocityViewTool.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/TMCVelocityViewTool.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -40,6 +40,7 @@
import org.apache.lokahi.tomcat.api.pool.TomcatPool;
import org.apache.lokahi.tomcat.api.server.Tomcat;
import org.apache.lokahi.tomcat.api.worker.TomcatWorker;
+import org.apache.lokahi.tomcat.api.worker.TomcatWorkerDAO;
import java.sql.SQLException;
import java.text.ParseException;
@@ -406,7 +407,7 @@
public Collection<TomcatWorker> getTomcatWorkers() {
TMCCollectionImpl<TomcatWorker> c = new TMCCollectionImpl<TomcatWorker>();
try {
- c.addAll(TomcatWorker.getTomcatWorkers(false));
+ c.addAll(TomcatWorkerDAO.getTomcatWorkers(false));
} catch (SQLException e) {
if (logger.isInfoEnabled()) {
logger.info("Exception: " + e.getMessage());
@@ -418,7 +419,7 @@
public Collection<TomcatWorker> getTomcatWorkers(Tomcat t) {
TMCCollectionImpl<TomcatWorker> c = new TMCCollectionImpl<TomcatWorker>();
try {
- c.addAll(TomcatWorker.getTomcatWorkers(t, false));
+ c.addAll(TomcatWorkerDAO.getTomcatWorkers(t, false));
} catch (SQLException e) {
if (logger.isInfoEnabled()) {
logger.info("Exception: " + e.getMessage());
@@ -431,7 +432,7 @@
TMCCollectionImpl<TomcatWorker> c = new TMCCollectionImpl<TomcatWorker>();
name = '%' + name.trim() + '%';
try {
- c.addAll(TomcatWorker.getTomcatWorkers(name, false));
+ c.addAll(TomcatWorkerDAO.getTomcatWorkers(name, false));
} catch (SQLException e) {
if (logger.isInfoEnabled()) {
logger.info("Exception: " + e.getMessage());
@@ -445,7 +446,7 @@
TomcatWorker tc = null;
if (!"".equals(id)) {
try {
- tc = TomcatWorker.getTomcatWorker(Integer.parseInt(id), false);
+ tc = TomcatWorkerDAO.getTomcatWorker(Integer.parseInt(id), false);
} catch (SQLException e) {
if (logger.isInfoEnabled()) {
logger.info("Exception: " + e.getMessage());
@@ -954,7 +955,7 @@
public TMCCollectionImpl<TomcatWorker> getTomcatWorkers(Hardware h) {
TMCCollectionImpl<TomcatWorker> ret = new TMCCollectionImpl<TomcatWorker>();
try {
- ret.addAll(TomcatWorker.getTomcatWorkers(h, false));
+ ret.addAll(TomcatWorkerDAO.getTomcatWorkers(h, false));
} catch (SQLException e) {
if (logger.isInfoEnabled()) {
logger.info("Exception: " + e.getMessage());
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/WapTool.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/WapTool.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/WapTool.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/core/common/util/WapTool.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -27,7 +27,7 @@
import org.apache.lokahi.httpd.api.pool.ApachePool;
import org.apache.lokahi.httpd.api.worker.ApacheWorker;
import org.apache.lokahi.tomcat.api.pool.TomcatPool;
-import org.apache.lokahi.tomcat.api.worker.TomcatWorker;
+import org.apache.lokahi.tomcat.api.worker.TomcatWorkerDAO;
import java.sql.SQLException;
import java.util.Collection;
@@ -46,7 +46,7 @@
if ("ApacheWorker".equalsIgnoreCase(type)) {
ret = ApacheWorker.getApacheWorkers(name, i, false);
} else if ("tomcatWorker".equalsIgnoreCase(type)) {
- ret = TomcatWorker.getTomcatWorkers(name, i, false);
+ ret = TomcatWorkerDAO.getTomcatWorkers(name, i, false);
}
} catch (SQLException e) {
if (logger.isInfoEnabled()) {
@@ -67,7 +67,7 @@
} else if ("ApacheWorker".equalsIgnoreCase(type)) {
ret = ApacheWorker.getApacheWorkers(name, false);
} else if ("tomcatWorker".equalsIgnoreCase(type)) {
- ret = TomcatWorker.getTomcatWorkers(name, false);
+ ret = TomcatWorkerDAO.getTomcatWorkers(name, false);
} else if ("hostingpool".equalsIgnoreCase(type)) {
ret = HostingPool.getHostingPools(name, true);
}
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/pool/ApachePool.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/pool/ApachePool.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/pool/ApachePool.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/pool/ApachePool.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -28,6 +28,7 @@
import org.apache.lokahi.core.common.interfaces.TMCBroker;
import org.apache.lokahi.core.common.interfaces.TMCDao;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import org.apache.lokahi.httpd.api.entity.VirtualHost;
import org.apache.lokahi.httpd.api.worker.ApacheWorker;
@@ -365,14 +366,14 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("href", PropertiesFile.getConstantValue("rest.servlet.url") + "apachepool/" + this.getPk() + '/');
- return elementBuilder("apachepool", map);
+ return RestUtil.elementBuilder("apachepool", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<apachepool>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
ret.append(this.getEnv().buildShortXMLRepresentation());
for (final ApacheWorker aw : this.getApaches()) {
ret.append(aw.buildShortXMLRepresentation());
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/worker/ApacheWorker.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/worker/ApacheWorker.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/worker/ApacheWorker.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/worker/ApacheWorker.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,10 +23,11 @@
import org.apache.lokahi.core.api.server.Hardware;
import org.apache.lokahi.core.api.state.State;
import org.apache.lokahi.core.common.database.BrokerFactory;
-import org.apache.lokahi.core.common.interfaces.Server;
+import org.apache.lokahi.core.common.interfaces.Worker;
import org.apache.lokahi.core.common.interfaces.TMCBroker;
import org.apache.lokahi.core.common.interfaces.TMCDao;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import org.apache.lokahi.httpd.api.pool.ApachePool;
import org.apache.lokahi.httpd.api.server.Apache;
@@ -39,7 +40,7 @@
* @author Stephen Toback
* @version $Id$
*/
-public class ApacheWorker extends TMCDao<ApacheWorker> implements Server {
+public class ApacheWorker extends TMCDao<ApacheWorker> implements Worker {
static final Logger logger = Logger.getLogger(ApacheWorker.class);
private static final TMCBroker<ApacheWorker> broker = new BrokerFactory<ApacheWorker>().getBroker();
private int pk;
@@ -375,14 +376,14 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("href", PropertiesFile.getConstantValue("rest.servlet.url") + "apacheworker/" + this.getPk() + '/');
- return elementBuilder("apacheworker", map);
+ return RestUtil.elementBuilder("apacheworker", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<apacheworker>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
ret.append(this.getState().buildShortXMLRepresentation());
ret.append(this.getApache().buildShortXMLRepresentation());
ret.append(this.getHardware().buildShortXMLRepresentation());
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/worker/ApacheWorkerModel.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/worker/ApacheWorkerModel.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/worker/ApacheWorkerModel.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/httpd/api/worker/ApacheWorkerModel.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -77,7 +77,7 @@
jp.setState(State.COMPLETE);
JobPool.update(jp);
}
-
+
private void deleteWorker(User u, ApacheWorker aw, Function f) throws AuthorizationException, SQLException {
if (u.isAllowed(f) && "DeleteApacheWorker".equals(f.getCommand())) {
ApacheWorker.delete(aw);
@@ -85,7 +85,7 @@
throw new AuthorizationException("User " + u.getName() + " Not allowed to " + f.getName());
}
}
-
+
public void deleteApacheWorker(User u, ApacheWorker aw, Function f) throws SQLException, AuthorizationException, TMCIllegalArgumentException {
if (aw == null || aw.getPk() < 1) throw new TMCIllegalArgumentException("ApacheWorker can not be null");
this.jpInit(f, u, aw.getName());
@@ -93,7 +93,7 @@
jp.setState(State.COMPLETE);
JobPool.update(jp);
}
-
+
public void deleteApacheWorker(User u, Collection<ApacheWorker> c, Function f) throws SQLException, AuthorizationException, TMCIllegalArgumentException {
this.jpInit(f, u);
StringBuffer names = new StringBuffer();
@@ -106,7 +106,7 @@
jp.setState(State.COMPLETE);
JobPool.update(jp);
}
-
+
public void gracefulApache(User u, Project p, ApacheWorker aw) throws SQLException, IOException, TMCIllegalArgumentException, AuthorizationException {
this.gracefulApache(u, p, null, aw);
}
@@ -288,7 +288,7 @@
// poolWorkers.append("worker.");
// poolWorkers.append(tw.getWorkerName());
// poolWorkers.append(".port=");
-// poolWorkers.append(tw.getTomcat().getHttpPort() - 1);
+// poolWorkers.append(tw.getApplication().getHttpPort() - 1);
// poolWorkers.append("\nworker.");
// poolWorkers.append(tw.getWorkerName());
// poolWorkers.append(".host=");
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/modjk/WorkersPropertiesFile.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/modjk/WorkersPropertiesFile.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/modjk/WorkersPropertiesFile.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/modjk/WorkersPropertiesFile.java Fri Jan 5 14:22:23 2007
@@ -116,7 +116,7 @@
poolWorkers.append("worker.");
poolWorkers.append(tw.getWorkerName());
poolWorkers.append(".port=");
- poolWorkers.append(tw.getTomcat().getHttpPort() - 1);
+ poolWorkers.append(tw.getApplication().getHttpPort() - 1);
poolWorkers.append("\nworker.");
poolWorkers.append(tw.getWorkerName());
poolWorkers.append(".host=");
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/entity/TomcatContextModel.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/entity/TomcatContextModel.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/entity/TomcatContextModel.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/entity/TomcatContextModel.java Fri Jan 5 14:22:23 2007
@@ -70,7 +70,7 @@
}
void reloadContext(JobPool jobPool, TomcatWorker tw, Project p, User u, TomcatContext tc) throws SQLException, IOException, AuthorizationException {
- String options = Integer.toString(tw.getTomcat().getHttpPort())
+ String options = Integer.toString(tw.getApplication().getHttpPort())
+ PropertiesFile.getConstantValue("agent.delim.options")
+ tc.getContextName();
this.function(tw, jobPool, options, p, u, "ReloadContext", tc);
@@ -106,7 +106,7 @@
}
void statusOfContext(JobPool jobPool, TomcatWorker tw, Project p, User u, TomcatContext tc) throws SQLException, IOException, AuthorizationException {
- String options = Integer.toString(tw.getTomcat().getHttpPort())
+ String options = Integer.toString(tw.getApplication().getHttpPort())
+ PropertiesFile.getConstantValue("agent.delim.options")
+ tc.getContextName();
this.function(tw, jobPool, options, p, u, "StatusOfContext", tc);
@@ -142,7 +142,7 @@
}
void redeployContext(JobPool jobPool, TomcatWorker tw, Project p, User u, TomcatContext tc) throws SQLException, IOException, AuthorizationException {
- String options = Integer.toString(tw.getTomcat().getHttpPort())
+ String options = Integer.toString(tw.getApplication().getHttpPort())
+ PropertiesFile.getConstantValue("agent.delim.options")
+ tc.getContextName()
+ PropertiesFile.getConstantValue("agent.delim.options")
@@ -180,7 +180,7 @@
}
void listContext(JobPool jobPool, TomcatWorker tw, Project p, User u, TomcatContext tc) throws SQLException, IOException, AuthorizationException {
- String options = Integer.toString(tw.getTomcat().getHttpPort())
+ String options = Integer.toString(tw.getApplication().getHttpPort())
+ PropertiesFile.getConstantValue("agent.delim.options")
+ tc.getContextName();
this.function(tw, jobPool, options, p, u, "ListContext", tc);
@@ -216,7 +216,7 @@
}
void installContext(JobPool jobPool, TomcatWorker tw, Project p, User u, TomcatContext tc) throws SQLException, IOException, AuthorizationException {
- String options = Integer.toString(tw.getTomcat().getHttpPort())
+ String options = Integer.toString(tw.getApplication().getHttpPort())
+ PropertiesFile.getConstantValue("agent.delim.options")
+ tc.getContextName()
+ PropertiesFile.getConstantValue("agent.delim.options")
@@ -254,7 +254,7 @@
}
void undeployContext(JobPool jobPool, TomcatWorker tw, Project p, User u, TomcatContext tc) throws SQLException, IOException, AuthorizationException {
- String options = Integer.toString(tw.getTomcat().getHttpPort())
+ String options = Integer.toString(tw.getApplication().getHttpPort())
+ PropertiesFile.getConstantValue("agent.delim.options")
+ tc.getContextName();
this.function(tw, jobPool, options, p, u, "UndeployContext", tc);
@@ -290,7 +290,7 @@
}
void sessionsOfContext(JobPool jobPool, TomcatWorker tw, Project p, User u, TomcatContext tc) throws SQLException, IOException, AuthorizationException {
- String options = Integer.toString(tw.getTomcat().getHttpPort())
+ String options = Integer.toString(tw.getApplication().getHttpPort())
+ PropertiesFile.getConstantValue("agent.delim.options")
+ tc.getContextName();
this.function(tw, jobPool, options, p, u, "SessionsOfContext", tc);
@@ -326,7 +326,7 @@
}
void startContext(JobPool jobPool, TomcatWorker tw, Project p, User u, TomcatContext tc) throws SQLException, IOException, AuthorizationException {
- String options = Integer.toString(tw.getTomcat().getHttpPort())
+ String options = Integer.toString(tw.getApplication().getHttpPort())
+ PropertiesFile.getConstantValue("agent.delim.options")
+ tc.getContextName();
this.function(tw, jobPool, options, p, u, "StartContext", tc);
@@ -362,7 +362,7 @@
}
void stopContext(JobPool jobPool, TomcatWorker tw, Project p, User u, TomcatContext tc) throws SQLException, IOException, AuthorizationException {
- String options = Integer.toString(tw.getTomcat().getHttpPort())
+ String options = Integer.toString(tw.getApplication().getHttpPort())
+ PropertiesFile.getConstantValue("agent.delim.options")
+ tc.getContextName();
this.function(tw, jobPool, options, p, u, "StopContext", tc);
@@ -397,7 +397,7 @@
if (logger.isDebugEnabled()) {
logger.debug("tw=" + tw);
}
- options.append(Integer.toString(tw.getTomcat().getHttpPort()));
+ options.append(Integer.toString(tw.getApplication().getHttpPort()));
options.append(PropertiesFile.getConstantValue("agent.delim.options"));
options.append(origOptions);
this.function(tw, jobPool, options.toString(), p, u, f);
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TMPoolWorker.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TMPoolWorker.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TMPoolWorker.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TMPoolWorker.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,6 +23,7 @@
import org.apache.lokahi.core.common.interfaces.Cacheable;
import org.apache.lokahi.core.common.interfaces.TMCBroker;
import org.apache.lokahi.tomcat.api.worker.TomcatWorker;
+import org.apache.lokahi.tomcat.api.worker.TomcatWorkerDAO;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -75,7 +76,7 @@
}
public TomcatWorker getWorker() throws SQLException {
- return TomcatWorker.getTomcatWorker(workerId, false);
+ return TomcatWorkerDAO.getTomcatWorker(workerId, false);
}
public TomcatPool getPool() throws SQLException {
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TomcatPool.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TomcatPool.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TomcatPool.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TomcatPool.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -27,8 +27,10 @@
import org.apache.lokahi.core.common.interfaces.TMCBroker;
import org.apache.lokahi.core.common.interfaces.TMCDao;
import org.apache.lokahi.core.common.util.PropertiesFile;
+import org.apache.lokahi.core.common.util.RestUtil;
import org.apache.lokahi.tomcat.api.entity.TomcatContext;
import org.apache.lokahi.tomcat.api.worker.TomcatWorker;
+import org.apache.lokahi.tomcat.api.worker.TomcatWorkerDAO;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -105,7 +107,7 @@
public Collection<TomcatWorker> getTomcatWorkers() {
if (tomcatWorkers == null) {
try {
- this.tomcatWorkers = TomcatWorker.getTomcatWorkers(this, false);
+ this.tomcatWorkers = TomcatWorkerDAO.getTomcatWorkers(this, false);
} catch (SQLException e) {
if (logger.isInfoEnabled()) {
logger.info("Exception: " + e.getMessage());
@@ -120,7 +122,7 @@
if (i != null) {
if (tomcatWorkers == null) {
try {
- this.tomcatWorkers = TomcatWorker.getTomcatWorkers(this, false);
+ this.tomcatWorkers = TomcatWorkerDAO.getTomcatWorkers(this, false);
} catch (SQLException e) {
if (logger.isInfoEnabled()) {
logger.info("Exception: " + e.getMessage());
@@ -171,7 +173,7 @@
// Collection<TomcatWorker> c = this.getTomcatWorkers();
// int ret = 0;
// for (TomcatWorker t : c) {
-// ret += t.getTomcat().getHttpPort();
+// ret += t.getApplication().getHttpPort();
// }
// if (c.size() != 0)
// ret /= c.size();
@@ -378,15 +380,15 @@
map.put("id", Integer.toString(this.getPk()));
map.put("name", this.getName());
map.put("href", PropertiesFile.getConstantValue("rest.servlet.url") + "tomcatpool/" + this.getPk() + '/');
- return elementBuilder("tomcatpool", map);
+ return RestUtil.elementBuilder("tomcatpool", map);
}
public StringBuilder buildXMLRepresention() {
StringBuilder ret = new StringBuilder();
ret.append("<tomcatpool>\n");
- ret.append(elementBuilder("id", Integer.toString(this.getPk())));
- ret.append(elementBuilder("name", this.getName()));
- ret.append(elementBuilder("workerName", this.getWorkerName()));
+ ret.append(RestUtil.elementBuilder("id", Integer.toString(this.getPk())));
+ ret.append(RestUtil.elementBuilder("name", this.getName()));
+ ret.append(RestUtil.elementBuilder("workerName", this.getWorkerName()));
ret.append(this.getEnv().buildShortXMLRepresentation());
for (final TomcatWorker tw : this.getTomcatWorkers()) {
ret.append(tw.buildShortXMLRepresentation());
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TomcatPoolModel.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TomcatPoolModel.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TomcatPoolModel.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/pool/TomcatPoolModel.java Fri Jan 5 14:22:23 2007
@@ -268,7 +268,7 @@
// TomcatWorkerModel twm = new TomcatWorkerModel();
// for (Iterator i = c.iterator(); i.hasNext();) {
// TomcatWorker tw = (TomcatWorker) i.next();
-// if (tw.getTomcat() != null && tw.getHardware() != null) {
+// if (tw.getApplication() != null && tw.getHardware() != null) {
// twm.deployTomcatConfig(u, p, jp, tw);
// }
// }
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/server/Tomcat.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/server/Tomcat.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/server/Tomcat.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/server/Tomcat.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -37,7 +37,7 @@
* @author Stephen Toback
* @version $Id$
*/
-public class Tomcat extends Application<Tomcat> {
+public class Tomcat implements Application<Tomcat> {
static final Logger logger = Logger.getLogger(Tomcat.class);
private static final TMCBroker<Tomcat> broker = new BrokerFactory<Tomcat>().getBroker();
private int tomcatType = 4;
Modified: incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/worker/ServerXmlFile.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/worker/ServerXmlFile.java?view=diff&rev=493210&r1=493209&r2=493210
==============================================================================
--- incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/worker/ServerXmlFile.java (original)
+++ incubator/lokahi/lokahi/branches/jackrabbit/src/java/org/apache/lokahi/tomcat/api/worker/ServerXmlFile.java Fri Jan 5 14:22:23 2007
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
-*
+*
* http://www.apache.org/licenses/LICENSE-2.0
-*
+*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -60,7 +60,7 @@
}
private Document build4() throws SQLException {
- Tomcat tc = tw.getTomcat();
+ Tomcat tc = tw.getApplication();
Document doc = null;
if (tc != null) {
int httpPort = tc.getHttpPort();
@@ -166,7 +166,7 @@
}
private Document build5() throws SQLException {
- Tomcat tc = tw.getTomcat();
+ Tomcat tc = tw.getApplication();
Document doc = null;
if (tc != null) {
int httpPort = tc.getHttpPort();
@@ -282,7 +282,7 @@
}
private Document build6() throws SQLException {
- Tomcat tc = tw.getTomcat();
+ Tomcat tc = tw.getApplication();
Document doc = null;
if (tc != null) {
int httpPort = tc.getHttpPort();