Coverage Report - org.apache.camel.component.xmpp.XmppExchange
 
Classes in this File Line Coverage Branch Coverage Complexity
XmppExchange
0% 
N/A 
0
 
 1  
 /**
 2  
  * Licensed to the Apache Software Foundation (ASF) under one or more
 3  
  * contributor license agreements.  See the NOTICE file distributed with
 4  
  * this work for additional information regarding copyright ownership.
 5  
  * The ASF licenses this file to You under the Apache License, Version 2.0
 6  
  * (the "License"); you may not use this file except in compliance with
 7  
  * the License.  You may obtain a copy of the License at
 8  
  *
 9  
  *      http://www.apache.org/licenses/LICENSE-2.0
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.apache.camel.component.xmpp;
 18  
 
 19  
 import org.apache.camel.CamelContext;
 20  
 import org.apache.camel.Exchange;
 21  
 import org.apache.camel.impl.DefaultExchange;
 22  
 
 23  
 import org.jivesoftware.smack.packet.Message;
 24  
 
 25  
 /**
 26  
  * Represents an {@ilnk Exchange} for working with XMPP
 27  
  *
 28  
  * @version $Revision:520964 $
 29  
  */
 30  0
 public class XmppExchange extends DefaultExchange {
 31  
     private XmppBinding binding;
 32  
 
 33  
     public XmppExchange(CamelContext context, XmppBinding binding) {
 34  0
         super(context);
 35  0
         this.binding = binding;
 36  0
     }
 37  
 
 38  
     public XmppExchange(CamelContext context, XmppBinding binding, Message message) {
 39  0
         this(context, binding);
 40  0
         setIn(new XmppMessage(message));
 41  0
     }
 42  
 
 43  
     @Override
 44  
     public XmppMessage getIn() {
 45  0
         return (XmppMessage) super.getIn();
 46  
     }
 47  
 
 48  
     @Override
 49  
     public XmppMessage getOut() {
 50  0
         return (XmppMessage) super.getOut();
 51  
     }
 52  
 
 53  
     @Override
 54  
     public XmppMessage getOut(boolean lazyCreate) {
 55  0
         return (XmppMessage) super.getOut(lazyCreate);
 56  
     }
 57  
 
 58  
     @Override
 59  
     public XmppMessage getFault() {
 60  0
         return (XmppMessage) super.getFault();
 61  
     }
 62  
 
 63  
     public XmppBinding getBinding() {
 64  0
         return binding;
 65  
     }
 66  
 
 67  
     @Override
 68  
     public Exchange newInstance() {
 69  0
         return new XmppExchange(getContext(), binding);
 70  
     }
 71  
 
 72  
     // Expose the underlying XMPP APIs
 73  
     //-------------------------------------------------------------------------
 74  
 
 75  
     /**
 76  
      * Return the underlying XMPP In message
 77  
      *
 78  
      * @return the XMPP In message
 79  
      */
 80  
     public Message getInMessage() {
 81  0
         return getIn().getXmppMessage();
 82  
     }
 83  
 
 84  
     /**
 85  
      * Return the underlying XMPP Out message
 86  
      *
 87  
      * @return the XMPP out message
 88  
      */
 89  
     public Message getOutMessage() {
 90  0
         return getOut().getXmppMessage();
 91  
     }
 92  
 
 93  
     /**
 94  
      * Return the underlying XMPP Fault message
 95  
      *
 96  
      * @return the XMPP fault message
 97  
      */
 98  
     public Message getFaultMessage() {
 99  0
         return getOut().getXmppMessage();
 100  
     }
 101  
 
 102  
     // Implementation methods
 103  
     //-------------------------------------------------------------------------
 104  
 
 105  
     @Override
 106  
     protected XmppMessage createInMessage() {
 107  0
         return new XmppMessage();
 108  
     }
 109  
 
 110  
     @Override
 111  
     protected XmppMessage createOutMessage() {
 112  0
         return new XmppMessage();
 113  
     }
 114  
 }