org.apache.axis2.util
Class Utils

java.lang.Object
  extended by org.apache.axis2.util.Utils

public class Utils
extends java.lang.Object


Constructor Summary
Utils()
           
 
Method Summary
static void addHandler(Flow flow, Handler handler, java.lang.String phaseName)
           
static void calculateDefaultModuleVersion(java.util.HashMap modules, AxisConfiguration axisConfig)
           
static boolean checkVersion(Version module1version, Version module2version)
          - if he trying to engage the same module then method will returen false - else it will return true
static MessageContext createOutMessageContext(MessageContext inMessageContext)
          Deprecated. (post1.1branch)
static AxisService createSimpleInOnlyService(javax.xml.namespace.QName serviceName, MessageReceiver messageReceiver, javax.xml.namespace.QName opName)
           
static AxisService createSimpleService(javax.xml.namespace.QName serviceName, MessageReceiver messageReceiver, java.lang.String className, javax.xml.namespace.QName opName)
           
static AxisService createSimpleService(javax.xml.namespace.QName serviceName, java.lang.String className, javax.xml.namespace.QName opName)
           
static AxisService createSimpleServiceforClient(javax.xml.namespace.QName serviceName, MessageReceiver messageReceiver, java.lang.String className, javax.xml.namespace.QName opName)
           
static AxisService createSimpleServiceforClient(javax.xml.namespace.QName serviceName, java.lang.String className, javax.xml.namespace.QName opName)
           
static ServiceContext fillContextInformation(AxisService axisService, ConfigurationContext configurationContext)
           
static int getAxisSpecifMEPConstant(java.lang.String messageExchangePattern)
          Maps the String URI of the Message exchange pattern to a integer.
static java.lang.String getHostname(AxisConfiguration axisConfiguration)
          First check whether the hostname parameter is there in AxisConfiguration (axis2.xml) , if it is there then this will return that as the host name , o.w will return the IP address.
static AxisFault getInboundFaultFromMessageContext(MessageContext messageContext)
          Get an AxisFault object to represent the SOAPFault in the SOAPEnvelope attached to the provided MessageContext.
static java.lang.String getIpAddress()
          Returns the ip address to be used for the replyto epr CAUTION: This will go through all the available network interfaces and will try to return an ip address.
static java.lang.String getIpAddress(AxisConfiguration axisConfiguration)
          First check whether the hostname parameter is there in AxisConfiguration (axis2.xml) , if it is there then this will retun that as the host name , o.w will return the IP address.
static java.lang.String getModuleName(java.lang.String moduleName, java.lang.String moduleVersion)
           
static int getMtomThreshold(MessageContext msgCtxt)
           
static ConfigurationContext getNewConfigurationContext(java.lang.String repositry)
           
static java.lang.ClassLoader getObjectClassLoader(java.lang.Object object)
          This method will provide the logic needed to retrieve an Object's classloader in a Java 2 Security compliant manner.
static java.lang.String getParameterValue(Parameter param)
           
static boolean isExplicitlyTrue(MessageContext messageContext, java.lang.String propertyName)
          Deprecated. please use MessageContext.isTrue(propertyName) instead
static boolean isValidModuleName(java.lang.String moduleName)
           
static java.lang.String[] parseRequestURLForServiceAndOperation(java.lang.String path, java.lang.String servicePath)
          Break a full path into pieces
