KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_rar > deployment > api > ConnectorDesc


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or 1any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: Eric Hardesty
23  * --------------------------------------------------------------------------
24  * $Id: ConnectorDesc.java,v 1.1 2004/09/17 22:33:32 ehardesty Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_rar.deployment.api;
28
29 import java.io.Serializable JavaDoc;
30 import java.util.List JavaDoc;
31
32 import org.objectweb.jonas_rar.deployment.xml.Connector;
33 import org.objectweb.jonas_rar.deployment.xml.Resourceadapter;
34
35 /**
36  * This class defines the implementation of the element connector
37  *
38  * @author Eric Hardesty
39  */

40
41 public class ConnectorDesc implements Serializable JavaDoc {
42
43     /**
44      * display-name
45      */

46     private String JavaDoc displayName = null;
47
48     /**
49      * description
50      */

51     private List JavaDoc descriptionList = null;
52
53     /**
54      * icon
55      */

56     private IconDesc icon = null;
57
58     /**
59      * vendor-name
60      */

61     private String JavaDoc vendorName = null;
62
63     /**
64      * spec-version
65      */

66     private String JavaDoc specVersion = null;
67
68     /**
69      * eis-type
70      */

71     private String JavaDoc eisType = null;
72
73     /**
74      * version
75      */

76     private String JavaDoc version = null;
77
78     /**
79      * resourceadapter-version
80      */

81     private String JavaDoc resourceadapterVersion = null;
82
83     /**
84      * license
85      */

86     private LicenseDesc license = null;
87
88     /**
89      * resourceadapter
90      */

91     private Resourceadapter resourceadapter = null; //Used by RAConfig
92
private ResourceadapterDesc resourceadapterDesc = null;
93
94
95     /**
96      * Constructor
97      */

98     public ConnectorDesc(Connector conn) {
99         if (conn != null) {
100             displayName = conn.getDisplayName();
101             icon = new IconDesc(conn.getIcon());
102             vendorName = conn.getVendorName();
103             specVersion = conn.getSpecVersion();
104             eisType = conn.getEisType();
105             version = conn.getVersion();
106             resourceadapterVersion = conn.getResourceadapterVersion();
107             descriptionList = conn.getDescriptionList();
108             license = new LicenseDesc(conn.getLicense());
109             resourceadapter = conn.getResourceadapter();
110             resourceadapterDesc = new ResourceadapterDesc(conn.getResourceadapter());
111         }
112     }
113
114     /**
115      * Gets the display-name
116      * @return the display-name
117      */

118     public String JavaDoc getDisplayName() {
119         return displayName;
120     }
121
122     /**
123      * Gets the description
124      * @return the description
125      */

126     public List JavaDoc getDescriptionList() {
127         return descriptionList;
128     }
129
130     /**
131      * Gets the icon
132      * @return the icon
133      */

134     public IconDesc getIcon() {
135         return icon;
136     }
137
138     /**
139      * Gets the vendor-name
140      * @return the vendor-name
141      */

142     public String JavaDoc getVendorName() {
143         return vendorName;
144     }
145
146     /**
147      * Gets the spec-version
148      * @return the spec-version
149      */

150     public String JavaDoc getSpecVersion() {
151         return specVersion;
152     }
153
154     /**
155      * Gets the eis-type
156      * @return the eis-type
157      */

158     public String JavaDoc getEisType() {
159         return eisType;
160     }
161
162     /**
163      * Gets the version
164      * @return the version
165      */

166     public String JavaDoc getVersion() {
167         return version;
168     }
169
170     /**
171      * Gets the resourceadapter-version
172      * @return the resourceadapter-version
173      */

174     public String JavaDoc getResourceadapterVersion() {
175         return resourceadapterVersion;
176     }
177
178     /**
179      * Gets the license
180      * @return the license
181      */

182     public LicenseDesc getLicense() {
183         return license;
184     }
185
186     /**
187      * Gets the resourceadapter
188      * @return the resourceadapter
189      */

190     public Resourceadapter getResourceadapter() {
191         return resourceadapter;
192     }
193
194     /**
195      * Gets the resourceadapter
196      * @return the resourceadapter
197      */

198     public ResourceadapterDesc getResourceadapterDesc() {
199         return resourceadapterDesc;
200     }
201     
202     public String JavaDoc toString() {
203         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
204         sb.append("<connector>\n");
205         sb.append(" specVersion="+specVersion+"\n");
206
207         // resourceadapter
208
if (resourceadapter != null) {
209             sb.append(""+resourceadapter+"\n");
210         } else {
211             sb.append(" ra=null\n");
212         }
213
214         sb.append("</connector>\n");
215
216         return sb.toString();
217     }
218
219 }
220
Popular Tags