1 19 20 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 33 public class WS70MailResourceBean extends WS70BaseResourceBean implements java.io.Serializable { 34 35 private String storeProt; 36 private String storeProtClass; 37 private String transProt; 38 private String transProtClass; 39 private String hostName; 40 private String userName; 41 private String fromAddr; 42 43 44 public WS70MailResourceBean() { 45 } 46 public String getStoreProt() { 47 return storeProt; 48 } 49 public void setStoreProt(String value) { 50 String oldValue = storeProt; 51 this.storeProt = value; 52 initPropertyChangeSupport(); 53 propertySupport.firePropertyChange ("storeProt", oldValue, storeProt); } 55 56 public String getStoreProtClass() { 57 return storeProtClass; 58 } 59 public void setStoreProtClass(String value) { 60 String oldValue = storeProtClass; 61 this.storeProtClass = value; 62 initPropertyChangeSupport(); 63 propertySupport.firePropertyChange ("storeProtClass", oldValue, storeProtClass); } 65 66 public String getTransProt() { 67 return transProt; 68 } 69 public void setTransProt(String value) { 70 String oldValue = transProt; 71 this.transProt = value; 72 initPropertyChangeSupport(); 73 propertySupport.firePropertyChange ("transProt", oldValue, transProt); } 75 76 public String getTransProtClass() { 77 return transProtClass; 78 } 79 public void setTransProtClass(String value) { 80 String oldValue = transProtClass; 81 this.transProtClass = value; 82 initPropertyChangeSupport(); 83 propertySupport.firePropertyChange ("transProtClass", oldValue, transProtClass); } 85 86 public String getHostName() { 87 return hostName; 88 } 89 public void setHostName(String value) { 90 String oldValue = hostName; 91 this.hostName = value; 92 initPropertyChangeSupport(); 93 propertySupport.firePropertyChange ("hostName", oldValue, hostName); } 95 96 public String getUserName() { 97 return userName; 98 } 99 public void setUserName(String value) { 100 String oldValue = userName; 101 this.userName = value; 102 initPropertyChangeSupport(); 103 propertySupport.firePropertyChange ("userName", oldValue, userName); } 105 public String getFromAddr() { 106 return fromAddr; 107 } 108 public void setFromAddr(String value) { 109 String oldValue = fromAddr; 110 this.fromAddr = value; 111 initPropertyChangeSupport(); 112 propertySupport.firePropertyChange ("fromAddr", oldValue, fromAddr); } 114 115 public static WS70MailResourceBean createBean(WS70MailResource mailresource) { 116 WS70MailResourceBean bean = new WS70MailResourceBean(); 117 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 |