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: *
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: * Initial developer: JOnAS team
023: * --------------------------------------------------------------------------
024: * $Id: AsContextMapping.java 5876 2004-12-08 14:05:09Z benoitf $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_ejb.deployment.xml;
027:
028: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
029:
030: /**
031: * This class defines the implementation of the element as-context
032: *
033: * @author JOnAS team
034: */
035:
036: public class AsContextMapping extends AbsElement {
037:
038: /**
039: * auth-method
040: */
041: private String authMethod = null;
042:
043: /**
044: * realm
045: */
046: private String realm = null;
047:
048: /**
049: * required
050: */
051: private String required = null;
052:
053: /**
054: * @return Returns the authMethod.
055: */
056: public String getAuthMethod() {
057: return authMethod;
058: }
059:
060: /**
061: * @param authMethod The authMethod to set.
062: */
063: public void setAuthMethod(String authMethod) {
064: this .authMethod = authMethod;
065: }
066:
067: /**
068: * @return Returns the realm.
069: */
070: public String getRealm() {
071: return realm;
072: }
073:
074: /**
075: * @param realm The realm to set.
076: */
077: public void setRealm(String realm) {
078: this .realm = realm;
079: }
080:
081: /**
082: * @return Returns the required.
083: */
084: public String getRequired() {
085: return required;
086: }
087:
088: /**
089: * @param required The required to set.
090: */
091: public void setRequired(String required) {
092: this .required = required;
093: }
094:
095: /**
096: * Constructor
097: */
098: public AsContextMapping() {
099: super ();
100: }
101:
102: /**
103: * Represents this element by it's XML description.
104: * @param indent use this indent for prexifing XML representation.
105: * @return the XML description of this object.
106: */
107: public String toXML(int indent) {
108: StringBuffer sb = new StringBuffer();
109: sb.append(indent(indent));
110: sb.append("<as-context>\n");
111:
112: indent += 2;
113:
114: // auth-method
115: sb.append(xmlElement(authMethod, "auth-method", indent));
116: // realm
117: sb.append(xmlElement(realm, "realm", indent));
118: // required
119: sb.append(xmlElement(required, "required", indent));
120: indent -= 2;
121: sb.append(indent(indent));
122: sb.append("</as-context>\n");
123:
124: return sb.toString();
125: }
126: }
|