1 27 package org.objectweb.jonas_rar.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.AbsElement; 30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList; 31 import org.objectweb.jonas_lib.deployment.xml.TopLevelElement; 32 33 38 39 public class JonasConnectionDefinition extends AbsElement implements TopLevelElement { 40 41 44 private String id = null; 45 46 49 private JLinkedList descriptionList = null; 50 51 54 private String jndiName = null; 55 56 59 private String logEnabled = null; 60 61 64 private String logTopic = null; 65 66 69 private PoolParams poolParams = null; 70 71 74 private JdbcConnParams jdbcConnParams = null; 75 76 79 private JLinkedList jonasConfigPropertyList = null; 80 81 82 85 public JonasConnectionDefinition() { 86 super(); 87 descriptionList = new JLinkedList("description"); 88 jonasConfigPropertyList = new JLinkedList("jonas-config-property"); 89 } 90 91 95 public String getId() { 96 return id; 97 } 98 99 103 public void setId(String id) { 104 this.id = id; 105 } 106 107 111 public JLinkedList getDescriptionList() { 112 return descriptionList; 113 } 114 115 119 public void setDescriptionList(JLinkedList descriptionList) { 120 this.descriptionList = descriptionList; 121 } 122 123 127 public void addDescription(String description) { 128 descriptionList.add(description); 129 } 130 131 135 public String getJndiName() { 136 return jndiName; 137 } 138 139 143 public void setJndiName(String jndiName) { 144 this.jndiName = jndiName; 145 } 146 147 151 public String getLogEnabled() { 152 return logEnabled; 153 } 154 155 159 public void setLogEnabled(String logEnabled) { 160 this.logEnabled = logEnabled; 161 } 162 163 167 public String getLogTopic() { 168 return logTopic; 169 } 170 171 175 public void setLogTopic(String logTopic) { 176 this.logTopic = logTopic; 177 } 178 179 183 public PoolParams getPoolParams() { 184 return poolParams; 185 } 186 187 191 public void setPoolParams(PoolParams poolParams) { 192 this.poolParams = poolParams; 193 } 194 195 199 public JdbcConnParams getJdbcConnParams() { 200 return jdbcConnParams; 201 } 202 203 207 public void setJdbcConnParams(JdbcConnParams jdbcConnParams) { 208 this.jdbcConnParams = jdbcConnParams; 209 } 210 211 215 public JLinkedList getJonasConfigPropertyList() { 216 return jonasConfigPropertyList; 217 } 218 219 223 public void setJonasConfigPropertyList(JLinkedList jonasConfigPropertyList) { 224 this.jonasConfigPropertyList = jonasConfigPropertyList; 225 } 226 227 231 public void addJonasConfigProperty(JonasConfigProperty jonasConfigProperty) { 232 jonasConfigPropertyList.add(jonasConfigProperty); 233 } 234 235 240 public String toXML(int indent) { 241 StringBuffer sb = new StringBuffer (); 242 sb.append(indent(indent)); 243 sb.append("<jonas-connection-definition>\n"); 244 245 indent += 2; 246 247 sb.append(xmlElement(id, "id", indent)); 249 sb.append(descriptionList.toXML(indent)); 251 sb.append(xmlElement(jndiName, "jndi-name", indent)); 253 sb.append(xmlElement(logEnabled, "log-enabled", indent)); 255 sb.append(xmlElement(logTopic, "log-topic", indent)); 257 if (poolParams != null) { 259 sb.append(poolParams.toXML(indent)); 260 } 261 if (jdbcConnParams != null) { 263 sb.append(jdbcConnParams.toXML(indent)); 264 } 265 if (jonasConfigPropertyList != null) { 267 sb.append(jonasConfigPropertyList.toXML(indent)); 268 } 269 indent -= 2; 270 sb.append(indent(indent)); 271 sb.append("</jonas-connection-definition>\n"); 272 273 return sb.toString(); 274 } 275 } 276 | Popular Tags |