001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or 1any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * Initial developer: Florent BENOIT
022: * --------------------------------------------------------------------------
023: * $Id: ResourceRef.java 4718 2004-05-10 12:06:09Z sauthieg $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas_lib.deployment.xml;
026:
027: /**
028: * This class defines the implementation of the element resource-ref.
029: * @author Florent Benoit
030: */
031: public class ResourceRef extends AbsElement {
032:
033: /**
034: * Description of the resource-ref
035: */
036: private String description = null;
037:
038: /**
039: * Name of this resource-ref
040: */
041: private String resRefName = null;
042:
043: /**
044: * Type of this resource-ref
045: */
046: private String resType = null;
047:
048: /**
049: * Auth of this resource-ref
050: */
051: private String resAuth = null;
052:
053: /**
054: * Sharing-scope of this resource-ref
055: */
056: private String resSharingScope = null;
057:
058: // Setters
059:
060: /**
061: * Sets the description
062: * @param description the description to use
063: */
064: public void setDescription(String description) {
065: this .description = description;
066: }
067:
068: /**
069: * Sets the name
070: * @param resRefName the name to use
071: */
072: public void setResRefName(String resRefName) {
073: this .resRefName = resRefName;
074: }
075:
076: /**
077: * Sets the type
078: * @param resType the type to use
079: */
080: public void setResType(String resType) {
081: this .resType = resType;
082: }
083:
084: /**
085: * Sets the auth
086: * @param resAuth the auth to use
087: */
088: public void setResAuth(String resAuth) {
089: this .resAuth = resAuth;
090: }
091:
092: /**
093: * Sets the sharing-scope
094: * @param resSharingScope the sharing-scope to use
095: */
096: public void setResSharingScope(String resSharingScope) {
097: this .resSharingScope = resSharingScope;
098: }
099:
100: // Getters
101:
102: /**
103: * @return the description of the resource-ref
104: */
105: public String getDescription() {
106: return description;
107: }
108:
109: /**
110: * @return the name of the resource-ref
111: */
112: public String getResRefName() {
113: return resRefName;
114: }
115:
116: /**
117: * @return the type of the resource-ref
118: */
119: public String getResType() {
120: return resType;
121: }
122:
123: /**
124: * @return the auth of the resource-ref
125: */
126: public String getResAuth() {
127: return resAuth;
128: }
129:
130: /**
131: * @return the sharing-scope of the resource-ref
132: */
133: public String getResSharingScope() {
134: return resSharingScope;
135: }
136:
137: /**
138: * Represents this element by it's XML description.
139: * @param indent use this indent for prexifing XML representation.
140: * @return the XML description of this object.
141: */
142: public String toXML(int indent) {
143: StringBuffer sb = new StringBuffer();
144: sb.append(indent(indent));
145: sb.append("<resource-ref>\n");
146:
147: indent += 2;
148:
149: // Description
150: sb.append(xmlElement(description, "description", indent));
151:
152: // name
153: sb.append(xmlElement(resRefName, "res-ref-name", indent));
154:
155: // type
156: sb.append(xmlElement(resType, "res-type", indent));
157:
158: // auth
159: sb.append(xmlElement(resAuth, "res-auth", indent));
160:
161: // sharing-scope
162: sb.append(xmlElement(resSharingScope, "res-sharing-scope",
163: indent));
164:
165: indent -= 2;
166: sb.append(indent(indent));
167: sb.append("</resource-ref>\n");
168:
169: return sb.toString();
170: }
171:
172: }
|