/**
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 .
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and limitations under the License.
 */
package org.jboss.loom.migrators.dataSources.jaxb;

import javax.xml.bind.annotation.*;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

/**
 * JAXB bean for xa-datasource in AS5 (AS5)
 *
 * @author Roman Jakubco
 */

@XmlRootElement(name = "xa-datasource")
@XmlAccessorType(XmlAccessType.NONE)
@XmlType(name = "xa-datasource")
public class XaDatasourceAS5Bean extends AbstractDatasourceAS5Bean {

    @XmlElement(name = "xa-datasource-class")
    private String xaDatasourceClass;

    @XmlElements(@XmlElement(name = "xa-datasource-property", type = XaDatasourcePropertyBean.class))
    private Set<XaDatasourcePropertyBean> xaDatasourceProps;

    @XmlElement(name = "isSameRM-override-value")
    private String isSameRM;

    @XmlElement(name = "interleaving")
    private String interleaving;

    @XmlElement(name = "no-tx-separate-pools")
    private String noTxSeparatePools;

    @XmlElement(name = "xa-resource-timeout")
    private String xaResourceTimeout;


    @XmlElement(name = "transaction-isolation")
    private String transIsolation;



    public String getXaDatasourceClass() {
        return xaDatasourceClass;
    }

    public void setXaDatasourceClass(String xaDatasourceClass) {
        this.xaDatasourceClass = xaDatasourceClass;
    }

    public Collection<XaDatasourcePropertyBean> getXaDatasourceProps() {
        return xaDatasourceProps;
    }

    public void setXaDatasourceProps(Collection<XaDatasourcePropertyBean> xaDatasourceProps) {
        Set<XaDatasourcePropertyBean> temp = new HashSet();
        temp.addAll(xaDatasourceProps);
        this.xaDatasourceProps = temp;
    }


    public String getSameRM() {
        return isSameRM;
    }

    public void setSameRM(String sameRM) {
        isSameRM = sameRM;
    }

    public String getInterleaving() {
        return interleaving;
    }

    public void setInterleaving(String interleaving) {
        this.interleaving = interleaving;
    }

    public String getNoTxSeparatePools() {
        return noTxSeparatePools;
    }

    public void setNoTxSeparatePools(String noTxSeparatePools) {
        this.noTxSeparatePools = noTxSeparatePools;
    }

    public String getXaResourceTimeout() {
        return xaResourceTimeout;
    }

    public void setXaResourceTimeout(String xaResourceTimeout) {
        this.xaResourceTimeout = xaResourceTimeout;
    }

    public String getTransIsolation() {
        return transIsolation;
    }

    public void setTransIsolation(String transIsolation) {
        this.transIsolation = transIsolation;
    }

}

@@ -1661,32 +1661,24 @@
 rceClass() %7B
-%0A       
  return xaDa
@@ -1687,32 +1687,27 @@
 sourceClass;
-%0A   
  %7D%0A
-%0A
     public v
@@ -1754,32 +1754,24 @@
 urceClass) %7B
-%0A       
  this.xaData
@@ -1802,24 +1802,19 @@
 ceClass;
-%0A   
  %7D%0A
-%0A
     publ
@@ -1873,32 +1873,24 @@
 rceProps() %7B
-%0A       
  return xaDa
@@ -1903,24 +1903,19 @@
 ceProps;
-%0A   
  %7D%0A
-%0A
     publ
@@ -2146,18 +2146,16 @@
 ;%0A    %7D%0A
-%0A%0A
     publ
@@ -2173,32 +2173,24 @@
 etSameRM() %7B
-%0A       
  return isSa
@@ -2190,32 +2190,27 @@
 rn isSameRM;
-%0A   
  %7D%0A
-%0A
     public v
@@ -2239,24 +2239,16 @@
 ameRM) %7B
-%0A       
  isSameR
@@ -2258,24 +2258,19 @@
  sameRM;
-%0A   
  %7D%0A
-%0A
     publ
@@ -2294,32 +2294,24 @@
 rleaving() %7B
-%0A       
  return inte
@@ -2315,32 +2315,27 @@
 nterleaving;
-%0A   
  %7D%0A
-%0A
     public v
@@ -2376,24 +2376,16 @@
 aving) %7B
-%0A       
  this.in
@@ -2410,24 +2410,19 @@
 leaving;
-%0A   
  %7D%0A
-%0A
     publ
@@ -2451,32 +2451,24 @@
 atePools() %7B
-%0A       
  return noTx
@@ -2477,32 +2477,27 @@
 paratePools;
-%0A   
  %7D%0A
-%0A
     public v
@@ -2548,24 +2548,16 @@
 Pools) %7B
-%0A       
  this.no
@@ -2592,24 +2592,19 @@
 tePools;
-%0A   
  %7D%0A
-%0A
     publ
@@ -2633,32 +2633,24 @@
 eTimeout() %7B
-%0A       
  return xaRe
@@ -2659,32 +2659,27 @@
 urceTimeout;
-%0A   
  %7D%0A
-%0A
     public v
@@ -2730,24 +2730,16 @@
 meout) %7B
-%0A       
  this.xa
@@ -2774,23 +2774,23 @@
 Timeout;
+ %7D
 %0A    
-%7D%0A
 %0A    pub
@@ -2821,24 +2821,16 @@
 tion() %7B
-%0A       
  return 
@@ -2844,24 +2844,19 @@
 olation;
-%0A   
  %7D%0A
-%0A
     publ
@@ -2905,24 +2905,16 @@
 ation) %7B
-%0A       
  this.tr
@@ -2947,14 +2947,18 @@
 ion;
-%0A   
  %7D%0A%0A%7D
+// class
 %0A

Refactor DatasourceMigrator to be less insane - Format