KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > ws7 > serverresources > beans > WS70MailResourceBean


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 /*
21  * WS70MailResourceBean.java
22  */

23
24 package org.netbeans.modules.j2ee.sun.ws7.serverresources.beans;
25
26 import org.netbeans.modules.j2ee.sun.ws7.serverresources.dd.WS70MailResource;
27 import org.netbeans.modules.j2ee.sun.ws7.serverresources.dd.WS70Resources;
28 import org.netbeans.modules.j2ee.sun.ws7.serverresources.dd.PropertyElement;
29 /**
30  *
31  * @author Administrator
32  */

33 public class WS70MailResourceBean extends WS70BaseResourceBean implements java.io.Serializable JavaDoc{
34
35     private String JavaDoc storeProt;
36     private String JavaDoc storeProtClass;
37     private String JavaDoc transProt;
38     private String JavaDoc transProtClass;
39     private String JavaDoc hostName;
40     private String JavaDoc userName;
41     private String JavaDoc fromAddr;
42     
43     /** Creates a new instance of WS70MailResourceBean */
44     public WS70MailResourceBean() {
45     }
46     public String JavaDoc getStoreProt() {
47         return storeProt;
48     }
49     public void setStoreProt(String JavaDoc value) {
50         String JavaDoc oldValue = storeProt;
51         this.storeProt = value;
52         initPropertyChangeSupport();
53         propertySupport.firePropertyChange ("storeProt", oldValue, storeProt);//NOI18N
54
}
55     
56     public String JavaDoc getStoreProtClass() {
57         return storeProtClass;
58     }
59     public void setStoreProtClass(String JavaDoc value) {
60         String JavaDoc oldValue = storeProtClass;
61         this.storeProtClass = value;
62         initPropertyChangeSupport();
63         propertySupport.firePropertyChange ("storeProtClass", oldValue, storeProtClass);//NOI18N
64
}
65     
66     public String JavaDoc getTransProt() {
67         return transProt;
68     }
69     public void setTransProt(String JavaDoc value) {
70         String JavaDoc oldValue = transProt;
71         this.transProt = value;
72         initPropertyChangeSupport();
73         propertySupport.firePropertyChange ("transProt", oldValue, transProt);//NOI18N
74
}
75     
76     public String JavaDoc getTransProtClass() {
77         return transProtClass;
78     }
79     public void setTransProtClass(String JavaDoc value) {
80         String JavaDoc oldValue = transProtClass;
81         this.transProtClass = value;
82         initPropertyChangeSupport();
83         propertySupport.firePropertyChange ("transProtClass", oldValue, transProtClass);//NOI18N
84
}
85     
86     public String JavaDoc getHostName() {
87         return hostName;
88     }
89     public void setHostName(String JavaDoc value) {
90         String JavaDoc oldValue = hostName;
91         this.hostName = value;
92         initPropertyChangeSupport();
93         propertySupport.firePropertyChange ("hostName", oldValue, hostName);//NOI18N
94
}
95     
96     public String JavaDoc getUserName() {
97         return userName;
98     }
99     public void setUserName(String JavaDoc value) {
100         String JavaDoc oldValue = userName;
101         this.userName = value;
102         initPropertyChangeSupport();
103         propertySupport.firePropertyChange ("userName", oldValue, userName);//NOI18N
104
}
105     public String JavaDoc getFromAddr() {
106         return fromAddr;
107     }
108     public void setFromAddr(String JavaDoc value) {
109         String JavaDoc oldValue = fromAddr;
110         this.fromAddr = value;
111         initPropertyChangeSupport();
112         propertySupport.firePropertyChange ("fromAddr", oldValue, fromAddr);//NOI18N
113
}
114     
115     public static WS70MailResourceBean createBean(WS70MailResource mailresource) {
116         WS70MailResourceBean bean = new WS70MailResourceBean();
117         //name attribute in bean is for studio display purpose.
118
//It is not part of the mail-resource dtd.
119
bean.setName(mailresource.getJndiName());
120         bean.setDescription(mailresource.getDescription());
121         bean.setJndiName(mailresource.getJndiName());
122         bean.setStoreProt(mailresource.getStoreProtocol());
123         bean.setStoreProtClass(mailresource.getStoreProtocolClass());
124         bean.setTransProt(mailresource.getTransportProtocol());
125         bean.setTransProtClass(mailresource.getTransportProtocolClass());
126         bean.setHostName(mailresource.getHost());
127         bean.setUserName(mailresource.getUser());
128         bean.setFromAddr(mailresource.getFrom());
129         
130         bean.setIsEnabled(mailresource.getEnabled());
131         return bean;
132     }
133     
134     public WS70Resources getGraph(){
135         WS70Resources res = getResourceGraph();
136         WS70MailResource mlresource = res.newWS70MailResource();
137         mlresource.setDescription(getDescription());
138         mlresource.setJndiName(getJndiName());
139         mlresource.setStoreProtocol(getStoreProt());
140         mlresource.setStoreProtocolClass(getStoreProtClass());
141         mlresource.setTransportProtocol(getTransProt());
142         mlresource.setTransportProtocolClass(getTransProtClass());
143         mlresource.setHost(getHostName());
144         mlresource.setUser(getUserName());
145         mlresource.setFrom(getFromAddr());
146         mlresource.setEnabled(getIsEnabled());
147         
148         res.addWS70MailResource(mlresource);
149         return res;
150     }
151 }
152
Popular Tags