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 35 40 41 public class JonasConnector extends AbsElement implements TopLevelElement { 42 43 46 private String jndiName = null; 47 48 51 private String rarlink = null; 52 53 56 private String nativeLib = null; 57 58 61 private String logEnabled = null; 62 63 66 private String logTopic = null; 67 68 71 private PoolParams poolParams = null; 72 73 76 private JdbcConnParams jdbcConnParams = null; 77 78 81 private TmParams tmParams = null; 82 83 86 private JLinkedList jonasConfigPropertyList = null; 87 88 91 private JLinkedList jonasConnectionDefinitionList = null; 92 93 96 private JLinkedList jonasActivationspecList = null; 97 98 101 private JLinkedList jonasAdminobjectList = null; 102 103 106 private JonasSecurityMapping jonasSecurityMapping = null; 107 108 public static String JONAS_RA_ROOT_ELEMENT = "<jonas-connector xmlns=\"http://www.objectweb.org/jonas/ns\" \n " 109 + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n " 110 + "xsi:schemaLocation=\"http://www.objectweb.org/jonas/ns \n " 111 + "http://www.objectweb.org/jonas/ns/jonas-connector_4_4.xsd\" >"; 112 113 114 115 118 public JonasConnector() { 119 super(); 120 jonasConfigPropertyList = new JLinkedList("jonas-config-property"); 121 jonasConnectionDefinitionList = new JLinkedList("jonas-connection-definition"); 122 jonasActivationspecList = new JLinkedList("jonas-activationspec"); 123 jonasAdminobjectList = new JLinkedList("jonas-adminobject"); 124 } 125 126 130 public String getJndiName() { 131 return jndiName; 132 } 133 134 138 public void setJndiName(String jndiName) { 139 this.jndiName = jndiName; 140 } 141 142 146 public String getRarlink() { 147 return rarlink; 148 } 149 150 154 public void setRarlink(String rarlink) { 155 this.rarlink = rarlink; 156 } 157 158 162 public String getNativeLib() { 163 return nativeLib; 164 } 165 166 170 public void setNativeLib(String nativeLib) { 171 this.nativeLib = nativeLib; 172 } 173 174 178 public String getLogEnabled() { 179 return logEnabled; 180 } 181 182 186 public void setLogEnabled(String logEnabled) { 187 this.logEnabled = logEnabled; 188 } 189 190 194 public String getLogTopic() { 195 return logTopic; 196 } 197 198 202 public void setLogTopic(String logTopic) { 203 this.logTopic = logTopic; 204 } 205 206 210 public PoolParams getPoolParams() { 211 return poolParams; 212 } 213 214 218 public void setPoolParams(PoolParams poolParams) { 219 this.poolParams = poolParams; 220 } 221 222 226 public JdbcConnParams getJdbcConnParams() { 227 return jdbcConnParams; 228 } 229 230 234 public void setJdbcConnParams(JdbcConnParams jdbcConnParams) { 235 this.jdbcConnParams = jdbcConnParams; 236 } 237 238 242 public JLinkedList getJonasConfigPropertyList() { 243 return jonasConfigPropertyList; 244 } 245 246 250 public void setJonasConfigPropertyList(JLinkedList jonasConfigPropertyList) { 251 this.jonasConfigPropertyList = jonasConfigPropertyList; 252 } 253 254 258 public void addJonasConfigProperty(JonasConfigProperty jonasConfigProperty) { 259 jonasConfigPropertyList.add(jonasConfigProperty); 260 } 261 262 266 public JLinkedList getJonasConnectionDefinitionList() { 267 return jonasConnectionDefinitionList; 268 } 269 270 274 public void setJonasConnectionDefinitionList(JLinkedList jonasConnectionDefinitionList) { 275 this.jonasConnectionDefinitionList = jonasConnectionDefinitionList; 276 } 277 278 282 public void addJonasConnectionDefinition(JonasConnectionDefinition jonasConnectionDefinition) { 283 jonasConnectionDefinitionList.add(jonasConnectionDefinition); 284 } 285 286 290 public JLinkedList getJonasActivationspecList() { 291 return jonasActivationspecList; 292 } 293 294 298 public void setJonasActivationspecList(JLinkedList jonasActivationspecList) { 299 this.jonasActivationspecList = jonasActivationspecList; 300 } 301 302 306 public void addJonasActivationspec(JonasActivationspec jonasActivationspec) { 307 jonasActivationspecList.add(jonasActivationspec); 308 } 309 310 314 public JLinkedList getJonasAdminobjectList() { 315 return jonasAdminobjectList; 316 } 317 318 322 public void setJonasAdminobjectList(JLinkedList jonasAdminobjectList) { 323 this.jonasAdminobjectList = jonasAdminobjectList; 324 } 325 326 330 public void addJonasAdminobject(JonasAdminobject jonasAdminobject) { 331 jonasAdminobjectList.add(jonasAdminobject); 332 } 333 334 338 public JonasSecurityMapping getJonasSecurityMapping() { 339 return jonasSecurityMapping; 340 } 341 342 346 public void setJonasSecurityMapping(JonasSecurityMapping jonasSecurityMapping) { 347 this.jonasSecurityMapping = jonasSecurityMapping; 348 } 349 350 354 public TmParams getTmParams() { 355 return tmParams; 356 } 357 358 362 public void setTmParams(TmParams tmParams) { 363 this.tmParams = tmParams; 364 } 365 366 371 public String toXML(int indent) { 372 StringBuffer sb = new StringBuffer (); 373 sb.append(indent(indent)); 374 sb.append(JONAS_RA_ROOT_ELEMENT+"\n"); 375 376 indent += 2; 377 378 sb.append(xmlElement(jndiName, "jndi-name", indent)); 380 sb.append(xmlElement(rarlink, "rarlink", indent)); 382 sb.append(xmlElement(nativeLib, "native-lib", indent)); 384 sb.append(xmlElement(logEnabled, "log-enabled", indent)); 386 sb.append(xmlElement(logTopic, "log-topic", indent)); 388 if (poolParams != null) { 390 sb.append(poolParams.toXML(indent)); 391 } 392 if (jdbcConnParams != null) { 394 sb.append(jdbcConnParams.toXML(indent)); 395 } 396 if (tmParams != null) { 398 sb.append(tmParams.toXML(indent)); 399 } 400 if (jonasConfigPropertyList != null) { 402 sb.append(jonasConfigPropertyList.toXML(indent)); 403 } 404 if (jonasConnectionDefinitionList != null) { 406 sb.append(jonasConnectionDefinitionList.toXML(indent)); 407 } 408 if (jonasActivationspecList != null) { 410 sb.append(jonasActivationspecList.toXML(indent)); 411 } 412 if (jonasAdminobjectList != null) { 414 sb.append(jonasAdminobjectList.toXML(indent)); 415 } 416 if (jonasSecurityMapping != null) { 418 sb.append(jonasSecurityMapping.toXML(indent)); 419 } 420 indent -= 2; 421 sb.append(indent(indent)); 422 sb.append("</jonas-connector>\n"); 423 424 return sb.toString(); 425 } 426 } 427 | Popular Tags |