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: Florent BENOIT
023: * --------------------------------------------------------------------------
024: * $Id: AuthenticationMechanism.java 3673 2003-11-11 20:03:28Z ehardesty $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_rar.deployment.xml;
027:
028: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
029: import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
030:
031: /**
032: * This class defines the implementation of the element authentication-mechanism
033: *
034: * @author Florent Benoit
035: */
036:
037: public class AuthenticationMechanism extends AbsElement {
038:
039: /**
040: * description
041: */
042: private JLinkedList descriptionList = null;
043:
044: /**
045: * authentication-mechanism-type
046: */
047: private String authenticationMechanismType = null;
048:
049: /**
050: * credential-interface
051: */
052: private String credentialInterface = null;
053:
054: /**
055: * Constructor
056: */
057: public AuthenticationMechanism() {
058: super ();
059: descriptionList = new JLinkedList("description");
060: }
061:
062: /**
063: * Gets the description
064: * @return the description
065: */
066: public JLinkedList getDescriptionList() {
067: return descriptionList;
068: }
069:
070: /**
071: * Set the description
072: * @param descriptionList description
073: */
074: public void setDescriptionList(JLinkedList descriptionList) {
075: this .descriptionList = descriptionList;
076: }
077:
078: /**
079: * Add a new description element to this object
080: * @param description the description String
081: */
082: public void addDescription(String description) {
083: descriptionList.add(description);
084: }
085:
086: /**
087: * Gets the authentication-mechanism-type
088: * @return the authentication-mechanism-type
089: */
090: public String getAuthenticationMechanismType() {
091: return authenticationMechanismType;
092: }
093:
094: /**
095: * Set the authentication-mechanism-type
096: * @param authenticationMechanismType authenticationMechanismType
097: */
098: public void setAuthenticationMechanismType(
099: String authenticationMechanismType) {
100: this .authenticationMechanismType = authenticationMechanismType;
101: }
102:
103: /**
104: * Gets the credential-interface
105: * @return the credential-interface
106: */
107: public String getCredentialInterface() {
108: return credentialInterface;
109: }
110:
111: /**
112: * Set the credential-interface
113: * @param credentialInterface credentialInterface
114: */
115: public void setCredentialInterface(String credentialInterface) {
116: this .credentialInterface = credentialInterface;
117: }
118:
119: /**
120: * Represents this element by it's XML description.
121: * @param indent use this indent for prefixing XML representation.
122: * @return the XML description of this object.
123: */
124: public String toXML(int indent) {
125: StringBuffer sb = new StringBuffer();
126: sb.append(indent(indent));
127: sb.append("<authentication-mechanism>\n");
128:
129: indent += 2;
130:
131: // description
132: sb.append(descriptionList.toXML(indent));
133: // authentication-mechanism-type
134: sb.append(xmlElement(authenticationMechanismType,
135: "authentication-mechanism-type", indent));
136: // credential-interface
137: sb.append(xmlElement(credentialInterface,
138: "credential-interface", indent));
139: indent -= 2;
140: sb.append(indent(indent));
141: sb.append("</authentication-mechanism>\n");
142:
143: return sb.toString();
144: }
145: }
|