001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: *
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or 1any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
020: * USA
021: *
022: * --------------------------------------------------------------------------
023: * $Id: $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas_domain.xml;
026:
027: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
028:
029: /**
030: * Cluster Daemon configuration element
031: * @author pelletib
032: *
033: */
034: public class ClusterDaemon extends AbsElement {
035:
036: /**
037: * Version UID
038: */
039: private static final long serialVersionUID = 1322641391857423458L;
040:
041: /**
042: * Instance name
043: */
044: private String name = null;
045:
046: /**
047: * description
048: */
049: private String description = null;
050:
051: /**
052: * URL
053: */
054: private Location location = null;
055:
056: // TO DO
057: // Add state element
058:
059: /**
060: * Constructor
061: */
062: public ClusterDaemon() {
063: super ();
064: }
065:
066: /**
067: * @return Returns the location.
068: */
069: public Location getLocation() {
070: return location;
071: }
072:
073: /**
074: * @param location The location to set.
075: */
076: public void setLocation(Location location) {
077: this .location = location;
078: }
079:
080: /**
081: * @param location The location to set.
082: */
083: public void addLocation(Location location) {
084: this .location = location;
085: }
086:
087: /**
088: * @return Returns the name.
089: */
090: public String getName() {
091: return name;
092: }
093:
094: /**
095: * @param name The name to set.
096: */
097: public void setName(String name) {
098: this .name = name;
099: }
100:
101: /**
102: * @return Returns the description.
103: */
104: public String getDescription() {
105: return description;
106: }
107:
108: /**
109: * @param description The description to set.
110: */
111: public void setDescription(String description) {
112: this .description = description;
113: }
114:
115: /**
116: * Represents this element by it's XML description.
117: * @param indent use this indent for prexifing XML representation.
118: * @return the XML description of this object.
119: */
120: public String toXML(int indent) {
121: StringBuffer sb = new StringBuffer();
122: sb.append(indent(indent));
123: sb.append("<cluster-daemon>\n");
124:
125: indent += 2;
126:
127: // name
128: if (name != null) {
129: sb.append(xmlElement(name, "name", indent));
130: }
131: // description
132: if (getDescription() != null) {
133: sb.append(xmlElement(getDescription(), "description",
134: indent));
135: }
136: // location
137: if (location != null) {
138: sb.append(location.toXML(indent));
139: }
140:
141: indent -= 2;
142: sb.append(indent(indent));
143: sb.append("</cluster-daemon>\n");
144:
145: return sb.toString();
146: }
147: }
|