org.jboss.soa.esb.couriers
Class CourierUtil

java.lang.Object
  extended by org.jboss.soa.esb.couriers.CourierUtil

public class CourierUtil
extends java.lang.Object


Field Summary
protected static org.apache.log4j.Logger _logger
           
static java.lang.String CORRELATION_ID_TAG
           
 
Method Summary
static byte[] bytesFromLocalFile(java.io.File from)
           
static void bytesToLocalFile(byte[] bytes, java.io.File to)
           
static void cleanCourier(org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier courier)
           
static void cleanCourier(org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier courier)
           
static void cleanCourier(TwoWayCourier courier)
           
static void deliverMessage(Message message)
           
static java.lang.String getReplySelector()
          We will be listening the same queue, but with a 'temporary' message selector based of a UUID.
static EPR getTemporaryReplyToEpr(EPR toEpr)
          Build a temporary replyToEPR, based on the toEpr, to which we can reply to.
static Message messageFromLocalFile(java.io.File from)
           
static java.io.File messageToLocalFile(java.io.File directory, Message message)
           
static java.util.List<KeyValuePair> propertiesFromSelector(java.lang.String selector)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORRELATION_ID_TAG

public static final java.lang.String CORRELATION_ID_TAG
See Also:
Constant Field Values

_logger

protected static org.apache.log4j.Logger _logger
Method Detail

propertiesFromSelector

public static java.util.List<KeyValuePair> propertiesFromSelector(java.lang.String selector)
                                                           throws ConfigurationException
Throws:
ConfigurationException

getReplySelector

public static java.lang.String getReplySelector()
We will be listening the same queue, but with a 'temporary' message selector based of a UUID.

Parameters:
message - to which we ill add the CORRELATION_ID_TAG.
Returns:
the generated unique reply selector.

getTemporaryReplyToEpr

public static EPR getTemporaryReplyToEpr(EPR toEpr)
                                  throws CourierException,
                                         MalformedEPRException
Build a temporary replyToEPR, based on the toEpr, to which we can reply to.

Parameters:
toEpr - - the toEPR which will be used a basis to generate the replyToEPR.
Returns:
replyToEPR - the EPR to which the pickup will be delivered.
Throws:
URISyntaxException, - CourierException
CourierException
MalformedEPRException

messageToLocalFile

public static java.io.File messageToLocalFile(java.io.File directory,
                                              Message message)
                                       throws java.io.IOException,
                                              javax.xml.parsers.ParserConfigurationException
Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException

messageFromLocalFile

public static Message messageFromLocalFile(java.io.File from)
                                    throws java.io.FileNotFoundException,
                                           java.io.IOException,
                                           java.lang.ClassNotFoundException,
                                           java.lang.ClassCastException,
                                           javax.xml.parsers.ParserConfigurationException,
                                           org.xml.sax.SAXException,
                                           CourierException
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
java.lang.ClassCastException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
CourierException

bytesFromLocalFile

public static byte[] bytesFromLocalFile(java.io.File from)
                                 throws java.io.IOException
Throws:
java.io.IOException

bytesToLocalFile

public static void bytesToLocalFile(byte[] bytes,
                                    java.io.File to)
                             throws java.io.IOException
Throws:
java.io.IOException

deliverMessage

public static void deliverMessage(Message message)
                           throws java.net.URISyntaxException,
                                  CourierException,
                                  MalformedEPRException
Throws:
java.net.URISyntaxException
CourierException
MalformedEPRException

cleanCourier

public static void cleanCourier(org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier courier)

cleanCourier

public static void cleanCourier(org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier courier)

cleanCourier

public static void cleanCourier(TwoWayCourier courier)