<?xml version="1.0" encoding="UTF-8"?>
<!--
 -
 - Licensed to the Apache Software Foundation (ASF) under one
 - or more contributor license agreements.  See the NOTICE file
 - distributed with this work for additional information
 - regarding copyright ownership.  The ASF licenses this file
 - to you 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.
 -
 -->

<connector xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
           http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
           version="1.5">

  <description>QPID Resource Adapter</description>
  <display-name>QPID Resource Adapter</display-name>

  <vendor-name>Apache Software Foundation</vendor-name>
  <eis-type>JMS 1.1 Server</eis-type>
  <resourceadapter-version>1.0</resourceadapter-version>

  <license>
    <description>
      The ASF licenses this file to you 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.
    </description>
    <license-required>true</license-required>
  </license>

  <resourceadapter>
    <resourceadapter-class>org.apache.qpid.ra.QpidResourceAdapter</resourceadapter-class>
    <config-property>
      <description>Client ID for the connection</description>
      <config-property-name>ClientId</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>client_id</config-property-value>
    </config-property>

    <config-property>
      <description>Number of setup attempts before failing</description>
      <config-property-name>SetupAttempts</config-property-name>
      <config-property-type>java.lang.Integer</config-property-type>
      <config-property-value>5</config-property-value>
    </config-property>

    <config-property>
      <description>Interval between setup attempts in milliseconds</description>
      <config-property-name>SetupInterval</config-property-name>
      <config-property-type>java.lang.Long</config-property-type>
      <config-property-value>5000</config-property-value>
    </config-property>

    <config-property>
      <description>Use local transactions rather than XA</description>
      <config-property-name>UseLocalTx</config-property-name>
      <config-property-type>java.lang.Boolean</config-property-type>
      <config-property-value>false</config-property-value>
    </config-property>

    <config-property>
      <description>Broker host</description>
      <config-property-name>Host</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>localhost</config-property-value>
    </config-property>

    <config-property>
      <description>Broker port</description>
      <config-property-name>Port</config-property-name>
      <config-property-type>java.lang.Integer</config-property-type>
      <config-property-value>5672</config-property-value>
    </config-property>

    <config-property>
      <description>Virtual Path for Connection Factory</description>
      <config-property-name>Path</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>test</config-property-value>
    </config-property>

    <config-property>
      <description>Connection URL</description>
      <config-property-name>ConnectionURL</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>amqp://anonymous:passwd@client/test?brokerlist='tcp://localhost?sasl_mechs='PLAIN''</config-property-value>
    </config-property>
    
    <config-property>
      <description>Use a JMS Connection per MessageHandler</description>
      <config-property-name>UseConnectionPerHandler</config-property-name>
      <config-property-type>java.lang.Boolean</config-property-type>
      <config-property-value>true</config-property-value>
    </config-property>

    <outbound-resourceadapter>
      <connection-definition>
        <managedconnectionfactory-class>org.apache.qpid.ra.QpidRAManagedConnectionFactory</managedconnectionfactory-class>

        <config-property>
          <description>Default session type</description>
          <config-property-name>SessionDefaultType</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>javax.jms.Queue</config-property-value>
        </config-property>

        <config-property>
          <description>Specify lock timeout in seconds</description>
          <config-property-name>UseTryLock</config-property-name>
          <config-property-type>java.lang.Integer</config-property-type>
          <config-property-value>0</config-property-value>
        </config-property>

        <config-property>
         <description>Use local transactions rather than XA</description>
         <config-property-name>UseLocalTx</config-property-name>
         <config-property-type>java.lang.Boolean</config-property-type>
         <config-property-value>false</config-property-value>
       </config-property>

        <config-property>
          <description>Client ID for the connection</description>
          <config-property-name>ClientId</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>client_id</config-property-value>
        </config-property>

        <config-property>
          <description>Connection URL</description>
          <config-property-name>ConnectionURL</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value></config-property-value>
        </config-property>

        <config-property>
          <description>Broker host</description>
          <config-property-name>Host</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>localhost</config-property-value>
        </config-property>

        <config-property>
          <description>Broker port</description>
          <config-property-name>Port</config-property-name>
          <config-property-type>java.lang.Integer</config-property-type>
          <config-property-value>5672</config-property-value>
        </config-property>

        <config-property>
          <description>Virtual Path for Connection Factory</description>
          <config-property-name>Path</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>test</config-property-value>
        </config-property>

        <connectionfactory-interface>org.apache.qpid.ra.QpidRAConnectionFactory</connectionfactory-interface>
        <connectionfactory-impl-class>org.apache.qpid.ra.QpidRAConnectionFactoryImpl</connectionfactory-impl-class>
        <connection-interface>javax.jms.Session</connection-interface>
        <connection-impl-class>org.apache.qpid.ra.QpidRASessionImpl</connection-impl-class>
      </connection-definition>
      <transaction-support>XATransaction</transaction-support>
      <authentication-mechanism>
        <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
        <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
      </authentication-mechanism>
      <reauthentication-support>false</reauthentication-support>
    </outbound-resourceadapter>
      <inbound-resourceadapter>
        <messageadapter>
          <messagelistener>
            <messagelistener-type>javax.jms.MessageListener</messagelistener-type>
            <activationspec>
              <activationspec-class>org.apache.qpid.ra.inflow.QpidActivationSpec</activationspec-class>
              <required-config-property>
                <config-property-name>destination</config-property-name>
              </required-config-property>
            </activationspec>
          </messagelistener>
        </messageadapter>
      </inbound-resourceadapter>
      <adminobject>
            <adminobject-interface>org.apache.qpid.ra.admin.QpidQueue</adminobject-interface>
            <adminobject-class> org.apache.qpid.ra.admin.QpidQueueImpl</adminobject-class>
            <config-property>
                <config-property-name>DestinationAddress </config-property-name>
                <config-property-type>java.lang.String </config-property-type>
            </config-property>
        </adminobject>
      <adminobject>
            <adminobject-interface>org.apache.qpid.ra.admin.QpidTopic</adminobject-interface>
            <adminobject-class> org.apache.qpid.ra.admin.QpidTopicImpl</adminobject-class>
            <config-property>
                <config-property-name>DestinationAddress </config-property-name>
                <config-property-type>java.lang.String </config-property-type>
            </config-property>
        </adminobject>
      <adminobject>
            <adminobject-interface>javax.jms.ConnectionFactory</adminobject-interface>
            <adminobject-class> org.apache.qpid.ra.admin.QpidConnectionFactoryProxy</adminobject-class>
            <config-property>
                <config-property-name>ConnectionURL</config-property-name>
                <config-property-type>java.lang.String</config-property-type>
            </config-property>
        </adminobject>
   </resourceadapter>
</connector>
