org.apache.axis2.transport.base
Class BaseUtils

java.lang.Object
  extended by org.apache.axis2.transport.base.BaseUtils
Direct Known Subclasses:
JMSUtils

public class BaseUtils
extends java.lang.Object


Constructor Summary
BaseUtils()
           
 
Method Summary
static org.apache.axiom.soap.SOAPEnvelope getEnvelope(java.io.InputStream in, java.lang.String namespace)
          Create a SOAP envelope using SOAP 1.1 or 1.2 depending on the namespace
static java.util.Hashtable<java.lang.String,java.lang.String> getEPRProperties(java.lang.String url)
          Extract the properties from an endpoint reference.
static org.apache.axis2.transport.MessageFormatter getMessageFormatter(org.apache.axis2.context.MessageContext msgContext)
          Get the MessageFormatter for the given message.
static org.apache.axiom.om.OMOutputFormat getOMOutputFormat(org.apache.axis2.context.MessageContext msgContext)
          Get the OMOutput format for the given message
static javax.xml.namespace.QName getQNameFromString(java.lang.Object obj)
          Return a QName from the String passed in of the form {ns}element
protected static void handleException(java.lang.String s)
           
protected static void handleException(java.lang.String s, java.lang.Exception e)
           
static boolean isBlank(java.lang.String str)
          Utility method to check if a string is null or empty
static boolean isUsingTransport(org.apache.axis2.description.AxisService service, java.lang.String transportName)
           
static java.util.Properties loadProperties(java.lang.String filePath)
          Loads the properties from a given property file path
static void markServiceAsFaulty(java.lang.String serviceName, java.lang.String msg, org.apache.axis2.engine.AxisConfiguration axisCfg)
          Marks the given service as faulty with the given comment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseUtils

public BaseUtils()
Method Detail

getQNameFromString

public static javax.xml.namespace.QName getQNameFromString(java.lang.Object obj)
Return a QName from the String passed in of the form {ns}element

Parameters:
obj - a QName or a String containing a QName in {ns}element form
Returns:
a corresponding QName object

markServiceAsFaulty

public static void markServiceAsFaulty(java.lang.String serviceName,
                                       java.lang.String msg,
                                       org.apache.axis2.engine.AxisConfiguration axisCfg)
Marks the given service as faulty with the given comment

Parameters:
serviceName - service name
msg - comment for being faulty
axisCfg - configuration context

getEnvelope

public static org.apache.axiom.soap.SOAPEnvelope getEnvelope(java.io.InputStream in,
                                                             java.lang.String namespace)
                                                      throws javax.xml.stream.XMLStreamException
Create a SOAP envelope using SOAP 1.1 or 1.2 depending on the namespace

Parameters:
in - InputStream for the payload
namespace - the SOAP namespace
Returns:
the SOAP envelope for the correct version
Throws:
javax.xml.stream.XMLStreamException - on error

getOMOutputFormat

public static org.apache.axiom.om.OMOutputFormat getOMOutputFormat(org.apache.axis2.context.MessageContext msgContext)
Get the OMOutput format for the given message

Parameters:
msgContext - the axis message context
Returns:
the OMOutput format to be used

getMessageFormatter

public static org.apache.axis2.transport.MessageFormatter getMessageFormatter(org.apache.axis2.context.MessageContext msgContext)
Get the MessageFormatter for the given message.

Parameters:
msgContext - the axis message context
Returns:
the MessageFormatter to be used

handleException

protected static void handleException(java.lang.String s)

handleException

protected static void handleException(java.lang.String s,
                                      java.lang.Exception e)

isBlank

public static boolean isBlank(java.lang.String str)
Utility method to check if a string is null or empty

Parameters:
str - the string to check
Returns:
true if the string is null or empty

isUsingTransport

public static boolean isUsingTransport(org.apache.axis2.description.AxisService service,
                                       java.lang.String transportName)

getEPRProperties

public static java.util.Hashtable<java.lang.String,java.lang.String> getEPRProperties(java.lang.String url)
Extract the properties from an endpoint reference.

Parameters:
url - an endpoint reference
Returns:
the extracted properties

loadProperties

public static java.util.Properties loadProperties(java.lang.String filePath)
Loads the properties from a given property file path

Parameters:
filePath - Path of the property file
Returns:
Properties loaded from given file


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.