incubator-kalumet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r1187711 [3/5] - in /incubator/kalumet/trunk: ./ common/ common/src/ common/src/main/ common/src/main/java/ common/src/main/java/org/ common/src/main/java/org/apache/ common/src/main/java/org/apache/kalumet/ common/src/main/java/org/apache/...
Date Sat, 22 Oct 2011 13:10:04 GMT
Added: incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Database.java
URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Database.java?rev=1187711&view=auto
==============================================================================
--- incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Database.java (added)
+++ incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Database.java Sat Oct 22 13:10:01 2011
@@ -0,0 +1,240 @@
+/*
+ * 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.kalumet.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.xerces.dom.CoreDocumentImpl;
+import org.apache.xerces.dom.ElementImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Represent the <code>database</code> tag in the Kalumet configuration DOM.
+ */
+public class Database implements Serializable, Cloneable, Comparable {
+
+    private static final long serialVersionUID = 119112072290707974L;
+
+    private String name;
+    private String driver;
+    private String user;
+    private String password;
+    private String jdbcurl;
+    private String connectionPool;
+    private String sqlCommand;
+    private String agent;
+    private boolean active;
+    private boolean blocker;
+    private LinkedList sqlScripts;
+
+    public Database() {
+        this.sqlScripts = new LinkedList();
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDriver() {
+        return this.driver;
+    }
+
+    public void setDriver(String driver) {
+        this.driver = driver;
+    }
+
+    public String getUser() {
+        return this.user;
+    }
+
+    public void setUser(String user) {
+        this.user = user;
+    }
+
+    public String getPassword() {
+        return this.password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getJdbcurl() {
+        return this.jdbcurl;
+    }
+
+    public void setJdbcurl(String jdbcurl) {
+        this.jdbcurl = jdbcurl;
+    }
+
+    public String getConnectionPool() {
+        return connectionPool;
+    }
+
+    public void setConnectionPool(String connectionPool) {
+        this.connectionPool = connectionPool;
+    }
+
+    public String getSqlCommand() {
+        return sqlCommand;
+    }
+
+    public void setSqlCommand(String sqlCommand) {
+        this.sqlCommand = sqlCommand;
+    }
+
+    public String getAgent() {
+        return agent;
+    }
+
+    public void setAgent(String agent) {
+        this.agent = agent;
+    }
+
+    public boolean isActive() {
+        return this.active;
+    }
+
+    public void setActive(boolean active) {
+        this.active = active;
+    }
+
+    public boolean isBlocker() {
+        return this.blocker;
+    }
+
+    public void setBlocker(boolean blocker) {
+        this.blocker = blocker;
+    }
+
+    /**
+     * Add a new <code>SqlScript</code> in the <code>Database</code> sqlscripts
+     * container.
+     * 
+     * @param sqlScript the <code>SqlScript</code> to add.
+     */
+    public void addSqlScript(SqlScript sqlScript) throws ModelObjectAlreadyExistsException {
+        if (this.getSqlScript(sqlScript.getName()) != null) {
+            throw new ModelObjectAlreadyExistsException("SQL script name already exists in database.");
+        }
+        this.sqlScripts.add(sqlScript);
+    }
+
+    /**
+     * Get the <code>SqlScript</code> list in the <code>Database</code>
+     * sqlscripts container.
+     * 
+     * @return the <code>SqlScript</code> list.
+     */
+    public List getSqlScripts() {
+        return this.sqlScripts;
+    }
+
+    /**
+     * Set the <code>SqlScript</code> list in the <code>Database</code>
+     * sqlscripts container.
+     * 
+     * @param sqlScripts the new <code>SqlScript</code> list.
+     */
+    public void setSqlScripts(LinkedList sqlScripts) {
+        this.sqlScripts = sqlScripts;
+    }
+
+    /**
+     * Get the <code>SqlScript</code> identified by a given name in the
+     * <code>Database</code> sqlscripts container.
+     * 
+     * @param name the <code>SqlScript</code> name.
+     * @return the <code>SqlScript</code> found or null if no <code>SqlScript</code> found.
+     */
+    public SqlScript getSqlScript(String name) {
+        for (Iterator sqlScriptIterator = this.getSqlScripts().iterator(); sqlScriptIterator.hasNext();) {
+            SqlScript sqlScript = (SqlScript) sqlScriptIterator.next();
+            if (sqlScript.getName().equals(name)) {
+                return sqlScript;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * @see java.lang.Object#clone()
+     */
+    public Object clone() throws CloneNotSupportedException {
+        Database clone = new Database();
+        clone.setName(this.getName());
+        clone.setDriver(this.getDriver());
+        clone.setUser(this.getUser());
+        clone.setPassword(this.getPassword());
+        clone.setJdbcurl(this.getJdbcurl());
+        clone.setConnectionPool(this.getConnectionPool());
+        clone.setSqlCommand(this.getSqlCommand());
+        clone.setAgent(this.getAgent());
+        clone.setActive(this.isActive());
+        clone.setBlocker(this.isBlocker());
+        for (Iterator sqlScriptIterator = this.sqlScripts.iterator(); sqlScriptIterator.hasNext();) {
+            SqlScript sqlScript = (SqlScript) sqlScriptIterator.next();
+            clone.sqlScripts.add((SqlScript) sqlScript.clone());
+        }
+        return clone;
+    }
+
+    /**
+     * Transform the <code>Database</code> POJO to a DOM element.
+     * 
+     * @param document the core XML document.
+     * @return the DOM element.
+     */
+    protected Element toDOMElement(CoreDocumentImpl document) {
+        ElementImpl element = new ElementImpl(document, "database");
+        element.setAttribute("name", this.getName());
+        element.setAttribute("driver", this.getDriver());
+        element.setAttribute("user", this.getUser());
+        element.setAttribute("password", this.getPassword());
+        element.setAttribute("jdbcurl", this.getJdbcurl());
+        element.setAttribute("connectionPool", this.getConnectionPool());
+        element.setAttribute("sqlCommand", this.getSqlCommand());
+        element.setAttribute("agent", this.getAgent());
+        element.setAttribute("active", new Boolean(this.isActive()).toString());
+        element.setAttribute("blocker", new Boolean(this.isBlocker()).toString());
+        // sqlscripts
+        ElementImpl sqlscripts = new ElementImpl(document, "sqlscripts");
+        for (Iterator sqlScriptIterator = this.getSqlScripts().iterator(); sqlScriptIterator.hasNext();) {
+            SqlScript sqlScript = (SqlScript) sqlScriptIterator.next();
+            sqlscripts.appendChild(sqlScript.toDOMElement(document));
+        }
+        element.appendChild(sqlscripts);
+        return element;
+    }
+    
+    /**
+     * @see java.lang.Comparable#compareTo(java.lang.Object)
+     */
+    public int compareTo(Object anotherDatabase) {
+        return this.getName().compareTo(((Database)anotherDatabase).getName());
+    }
+
+}
\ No newline at end of file

Added: incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Destination.java
URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Destination.java?rev=1187711&view=auto
==============================================================================
--- incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Destination.java (added)
+++ incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Destination.java Sat Oct 22 13:10:01 2011
@@ -0,0 +1,74 @@
+/*
+ * 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.kalumet.model;
+
+import java.io.Serializable;
+
+import org.apache.xerces.dom.CoreDocumentImpl;
+import org.apache.xerces.dom.ElementImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Represent the <code>destination</code> tag in the Kalumet configuration DOM.
+ */
+public class Destination implements Serializable, Cloneable, Comparable {
+
+   private static final long serialVersionUID = 1088692045286398988L;
+
+   private String address;
+
+   public Destination() { }
+
+   public String getAddress() {
+      return this.address;
+   }
+
+   public void setAddress(String address) {
+      this.address = address;
+   }
+
+   /**
+    * @see java.lang.Object#clone()
+    */
+   public Object clone() throws CloneNotSupportedException {
+      Destination clone = new Destination();
+      clone.setAddress(this.getAddress());
+      return clone;
+   }
+
+   /**
+    * Transform the <code>Destination</code> POJO to a DOM element.
+    * 
+    * @param document the DOM document.
+    * @return the DOM element.
+    */
+   protected Element toDOMElement(CoreDocumentImpl document) {
+      ElementImpl element = new ElementImpl(document, "destination");
+      element.setAttribute("address", this.getAddress());
+      return element;
+   }
+   
+   /**
+    * @see java.lang.Comparable#compareTo(java.lang.Object)
+    */
+   public int compareTo(Object anotherDestination) {
+       return this.getAddress().compareTo(((Destination)anotherDestination).getAddress());
+   }
+
+}
\ No newline at end of file

Added: incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Email.java
URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Email.java?rev=1187711&view=auto
==============================================================================
--- incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Email.java (added)
+++ incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Email.java Sat Oct 22 13:10:01 2011
@@ -0,0 +1,152 @@
+/*
+ * 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.kalumet.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.xerces.dom.CoreDocumentImpl;
+import org.apache.xerces.dom.ElementImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Represent the <code>Email</code> tag in the Kalumet configuration DOM.
+ */
+public class Email implements Serializable, Cloneable, Comparable {
+
+   private static final long serialVersionUID = -88087573038809801L;
+
+   private String mailhost;
+   private String from;
+   private LinkedList destinations;
+
+   public Email() {
+      this.destinations = new LinkedList();
+   }
+
+   public String getMailhost() {
+      return this.mailhost;
+   }
+
+   public void setMailhost(String mailhost) {
+      this.mailhost = mailhost;
+   }
+
+   public String getFrom() {
+      return this.from;
+   }
+
+   public void setFrom(String from) {
+      this.from = from;
+   }
+
+   /**
+    * Add a new <code>Destination</code> in the <code>Email</code>
+    * destinations container.
+    * 
+    * @param destination the <code>Destination</code> to add.
+    */
+   public void addDestination(Destination destination) throws ModelObjectAlreadyExistsException {
+      if (this.getDestination(destination.getAddress()) != null) {
+         throw new ModelObjectAlreadyExistsException("Destination address already exists in the email destinations.");
+      }
+      this.destinations.add(destination);
+   }
+
+   /**
+    * Get the <code>Destination</code> list in the <code>Email</code>
+    * destinations container.
+    * 
+    * @return the <code>Destination</code> list.
+    */
+   public List getDestinations() {
+      return this.destinations;
+   }
+
+   /**
+    * Set the <code>Destination</code> list in the <code>Email</code>
+    * destinations container.
+    * 
+    * @param destinations the new <code>Destination</code> list.
+    */
+   public void setDestinations(LinkedList destinations) {
+      this.destinations = destinations;
+   }
+
+   /**
+    * Get the <code>Destination</code> identified by a given address in the
+    * <code>Email</code> destinations container.
+    * 
+    * @param address the <code>Destination</code> address.
+    * @return the <code>Destination</code> found or null if not found.
+    */
+   public Destination getDestination(String address) {
+      for (Iterator destinationIterator = this.getDestinations().iterator(); destinationIterator.hasNext();) {
+         Destination destination = (Destination) destinationIterator.next();
+         if (destination.getAddress().equals(address)) {
+            return destination;
+         }
+      }
+      return null;
+   }
+
+   /**
+    * @see java.lang.Object#clone()
+    */
+   public Object clone() throws CloneNotSupportedException {
+      Email clone = new Email();
+      clone.setMailhost(this.getMailhost());
+      clone.setFrom(this.getFrom());
+      for (Iterator destinationIterator = this.destinations.iterator(); destinationIterator.hasNext(); ) {
+          Destination destination = (Destination)destinationIterator.next();
+          clone.destinations.add((Destination)destination.clone());
+      }
+      return clone;
+   }
+
+   /**
+    * Transform the <code>Email</code> POJO to a DOM element.
+    * 
+    * @param document the DOM document.
+    * @return the DOM element.
+    */
+   protected Element toDOMElement(CoreDocumentImpl document) {
+      ElementImpl element = new ElementImpl(document, "email");
+      element.setAttribute("mailhost", this.getMailhost());
+      element.setAttribute("from", this.getFrom());
+      // destinations
+      ElementImpl destinations = new ElementImpl(document, "destinations");
+      for (Iterator destinationIterator = this.getDestinations().iterator(); destinationIterator.hasNext();) {
+         Destination destination = (Destination) destinationIterator.next();
+         destinations.appendChild(destination.toDOMElement(document));
+      }
+      element.appendChild(destinations);
+      return element;
+   }
+   
+   /**
+    * @see java.lang.Comparable#compareTo(java.lang.Object)
+    */
+   public int compareTo(Object anotherEmail) {
+       return this.getMailhost().compareTo(((Email)anotherEmail).getMailhost());
+   }
+
+}
\ No newline at end of file

Added: incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Environment.java
URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Environment.java?rev=1187711&view=auto
==============================================================================
--- incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Environment.java (added)
+++ incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Environment.java Sat Oct 22 13:10:01 2011
@@ -0,0 +1,633 @@
+/*
+ * 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.kalumet.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.xerces.dom.CDATASectionImpl;
+import org.apache.xerces.dom.CoreDocumentImpl;
+import org.apache.xerces.dom.ElementImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Represent the <code>environment</code> tag in the Kalumet configuration DOM.
+ */
+public class Environment implements Serializable, Cloneable, Comparable {
+
+   private static final long serialVersionUID = -5131247974934459040L;
+
+   private String name;
+   private String group;
+   private String tag;
+   private boolean autoupdate;
+   private String agent;
+   private String lock;
+   private String releaseLocation;
+   private String notes;
+   private String weblinks;
+   private LinkedList variables;
+   private LinkedList freeFields;
+   private LinkedList accesses;
+   private ApplicationServers applicationServers;
+   private LinkedList softwares;
+   private LinkedList logFiles;
+   private Notifiers notifiers;
+   private LinkedList publishers;
+   private Statistics statistics;
+
+   public Environment() {
+      this.variables = new LinkedList();
+      this.freeFields = new LinkedList();
+      this.accesses = new LinkedList();
+      this.applicationServers = new ApplicationServers();
+      this.softwares = new LinkedList();
+      this.logFiles = new LinkedList();
+      this.notifiers = new Notifiers();
+      this.publishers = new LinkedList();
+      this.statistics = new Statistics();
+   }
+
+   public String getName() {
+      return this.name;
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   public String getGroup() {
+      return this.group;
+   }
+
+   public void setGroup(String group) {
+      this.group = group;
+   }
+   
+   public String getTag() {
+       return this.tag;
+   }
+   
+   public void setTag(String flag) {
+       this.tag = flag;
+   }
+
+   public boolean getAutoupdate() {
+      return this.autoupdate;
+   }
+
+   public void setAutoupdate(boolean autoupdate) {
+      this.autoupdate = autoupdate;
+   }
+
+   public String getAgent() {
+      return this.agent;
+   }
+
+   public void setAgent(String agent) {
+      this.agent = agent;
+   }
+
+   public String getLock() {
+      return this.lock;
+   }
+
+   public void setLock(String lock) {
+      this.lock = lock;
+   }
+   
+   public String getReleaseLocation() {
+      return this.releaseLocation;
+   }
+   
+   public void setReleaseLocation(String releaseLocation) {
+      this.releaseLocation = releaseLocation;
+   }
+
+   public String getNotes() {
+      return this.notes;
+   }
+
+   public void setNotes(String notes) {
+      this.notes = notes;
+   }
+
+   public String getWeblinks() {
+      return this.weblinks;
+   }
+
+   public void setWeblinks(String weblinks) {
+      this.weblinks = weblinks;
+   }
+
+   /**
+    * Add a new <code>Variable</code> in the <code>Environment</code>
+    * variables container.
+    * 
+    * @param variable the <code>Variable</code> to add.
+    */
+   public void addVariable(Variable variable) throws ModelObjectAlreadyExistsException {
+      if (this.getVariable(variable.getName()) != null) {
+         throw new ModelObjectAlreadyExistsException("Variable name already exists in the environment variables.");
+      }
+      this.variables.add(variable);
+   }
+
+   /**
+    * Get the <code>Variable</code> list in the <code>Environment</code>
+    * variables container.
+    * 
+    * @return the <code>Variable</code> list.
+    */
+   public List getVariables() {
+      return this.variables;
+   }
+
+   /**
+    * Set the <code>Variable</code> list in the <code>Environment</code>
+    * variables container.
+    * 
+    * @param variables the new <code>Variable</code> list.
+    */
+   public void setVariables(LinkedList variables) {
+      this.variables = variables;
+   }
+
+   /**
+    * Get the <code>Variable</code> identified by a given name in the
+    * <code>Environment</code> variables container.
+    * 
+    * @param name the <code>Variable</code> name.
+    * @return the <code>Variable</code> found or null if not found.
+    */
+   public Variable getVariable(String name) {
+      for (Iterator variableIterator = this.getVariables().iterator(); variableIterator.hasNext();) {
+         Variable variable = (Variable) variableIterator.next();
+         if (variable.getName().equals(name)) {
+            return variable;
+         }
+      }
+      return null;
+   }
+
+   /**
+    * Add a new <code>FreeField</code> in the <code>Environment</code>
+    * free fields container.
+    * 
+    * @param freeField the <code>FreeField</code> to add.
+    */
+   public void addFreeField(FreeField freeField) throws ModelObjectAlreadyExistsException {
+      if (this.getFreeField(freeField.getName()) != null) {
+         throw new ModelObjectAlreadyExistsException("Freefield name already exists in the environment freefields.");
+      }
+      this.freeFields.add(freeField);
+   }
+
+   /**
+    * Get the <code>FreeField</code> list in the <code>Environment</code>
+    * free fields container.
+    * 
+    * @return the <code>FreeField</code> list.
+    */
+   public List getFreeFields() {
+      return this.freeFields;
+   }
+
+   /**
+    * Set the <code>FreeField<code> list in the <code>Environment</code> 
+    * free fields container.
+    *
+    * @param freeFields the new <code>FreeField</code> list.
+    */
+   public void setFreeFields(LinkedList freeFields) {
+      this.freeFields = freeFields;
+   }
+
+   /**
+    * Get the <code>FreeField</code> identified by a given name in the
+    * <code>Environment</code> free fields container.
+    * 
+    * @param name the <code>FreeField</code> name.
+    * @return the <code>FreeField</code> found or null if not found.
+    */
+   public FreeField getFreeField(String name) {
+      for (Iterator freeFieldIterator = this.getFreeFields().iterator(); freeFieldIterator.hasNext();) {
+         FreeField freeField = (FreeField) freeFieldIterator.next();
+         if (freeField.getName().equals(name)) {
+            return freeField;
+         }
+      }
+      return null;
+   }
+
+   /**
+    * Add a new <code>Access</code> in the <code>Environment</code> accesses
+    * container.
+    * 
+    * @param access the <code>Access</code> to add.
+    */
+   public void addAccess(Access access) throws ModelObjectAlreadyExistsException {
+      if (this.getAccess(access.getGroup()) != null) {
+         throw new ModelObjectAlreadyExistsException("Access group id already exists in the environnement accesses.");
+      }
+      this.accesses.add(access);
+   }
+
+   /**
+    * Get the <code>Access</code> list in the <code>Environment</code>
+    * accesses container.
+    * 
+    * @return the <code>Access</code> list.
+    */
+   public List getAccesses() {
+      return this.accesses;
+   }
+
+   /**
+    * Set the <code>Access</code> list in the <code>Environment</code>
+    * accesses container.
+    * 
+    * @param accesses the new <code>Access</code> list.
+    */
+   public void setAccesses(LinkedList accesses) {
+      this.accesses = accesses;
+   }
+
+   /**
+    * Get the <code>Access</code> identified by a given group id in the
+    * <code>Environment</code> accesses container.
+    * 
+    * @param group the group id.
+    * @return the <code>Access</code> found or null if not found.
+    */
+   public Access getAccess(String group) {
+      for (Iterator accessIterator = this.getAccesses().iterator(); accessIterator.hasNext();) {
+         Access access = (Access) accessIterator.next();
+         if (access.getGroup().equals(group)) {
+            return access;
+         }
+      }
+      return null;
+   }
+
+   /**
+    * Set the <code>ApplicationServers</code> container in the
+    * <code>Environment</code>.
+    * 
+    * @param applicationServers the <code>ApplicationServers</code> to set.
+    */
+   public void setApplicationServers(ApplicationServers applicationServers) {
+      this.applicationServers = applicationServers;
+   }
+
+   /**
+    * Get the <code>ApplicationServers</code> container in the
+    * <code>Environment</code>.
+    * 
+    * @return the <code>ApplicationServers</code> container.
+    */
+   public ApplicationServers getApplicationServers() {
+      return this.applicationServers;
+   }
+
+   /**
+    * Add a new <code>Software</code> in the <code>Environment</code>
+    * softwares container.
+    * 
+    * @param software the <code>Software</code> to add.
+    */
+   public void addSoftware(Software software) throws ModelObjectAlreadyExistsException {
+      if (this.getSoftware(software.getName()) != null) {
+         throw new ModelObjectAlreadyExistsException("Software name already exists in the environment.");
+      }
+      this.softwares.add(software);
+   }
+
+   /**
+    * Get the <code>Software</code> list in the <code>Environment</code>
+    * softwares container.
+    * 
+    * @return the <code>Software</code> list.
+    */
+   public List getSoftwares() {
+      return this.softwares;
+   }
+
+   /**
+    * Set the <code>Software</code> list in the <code>Environment</code>
+    * softwares container.
+    * 
+    * @param softwares the new <code>Software</code> list.
+    */
+   public void setSoftwares(LinkedList softwares) {
+      this.softwares = softwares;
+   }
+
+   /**
+    * Get the <code>Software</code> identified by a given name in the
+    * <code>Environment</code> softwares container.
+    * 
+    * @param name the <code>Software</code> name.
+    * @return the <code>Software</code> found or null if not found.
+    */
+   public Software getSoftware(String name) {
+      for (Iterator softwareIterator = this.getSoftwares().iterator(); softwareIterator.hasNext();) {
+         Software software = (Software) softwareIterator.next();
+         if (software.getName().equals(name)) {
+            return software;
+         }
+      }
+      return null;
+   }
+   
+   /**
+    * Get the environment log files list.
+    * 
+    * @return the log files list.
+    */
+   public List getLogFiles() {
+       return this.logFiles;
+   }
+   
+   /**
+    * Set the environment log files list.
+    * 
+    * @param logFiles the log files list.
+    */
+   public void setLogFiles(LinkedList logFiles) {
+       this.logFiles = logFiles;
+   }
+   
+   /**
+    * Get a log file identified by a name.
+    * 
+    * @param name the log file name.
+    * @return the log file or null if not found.
+    */
+   public LogFile getLogFile(String name) {
+       for (Iterator logFileIterator = this.getLogFiles().iterator(); logFileIterator.hasNext(); ) {
+           LogFile logFile = (LogFile) logFileIterator.next();
+           if (logFile.getName().equals(name)) {
+               return logFile;
+           }
+       }
+       return null;
+   }
+   
+   /**
+    * Add a new log file in the environment.
+    * 
+    * @param logFile the log file to add.
+    * @throws ModelObjectAlreadyExistsException if the log file name already exists.
+    */
+   public void addLogFile(LogFile logFile) throws ModelObjectAlreadyExistsException {
+       if (this.getLogFile(logFile.getName()) != null) {
+           throw new ModelObjectAlreadyExistsException("Log file name already exists in environment.");
+       }
+       this.logFiles.add(logFile);
+   }
+
+   /**
+    * Set the <code>Notifiers</code> in the <code>Environment</code>.
+    * 
+    * @param notifiers the <code>Notifiers</code> to set.
+    */
+   public void setNotifiers(Notifiers notifiers) {
+      this.notifiers = notifiers;
+   }
+
+   /**
+    * Get the <code>Notifiers</code> in the <code>Environment</code>.
+    * 
+    * @return the <code>Notifiers</code> in the <code>Environment</code>.
+    */
+   public Notifiers getNotifiers() {
+      return this.notifiers;
+   }
+
+   /**
+    * Add a new <code>Email</code> publisher in the <code>Environment</code>
+    * publishers container.
+    * 
+    * @param email the <code>Email</code> to add.
+    */
+   public void addPublisher(Email email) throws ModelObjectAlreadyExistsException {
+      if (this.getPublisher(email.getMailhost()) != null) {
+         throw new ModelObjectAlreadyExistsException("Email publisher mailhost already exists in environment.");
+      }
+      this.publishers.add(email);
+   }
+
+   /**
+    * Get the <code>Email</code> publisher list in the
+    * <code>Environment</code> publishers container.
+    * 
+    * @return the <code>Email</code> publisher list.
+    */
+   public List getPublishers() {
+      return this.publishers;
+   }
+
+   /**
+    * Set the <code>Email</code> publisher list in the
+    * <code>Environment</code> publishers container.
+    * 
+    * @param publishers the new <code>Email</code> publisher list.
+    */
+   public void setPublishers(LinkedList publishers) {
+      this.publishers = publishers;
+   }
+
+   /**
+    * Get the <code>Email</code> publisher identified by a given mail host
+    * in the <code>Environment</code> publishers container.
+    * 
+    * @param mailhost the <code>Email</code> mail host.
+    * @return the <code>Email</code> found or null if not found.
+    */
+   public Email getPublisher(String mailhost) {
+      for (Iterator publisherIterator = this.getPublishers().iterator(); publisherIterator.hasNext();) {
+         Email email = (Email) publisherIterator.next();
+         if (email.getMailhost().equals(mailhost)) {
+            return email;
+         }
+      }
+      return null;
+   }
+   
+   /**
+    * Set the <code>Statistics</code> container.
+    * 
+    * @return statistics the new <code>Statistics</code> container.
+    */
+   public Statistics getStatistics() {
+       return statistics;
+   }
+
+   /**
+    * Get the <code>Statistics</code> container.
+    * 
+    * @param statistics the current <code>Statistics</code> container.
+    */
+   public void setStatistics(Statistics statistics) {
+       this.statistics = statistics;
+    }
+
+    /**
+    * @see java.lang.Object#clone()
+    */
+   public Object clone() throws CloneNotSupportedException {
+      Environment clone = new Environment();
+      clone.setName(this.getName());
+      clone.setGroup(this.getGroup());
+      clone.setTag(this.getTag());
+      clone.setAutoupdate(this.getAutoupdate());
+      clone.setAgent(this.getAgent());
+      clone.setLock(this.getLock());
+      clone.setReleaseLocation(this.getReleaseLocation());
+      clone.setNotes(this.getNotes());
+      clone.setWeblinks(this.getWeblinks());
+      for (Iterator variableIterator = this.variables.iterator(); variableIterator.hasNext(); ) {
+          Variable variable = (Variable)variableIterator.next();
+          clone.variables.add((Variable)variable.clone());
+      }
+      for (Iterator freeFieldIterator = this.freeFields.iterator(); freeFieldIterator.hasNext(); ) {
+          FreeField freeField = (FreeField)freeFieldIterator.next();
+          clone.freeFields.add((FreeField)freeField.clone());
+      }
+      for (Iterator accessIterator = this.accesses.iterator(); accessIterator.hasNext(); ) {
+          Access access = (Access)accessIterator.next();
+          clone.accesses.add((Access)access.clone());
+      }
+      clone.setApplicationServers((ApplicationServers) this.getApplicationServers().clone());
+      for (Iterator softwareIterator = this.softwares.iterator(); softwareIterator.hasNext(); ) {
+          Software software = (Software)softwareIterator.next();
+          clone.softwares.add((Software)software.clone());
+      }
+      for (Iterator logFilesIterator = this.logFiles.iterator(); logFilesIterator.hasNext(); ) {
+          LogFile logFile = (LogFile) logFilesIterator.next();
+          clone.softwares.add((LogFile) logFile.clone());
+      }
+      clone.setNotifiers((Notifiers) this.getNotifiers().clone());
+      for (Iterator publisherIterator = this.publishers.iterator(); publisherIterator.hasNext(); ) {
+          Email publisher = (Email)publisherIterator.next();
+          clone.publishers.add((Email)publisher.clone());
+      }
+      clone.setStatistics((Statistics) this.getStatistics().clone());
+      return clone;
+   }
+
+   /**
+    * Transform the <code>Environment</code> POJO to a DOM element.
+    * 
+    * @param document the DOM document.
+    * @return the DOM element.
+    */
+   protected Element toDOMElement(CoreDocumentImpl document) {
+      ElementImpl element = new ElementImpl(document, "environment");
+      element.setAttribute("name", this.getName());
+      element.setAttribute("group", this.getGroup());
+      element.setAttribute("tag", this.getTag());
+      element.setAttribute("autoupdate", new Boolean(this.getAutoupdate()).toString());
+      element.setAttribute("agent", this.getAgent());
+      element.setAttribute("lock", this.getLock());
+      element.setAttribute("releaseLocation", this.getReleaseLocation());
+      // variables element
+      ElementImpl variables = new ElementImpl(document, "variables");
+      // add variable to variables
+      for (Iterator variableIterator = this.getVariables().iterator(); variableIterator.hasNext();) {
+         Variable variable = (Variable) variableIterator.next();
+         variables.appendChild(variable.toDOMElement(document));
+      }
+      // add variables to environment
+      element.appendChild(variables);
+      // freefields element
+      ElementImpl freefields = new ElementImpl(document, "freefields");
+      // add freefield to freefields
+      for (Iterator freeFieldIterator = this.getFreeFields().iterator(); freeFieldIterator.hasNext();) {
+         FreeField freefield = (FreeField) freeFieldIterator.next();
+         freefields.appendChild(freefield.toDOMElement(document));
+      }
+      // add freefields to environment
+      element.appendChild(freefields);
+      // accesses element
+      ElementImpl accesses = new ElementImpl(document, "accesses");
+      // add access to accesses
+      for (Iterator accessIterator = this.getAccesses().iterator(); accessIterator.hasNext();) {
+         Access access = (Access) accessIterator.next();
+         accesses.appendChild(access.toDOMElement(document));
+      }
+      // add accesses to environment
+      element.appendChild(accesses);
+      // add notes
+      ElementImpl notes = new ElementImpl(document, "notes");
+      CDATASectionImpl notesContent = new CDATASectionImpl(document, this.getNotes());
+      notes.appendChild(notesContent);
+      element.appendChild(notes);
+      // add weblinks
+      ElementImpl weblinks = new ElementImpl(document, "weblinks");
+      CDATASectionImpl weblinksContent = new CDATASectionImpl(document, this.getWeblinks());
+      weblinks.appendChild(weblinksContent);
+      element.appendChild(weblinks);
+      // add J2EE servers
+      element.appendChild(this.getApplicationServers().toDOMElement(document));
+      // softwares element
+      ElementImpl softwares = new ElementImpl(document, "softwares");
+      // add software to softwares
+      for (Iterator softwareIterator = this.getSoftwares().iterator(); softwareIterator.hasNext();) {
+         Software software = (Software) softwareIterator.next();
+         softwares.appendChild(software.toDOMElement(document));
+      }
+      // add softwares to environment
+      element.appendChild(softwares);
+      // logfiles element
+      ElementImpl logfiles = new ElementImpl(document, "logfiles");
+      // add logfile to logfiles
+      for (Iterator logFileIterator = this.getLogFiles().iterator(); logFileIterator.hasNext(); ) {
+          LogFile logFile = (LogFile) logFileIterator.next();
+          logfiles.appendChild(logFile.toDOMElement(document));
+      }
+      // add logfiles to environment
+      element.appendChild(logfiles);
+      // add notifiers to environments
+      element.appendChild(this.getNotifiers().toDOMElement(document));
+      // publishers element
+      ElementImpl publishers = new ElementImpl(document, "publishers");
+      // add email publisher to publishers
+      for(Iterator publisherIterator = this.getPublishers().iterator(); publisherIterator.hasNext();) {
+         Email email = (Email) publisherIterator.next();
+         publishers.appendChild(email.toDOMElement(document));
+      }
+      // add publishers to environment
+      element.appendChild(publishers);
+      // add statistics
+      element.appendChild(this.getStatistics().toDOMElement(document));
+      return element;
+   }
+   
+   /**
+    * @see java.lang.Comparable#compareTo(java.lang.Object)
+    */
+   public int compareTo(Object anotherEnvironment) {
+       return this.getName().compareTo(((Environment)anotherEnvironment).getName());
+   }
+
+}
\ No newline at end of file

Added: incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/FreeField.java
URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/FreeField.java?rev=1187711&view=auto
==============================================================================
--- incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/FreeField.java (added)
+++ incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/FreeField.java Sat Oct 22 13:10:01 2011
@@ -0,0 +1,87 @@
+/*
+ * 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.kalumet.model;
+
+import java.io.Serializable;
+
+import org.apache.xerces.dom.CDATASectionImpl;
+import org.apache.xerces.dom.CoreDocumentImpl;
+import org.apache.xerces.dom.ElementImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Represent the <code>freefield</code> tag in the Kalumet configuration DOM.
+ */
+public class FreeField implements Serializable, Cloneable, Comparable {
+
+   private static final long serialVersionUID = -39120916167747289L;
+
+   private String name;
+   private String content;
+
+   public FreeField() { }
+
+   public String getName() {
+      return this.name;
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   public String getContent() {
+      return this.content;
+   }
+
+   public void setContent(String content) {
+      this.content = content;
+   }
+
+   /**
+    * @see java.lang.Object#clone()
+    */
+   public Object clone() throws CloneNotSupportedException {
+      FreeField clone = new FreeField();
+      clone.setName(this.getName());
+      clone.setContent(this.getContent());
+      return clone;
+   }
+
+   /**
+    * Transform the <code>FreeField</code> POJO to a DOM element.
+    * 
+    * @param document the DOM document.
+    * @return the DOM element.
+    */
+   protected Element toDOMElement(CoreDocumentImpl document) {
+      ElementImpl element = new ElementImpl(document, "freefield");
+      element.setAttribute("name", this.getName());
+      CDATASectionImpl content = new CDATASectionImpl(document, this.getContent());
+      element.appendChild(content);
+      return element;
+   }
+   
+   /**
+    * @see java.lang.Comparable#compareTo(java.lang.Object)
+    */
+   public int compareTo(Object anotherFreeField) {
+       return this.getName().compareTo(((FreeField)anotherFreeField).getName());
+   }
+
+}
\ No newline at end of file

Added: incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Group.java
URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Group.java?rev=1187711&view=auto
==============================================================================
--- incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Group.java (added)
+++ incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/Group.java Sat Oct 22 13:10:01 2011
@@ -0,0 +1,152 @@
+/*
+ * 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.kalumet.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.xerces.dom.CoreDocumentImpl;
+import org.apache.xerces.dom.ElementImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Represent the <code>group</code> tag in the Kalumet configuration DOM.
+ */
+public class Group implements Serializable, Cloneable, Comparable {
+
+   private static final long serialVersionUID = 5188524193501221530L;
+
+   private String id;
+   private String name;
+   private LinkedList users;
+
+   public Group() {
+      this.users = new LinkedList();
+   }
+
+   public String getId() {
+      return this.id;
+   }
+
+   public void setId(String id) {
+      this.id = id;
+   }
+
+   public String getName() {
+      return this.name;
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   /**
+    * Add a new <code>User</code> in the <code>Group</code> container.
+    * 
+    * @param user the <code>User</code> to add.
+    */
+   public void addUser(User user) throws ModelObjectAlreadyExistsException {
+      if (this.getUser(user.getId()) != null) {
+         throw new ModelObjectAlreadyExistsException("User id already exists in group.");
+      }
+      this.users.add(user);
+   }
+
+   /**
+    * Get the <code>User</code> list in the <code>Group</code> container.
+    * 
+    * @return the <code>User</code> list.
+    */
+   public List getUsers() {
+      return this.users;
+   }
+
+   /**
+    * Set the <code>User</code> list in the <code>Group</code>
+    * container.
+    * 
+    * @param users the new <code>User</code> list.
+    */
+   public void setUsers(LinkedList users) {
+      this.users = users;
+   }
+
+   /**
+    * Get a <code>User</code> identified by a given id in the
+    * <code>Group</code> container;
+    * 
+    * @param id the <code>User</code> id.
+    * @return the found <code>User</code> or null if not found.
+    */
+   public User getUser(String id) {
+      for (Iterator userIterator = this.getUsers().iterator(); userIterator.hasNext();) {
+         User user = (User) userIterator.next();
+         if (user.getId().equals(id)) {
+            return user;
+         }
+      }
+      return null;
+   }
+
+   /**
+    * @see java.lang.Object#clone()
+    */
+   public Object clone() throws CloneNotSupportedException {
+      Group clone = new Group();
+      clone.setId(this.getId());
+      clone.setName(this.getName());
+      for (Iterator userIterator = this.users.iterator(); userIterator.hasNext(); ) {
+          User user = (User)userIterator.next();
+          clone.users.add((User)user.clone());
+      }
+      return clone;
+   }
+
+   /**
+    * Transform the <code>Group</code> POJO to a DOM element.
+    * 
+    * @param document the DOM document.
+    * @return the DOM element.
+    */
+   protected Element toDOMElement(CoreDocumentImpl document) {
+      ElementImpl element = new ElementImpl(document, "group");
+      element.setAttribute("id", this.getId());
+      element.setAttribute("name", this.getName());
+      // users element
+      ElementImpl users = new ElementImpl(document, "users");
+      // add user in the users element
+      for (Iterator userIterator = this.getUsers().iterator(); userIterator.hasNext();) {
+         User user = (User) userIterator.next();
+         users.appendChild(user.toDOMElement(document));
+      }
+      // add users to group element
+      element.appendChild(users);
+      return element;
+   }
+   
+   /**
+    * @see java.lang.Comparable#compareTo(java.lang.Object)
+    */
+   public int compareTo(Object anotherGroup) {
+       return this.getId().compareTo(((Group)anotherGroup).getId());
+   }
+
+}
\ No newline at end of file

Added: incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSConnectionFactory.java
URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSConnectionFactory.java?rev=1187711&view=auto
==============================================================================
--- incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSConnectionFactory.java (added)
+++ incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSConnectionFactory.java Sat Oct 22 13:10:01 2011
@@ -0,0 +1,94 @@
+/*
+ * 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.kalumet.model;
+
+import java.io.Serializable;
+
+import org.apache.xerces.dom.CoreDocumentImpl;
+import org.apache.xerces.dom.ElementImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Represent the <code>jmsconnectionfactory</code> tag in the Kalumet configuration DOM.
+ */
+public class JMSConnectionFactory implements Serializable, Cloneable, Comparable {
+
+   private static final long serialVersionUID = 4118489349470578800L;
+
+   private String name;
+   private boolean active;
+   private boolean blocker;
+
+   public String getName() {
+      return this.name;
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   public boolean isActive() {
+      return this.active;
+   }
+
+   public void setActive(boolean active) {
+      this.active = active;
+   }
+
+   public boolean isBlocker() {
+      return this.blocker;
+   }
+
+   public void setBlocker(boolean blocker) {
+      this.blocker = blocker;
+   }
+
+   /**
+    * @see java.lang.Object#clone()
+    */
+   public Object clone() throws CloneNotSupportedException {
+      JMSConnectionFactory clone = new JMSConnectionFactory();
+      clone.setName(this.getName());
+      clone.setActive(this.isActive());
+      clone.setBlocker(this.isBlocker());
+      return clone;
+   }
+
+   /**
+    * Transform the <code>JMSConnectionFactory</code> POJO to a DOM element.
+    * 
+    * @param document the DOM document.
+    * @return the DOM element.
+    */
+   protected Element toDOMElement(CoreDocumentImpl document) {
+      ElementImpl element = new ElementImpl(document, "jmsconnectionfactory");
+      element.setAttribute("name", this.getName());
+      element.setAttribute("active", new Boolean(this.isActive()).toString());
+      element.setAttribute("blocker", new Boolean(this.isBlocker()).toString());
+      return element;
+   }
+   
+   /**
+    * @see java.lang.Comparable#compareTo(java.lang.Object)
+    */
+   public int compareTo(Object anotherJMSConnectionFactory) {
+       return this.getName().compareTo(((JMSConnectionFactory)anotherJMSConnectionFactory).getName());
+   }
+
+}
\ No newline at end of file

Added: incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSQueue.java
URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSQueue.java?rev=1187711&view=auto
==============================================================================
--- incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSQueue.java (added)
+++ incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSQueue.java Sat Oct 22 13:10:01 2011
@@ -0,0 +1,74 @@
+/*
+ * 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.kalumet.model;
+
+import java.io.Serializable;
+
+import org.apache.xerces.dom.CoreDocumentImpl;
+import org.apache.xerces.dom.ElementImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Represent the <code>jmsqueue</code> tag in the Kalumet configuration DOM.
+ */
+public class JMSQueue implements Serializable, Cloneable, Comparable {
+
+   private static final long serialVersionUID = -5239170363052872967L;
+
+   private String name;
+
+   public JMSQueue() { }
+
+   public String getName() {
+      return this.name;
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   /**
+    * @see java.lang.Object#clone()
+    */
+   public Object clone() throws CloneNotSupportedException {
+      JMSQueue clone = new JMSQueue();
+      clone.setName(this.getName());
+      return clone;
+   }
+
+   /**
+    * Transform the <code>JMSQueue</code> POJO to a DOM element.
+    * 
+    * @param document the DOM document.
+    * @return the DOM element.
+    */
+   protected Element toDOMElement(CoreDocumentImpl document) {
+      ElementImpl element = new ElementImpl(document, "jmsqueue");
+      element.setAttribute("name", this.getName());
+      return element;
+   }
+   
+   /**
+    * @see java.lang.Comparable#compareTo(java.lang.Object)
+    */
+   public int compareTo(Object anotherJMSQueue) {
+       return this.getName().compareTo(((JMSQueue)anotherJMSQueue).getName());
+   }
+
+}
\ No newline at end of file

Added: incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSServer.java
URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSServer.java?rev=1187711&view=auto
==============================================================================
--- incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSServer.java (added)
+++ incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSServer.java Sat Oct 22 13:10:01 2011
@@ -0,0 +1,226 @@
+/*
+ * 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.kalumet.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.xerces.dom.CoreDocumentImpl;
+import org.apache.xerces.dom.ElementImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Represent the <code>jmsserver</code> tag in the Kalumet configuration DOM.
+ */
+public class JMSServer implements Serializable, Cloneable, Comparable {
+
+   private static final long serialVersionUID = -6330087943208308843L;
+
+   private String name;
+   private boolean active;
+   private boolean blocker;
+   private LinkedList jmsQueues;
+   private LinkedList jmsTopics;
+
+   public JMSServer() {
+      this.jmsQueues = new LinkedList();
+      this.jmsTopics = new LinkedList();
+   }
+
+   public String getName() {
+      return this.name;
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   public boolean isActive() {
+      return this.active;
+   }
+
+   public void setActive(boolean active) {
+      this.active = active;
+   }
+
+   public boolean isBlocker() {
+      return this.blocker;
+   }
+
+   public void setBlocker(boolean blocker) {
+      this.blocker = blocker;
+   }
+
+   /**
+    * Add a new <code>JMSQueue</code> in the <code>JMSServer</code>
+    * JMS queues container.
+    * 
+    * @param jmsQueue the <code>JMSQueue</code> to add.
+    */
+   public void addJMSQueue(JMSQueue jmsQueue) throws ModelObjectAlreadyExistsException {
+      if (this.getJMSQueue(jmsQueue.getName()) != null) {
+         throw new ModelObjectAlreadyExistsException("JMS queue name already exists in JMS server.");
+      }
+      this.jmsQueues.add(jmsQueue);
+   }
+
+   /**
+    * Get the <code>JMSQueue</code> list in the <code>JMSServer</code>
+    * JMS queues container.
+    * 
+    * @return the <code>JMSQueue</code> list.
+    */
+   public List getJMSQueues() {
+      return this.jmsQueues;
+   }
+
+   /**
+    * Set the <code>JMSQueue</code> list in the <code>JMSServer</code>
+    * JMS queues container.
+    * 
+    * @param jmsQueues the new <code>JMSQueue</code> list.
+    */
+   public void setJMSQueues(LinkedList jmsQueues) {
+      this.jmsQueues = jmsQueues;
+   }
+
+   /**
+    * Get the <code>JMSQueue</code> identified by a given name in the
+    * <code>JMSServer</code> JMS queues container.
+    * 
+    * @param name the <code>JMSQueue</code> name.
+    * @return the <code>JMSQueue</code> found or null if not found.
+    */
+   public JMSQueue getJMSQueue(String name) {
+      for (Iterator jmsQueueIterator = this.getJMSQueues().iterator(); jmsQueueIterator.hasNext();) {
+         JMSQueue jmsQueue = (JMSQueue) jmsQueueIterator.next();
+         if (jmsQueue.getName().equals(name)) {
+            return jmsQueue;
+         }
+      }
+      return null;
+   }
+
+   /**
+    * Add a new <code>JMSTopic</code> in the <code>JMSServer</code>
+    * JMS topics container.
+    * 
+    * @param jmsTopic the <code>JMSTopic</code> to add.
+    */
+   public void addJMSTopic(JMSTopic jmsTopic) throws ModelObjectAlreadyExistsException {
+      if (this.getJMSTopic(jmsTopic.getName()) != null) {
+         throw new ModelObjectAlreadyExistsException("JMS topic name already exists in JMS server.");
+      }
+      this.jmsTopics.add(jmsTopic);
+   }
+
+   /**
+    * Get the <code>JMSTopic</code> list in the <code>JMSServer</code>
+    * JMS topics container.
+    * 
+    * @return the <code>JMSTopic</code> list.
+    */
+   public List getJMSTopics() {
+      return this.jmsTopics;
+   }
+
+   /**
+    * Set the <code>JMSTopic</code> list in the <code>JMSServer</code>
+    * JMS topics container.
+    * 
+    * @param jmsTopics the new <code>JMSTopic</code> list.
+    */
+   public void setJMSTopics(LinkedList jmsTopics) {
+      this.jmsTopics = jmsTopics;
+   }
+
+   /**
+    * Get the <code>JMSTopic</code> identified by a given name in the
+    * <code>JMSServer</code> JMS topics container.
+    * 
+    * @param name the <code>JMSTopic</code> name.
+    * @return the <code>JMSTopic</code> found or null if not found.
+    */
+   public JMSTopic getJMSTopic(String name) {
+      for (Iterator jmsTopicIterator = this.getJMSTopics().iterator(); jmsTopicIterator.hasNext();) {
+         JMSTopic jmsTopic = (JMSTopic) jmsTopicIterator.next();
+         if (jmsTopic.getName().equals(name)) {
+            return jmsTopic;
+         }
+      }
+      return null;
+   }
+
+   /**
+    * @see java.lang.Object#clone()
+    */
+   public Object clone() throws CloneNotSupportedException {
+      JMSServer clone = new JMSServer();
+      clone.setName(this.getName());
+      clone.setActive(this.isActive());
+      clone.setBlocker(this.isBlocker());
+      for (Iterator jmsQueueIterator = this.jmsQueues.iterator(); jmsQueueIterator.hasNext(); ) {
+          JMSQueue jmsQueue = (JMSQueue)jmsQueueIterator.next();
+          clone.jmsQueues.add((JMSQueue)jmsQueue.clone());
+      }
+      for (Iterator jmsTopicIterator = this.jmsTopics.iterator(); jmsTopicIterator.hasNext(); ) {
+          JMSTopic jmsTopic = (JMSTopic)jmsTopicIterator.next();
+          clone.jmsTopics.add((JMSTopic)jmsTopic.clone());
+      }
+      return clone;
+   }
+
+   /**
+    * Transform the <code>JMSServer</code> POJO to a DOM element.
+    * 
+    * @param document the DOM document.
+    * @return the DOM element.
+    */
+   protected Element toDOMElement(CoreDocumentImpl document) {
+      ElementImpl element = new ElementImpl(document, "jmsserver");
+      element.setAttribute("name", this.getName());
+      element.setAttribute("active", new Boolean(this.isActive()).toString());
+      element.setAttribute("blocker", new Boolean(this.isBlocker()).toString());
+      // jmsqueues
+      ElementImpl jmsqueues = new ElementImpl(document, "jmsqueues");
+      for (Iterator jmsQueueIterator = this.getJMSQueues().iterator(); jmsQueueIterator.hasNext();) {
+         JMSQueue jmsQueue = (JMSQueue) jmsQueueIterator.next();
+         jmsqueues.appendChild(jmsQueue.toDOMElement(document));
+      }
+      element.appendChild(jmsqueues);
+      // jmstopics
+      ElementImpl jmstopics = new ElementImpl(document, "jmstopics");
+      for (Iterator jmsTopicIterator = this.getJMSTopics().iterator(); jmsTopicIterator.hasNext();) {
+         JMSTopic jmsTopic = (JMSTopic) jmsTopicIterator.next();
+         jmstopics.appendChild(jmsTopic.toDOMElement(document));
+      }
+      element.appendChild(jmstopics);
+      return element;
+   }
+   
+   /**
+    * @see java.lang.Comparable#compareTo(java.lang.Object)
+    */
+   public int compareTo(Object anotherJMSServer) {
+       return this.getName().compareTo(((JMSServer)anotherJMSServer).getName());
+   }
+
+}
\ No newline at end of file

Added: incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSTopic.java
URL: http://svn.apache.org/viewvc/incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSTopic.java?rev=1187711&view=auto
==============================================================================
--- incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSTopic.java (added)
+++ incubator/kalumet/trunk/common/src/main/java/org/apache/kalumet/model/JMSTopic.java Sat Oct 22 13:10:01 2011
@@ -0,0 +1,74 @@
+/*
+ * 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.kalumet.model;
+
+import java.io.Serializable;
+
+import org.apache.xerces.dom.CoreDocumentImpl;
+import org.apache.xerces.dom.ElementImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Represent the <code>jmstopic</code> tag in the Kalumet configuration DOM.
+ */
+public class JMSTopic implements Serializable, Cloneable, Comparable {
+
+   private static final long serialVersionUID = -1602613331569475624L;
+
+   private String name;
+
+   public JMSTopic() { }
+
+   public String getName() {
+      return this.name;
+   }
+
+   public void setName(String name) {
+      this.name = name;
+   }
+
+   /**
+    * @see java.lang.Object#clone()
+    */
+   public Object clone() throws CloneNotSupportedException {
+      JMSTopic clone = new JMSTopic();
+      clone.setName(this.getName());
+      return clone;
+   }
+
+   /**
+    * Transform the <code>JMSTopic</code> POJO to a DOM element.
+    * 
+    * @param document the DOM document.
+    * @return the DOM element.
+    */
+   protected Element toDOMElement(CoreDocumentImpl document) {
+      ElementImpl element = new ElementImpl(document, "jmstopic");
+      element.setAttribute("name", this.getName());
+      return element;
+   }
+   
+   /**
+    * @see java.lang.Comparable#compareTo(java.lang.Object)
+    */
+   public int compareTo(Object anotherJMSTopic) {
+       return this.getName().compareTo(((JMSTopic)anotherJMSTopic).getName());
+   }
+
+}
\ No newline at end of file



Mime
View raw message