static java.lang.String sanitizeWebOutput(java.lang.String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

addHandler

public static void addHandler(Flow flow,
                              Handler handler,
                              java.lang.String phaseName)

createOutMessageContext

public static MessageContext createOutMessageContext(MessageContext inMessageContext)
                                              throws AxisFault
Deprecated. (post1.1branch)

Throws:
AxisFault
See Also:
org.apache.axis2.util.MessageContextBuilder:createOutMessageContext()

createSimpleService

public static AxisService createSimpleService(javax.xml.namespace.QName serviceName,
                                              java.lang.String className,
                                              javax.xml.namespace.QName opName)
                                       throws AxisFault
Throws:
AxisFault

createSimpleServiceforClient

public static AxisService createSimpleServiceforClient(javax.xml.namespace.QName serviceName,
                                                       java.lang.String className,
                                                       javax.xml.namespace.QName opName)
                                                throws AxisFault
Throws:
AxisFault

createSimpleInOnlyService

public static AxisService createSimpleInOnlyService(javax.xml.namespace.QName serviceName,
                                                    MessageReceiver messageReceiver,
                                                    javax.xml.namespace.QName opName)
                                             throws AxisFault
Throws:
AxisFault

createSimpleService

public static AxisService createSimpleService(javax.xml.namespace.QName serviceName,
                                              MessageReceiver messageReceiver,
                                              java.lang.String className,
                                              javax.xml.namespace.QName opName)
                                       throws AxisFault
Throws:
AxisFault

createSimpleServiceforClient

public static AxisService createSimpleServiceforClient(javax.xml.namespace.QName serviceName,
                                                       MessageReceiver messageReceiver,
                                                       java.lang.String className,
                                                       javax.xml.namespace.QName opName)
                                                throws AxisFault
Throws:
AxisFault

fillContextInformation

public static ServiceContext fillContextInformation(AxisService axisService,
                                                    ConfigurationContext configurationContext)
                                             throws AxisFault
Throws:
AxisFault

parseRequestURLForServiceAndOperation

public static java.lang.String[] parseRequestURLForServiceAndOperation(java.lang.String path,
                                                                       java.lang.String servicePath)
Break a full path into pieces

Returns:
an array where element [0] always contains the service, and element 1, if not null, contains the path after the first element. all ? parameters are discarded.

getNewConfigurationContext

public static ConfigurationContext getNewConfigurationContext(java.lang.String repositry)
                                                       throws java.lang.Exception
Throws:
java.lang.Exception

getParameterValue

public static java.lang.String getParameterValue(Parameter param)

getModuleName

public static java.lang.String getModuleName(java.lang.String moduleName,
                                             java.lang.String moduleVersion)

isValidModuleName

public static boolean isValidModuleName(java.lang.String moduleName)

checkVersion

public static boolean checkVersion(Version module1version,
                                   Version module2version)
                            throws AxisFault
- if he trying to engage the same module then method will returen false - else it will return true

Throws:
AxisFault

calculateDefaultModuleVersion

public static void calculateDefaultModuleVersion(java.util.HashMap modules,
                                                 AxisConfiguration axisConfig)

isExplicitlyTrue

public static boolean isExplicitlyTrue(MessageContext messageContext,
                                       java.lang.String propertyName)
Deprecated. please use MessageContext.isTrue(propertyName) instead

Check if a MessageContext property is true.

Parameters:
messageContext - the MessageContext
propertyName - the property name
Returns:
true if the property is Boolean.TRUE, "true", 1, etc. or false otherwise

getAxisSpecifMEPConstant

public static int getAxisSpecifMEPConstant(java.lang.String messageExchangePattern)
Maps the String URI of the Message exchange pattern to a integer. Further, in the first lookup, it will cache the looked up value so that the subsequent method calls are extremely efficient.


getInboundFaultFromMessageContext

public static AxisFault getInboundFaultFromMessageContext(MessageContext messageContext)
Get an AxisFault object to represent the SOAPFault in the SOAPEnvelope attached to the provided MessageContext. This first check for an already extracted AxisFault and otherwise does a simple extract.

MUST NOT be passed a MessageContext which does not contain a SOAPFault

Parameters:
messageContext -
Returns:

getObjectClassLoader

public static java.lang.ClassLoader getObjectClassLoader(java.lang.Object object)
This method will provide the logic needed to retrieve an Object's classloader in a Java 2 Security compliant manner.


getMtomThreshold

public static int getMtomThreshold(MessageContext msgCtxt)

getIpAddress

public static java.lang.String getIpAddress()
                                     throws java.net.SocketException
Returns the ip address to be used for the replyto epr CAUTION: This will go through all the available network interfaces and will try to return an ip address. First this will try to get the first IP which is not loopback address (127.0.0.1). If none is found then this will return this will return 127.0.0.1. This will not consider IPv6 addresses.

TODO: - Improve this logic to genaralize it a bit more - Obtain the ip to be used here from the Call API

Returns:
Returns String.
Throws:
java.net.SocketException

getIpAddress

public static java.lang.String getIpAddress(AxisConfiguration axisConfiguration)
                                     throws java.net.SocketException
First check whether the hostname parameter is there in AxisConfiguration (axis2.xml) , if it is there then this will retun that as the host name , o.w will return the IP address.

Throws:
java.net.SocketException

getHostname

public static java.lang.String getHostname(AxisConfiguration axisConfiguration)
First check whether the hostname parameter is there in AxisConfiguration (axis2.xml) , if it is there then this will return that as the host name , o.w will return the IP address.

Parameters:
axisConfiguration -
Returns:
hostname

sanitizeWebOutput

public static java.lang.String sanitizeWebOutput(java.lang.String text)


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