Index: org/apache/lokahi/core/agent/jmx/JMXConnect.java =================================================================== --- org/apache/lokahi/core/agent/jmx/JMXConnect.java (revision 619464) +++ org/apache/lokahi/core/agent/jmx/JMXConnect.java (working copy) @@ -125,7 +125,7 @@ /** * @param pid * - * @return + * @return a string containing the JMX url * @throws IOException * @deprecated */ @@ -180,7 +180,7 @@ /** * @param JMXurl * - * @return + * @return a new connection to the JMX URL. * @throws IOException * @deprecated */ @@ -203,7 +203,7 @@ /** * @param pid * - * @return + * @return a new connection to the JMX URL using the pid of the JMX url * @throws IOException * @deprecated */ Index: org/apache/lokahi/core/api/environment/Environment.java =================================================================== --- org/apache/lokahi/core/api/environment/Environment.java (revision 619464) +++ org/apache/lokahi/core/api/environment/Environment.java (working copy) @@ -92,7 +92,7 @@ * @param id * @param fromCache * - * @return + * @return an environment with the given ID or null if it is not found * @throws SQLException * @deprecated */ Index: org/apache/lokahi/core/api/file/File.java =================================================================== --- org/apache/lokahi/core/api/file/File.java (revision 619464) +++ org/apache/lokahi/core/api/file/File.java (working copy) @@ -206,7 +206,7 @@ /** * @param id * - * @return + * @return a file with the given ID or null if it is not found * @throws SQLException * @deprecated */ Index: org/apache/lokahi/core/api/instance/Instance.java =================================================================== --- org/apache/lokahi/core/api/instance/Instance.java (revision 619464) +++ org/apache/lokahi/core/api/instance/Instance.java (working copy) @@ -103,7 +103,7 @@ * @param id * @param fromCache * - * @return + * @return an instance with the given ID or null if it is not found * @throws SQLException * @deprecated */ Index: org/apache/lokahi/core/api/project/Project.java =================================================================== --- org/apache/lokahi/core/api/project/Project.java (revision 619464) +++ org/apache/lokahi/core/api/project/Project.java (working copy) @@ -262,7 +262,7 @@ /** * @param id * - * @return + * @return a project with the given ID or null if it is not found * @throws SQLException * @deprecated */ Index: org/apache/lokahi/core/api/server/HardwareModel.java =================================================================== --- org/apache/lokahi/core/api/server/HardwareModel.java (revision 619464) +++ org/apache/lokahi/core/api/server/HardwareModel.java (working copy) @@ -100,44 +100,11 @@ JobPool.update(jp); } - public void deployJvmConf(User u, Collection c, JobPool jobPool) throws SQLException, IOException { - for (final Hardware h : c) { - this.deployJvmConf(u, h, jobPool); - } - } - - public void deployJvmConf(User u, Hardware h, JobPool jobPool) throws SQLException, IOException { - Function f = Function.getFunction("PutFile"); - Job j = new Job("./jvm.conf", h, f, jobPool); - j.setResult(this.buildJvmConf(h)); - j = Job.store(j); - j = new Job(j, "", h, Function.getFunction("UpdateTomcat"), jobPool); - Job.store(j); - } - - public String buildJvmConf(Hardware h) throws SQLException { - Collection c = TomcatWorker.getTomcatWorkers(h, false); - StringBuffer ret = new StringBuffer(); - for (final TomcatWorker tw : c) { - Tomcat t = tw.getTomcat(); - if (t != null) - ret.append(t.buildJvmconfEntry()); - } - return ret.toString(); - } - public void addHardware(User u, String hardwareName, String physicalLocation, String comments, int instanceId, int envId, int statusId, String defaultIp, String... ips) throws AuthorizationException, TMCIllegalArgumentException, SQLException, IOException { Hardware h = new Hardware(); //todo finish this this.addHardware(u, h); } -// public void addHardware(User u, Hardware h) throws AuthorizationException, TMCIllegalArgumentException, SQLException, IOException { -// Function f = Function.getFunction("AddHardware"); -// this.jpInit(f, u, h.getName()); -// if (!u.isAllowed(f)) throw new AuthorizationException("User " + u.getName() + " Not allowed to " + f.getName()); -// this.addHardware(jp, h); -// } - public void addHardware(JobPool jp, Hardware h) throws AuthorizationException, TMCIllegalArgumentException, SQLException, IOException { } @@ -173,7 +140,7 @@ } /** - * @return + * @return A collection of all of the hardware * @throws SQLException * @deprecated */ Index: org/apache/lokahi/core/api/template/Template.java =================================================================== --- org/apache/lokahi/core/api/template/Template.java (revision 0) +++ org/apache/lokahi/core/api/template/Template.java (revision 0) @@ -0,0 +1,289 @@ +/* +* 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.api.template; + +import org.apache.log4j.Logger; +import org.apache.lokahi.core.common.database.BrokerFactory; +import org.apache.lokahi.core.common.interfaces.Entity; +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 java.sql.Blob; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Collection; +import java.util.LinkedHashMap; + +/** + * @author The Apache Incubated Lokahi project - http://incubator.apache.org/lokahi/ + * @version $Id$ + */ +public class Template extends TMCDao