org.ow2.petals.component.framework.util
Class WSDLUtilImpl

java.lang.Object
  extended by org.ow2.petals.component.framework.util.WSDLUtilImpl

public final class WSDLUtilImpl
extends java.lang.Object

Util class to manipulate WSDL Document or Definition.

Since:
1.0
Author:
wjoseph - EBMWebsourcing

Constructor Summary
WSDLUtilImpl()
          Creates a new instance of WSDLUtilImpl
 
Method Summary
static org.w3c.dom.Document convertDescriptionToDocument(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description wsdlDescription)
          Convert the description to a document
static void convertDescriptionToFile(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description description, java.io.File wsdlFile)
          Write a description into a file.
static java.lang.String convertDescriptionToString(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description wsdlDescription)
          Convert the description to a string
static org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description createLightWSDL20Description(javax.xml.namespace.QName interfaceQName, javax.xml.namespace.QName serviceQName, java.lang.String endpointName)
          Create a light WSDL2.0 description from the given ServiceEndpoint.
static org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description createWsdlDescription(java.net.URL wsdlLocation)
          Create a wsdl description.
static org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description createWsdlDescription(java.net.URL wsdlLocation, boolean processAutogenerateEndpoint)
          Create a wsdl description.
static org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description createWsdlDescription(java.net.URL wsdlLocation, boolean processAutogenerateEndpoint, boolean addImportedDocumentsInWsdl)
          Create a wsdl description.
static java.util.List<org.ow2.easywsdl.wsdl.api.Endpoint> getEndpointList(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description wsdlDescription)
          Get the endpoints into a wsdl description.
static java.util.List<org.ow2.easywsdl.wsdl.api.Endpoint> getEndpointList(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description wsdlDescription, javax.xml.namespace.QName serviceQNameFilter, java.lang.String endpointNameFilter)
          Get the endpoints into a wsdl description.
static boolean isDescriptionContaining(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description wsdlDescription, javax.jbi.servicedesc.ServiceEndpoint endpoint)
          Check if a description contains a specific endpoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSDLUtilImpl

public WSDLUtilImpl()
             throws org.ow2.easywsdl.wsdl.api.WSDLException
Creates a new instance of WSDLUtilImpl

Throws:
org.ow2.easywsdl.wsdl.api.WSDLException
Method Detail

createLightWSDL20Description

public static final org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description createLightWSDL20Description(javax.xml.namespace.QName interfaceQName,
                                                                                                              javax.xml.namespace.QName serviceQName,
                                                                                                              java.lang.String endpointName)
                                                                                                       throws org.ow2.easywsdl.wsdl.api.WSDLException
Create a light WSDL2.0 description from the given ServiceEndpoint. All attributes are required into the function parameter, otherwise a NullPointerException will be thrown. Namespaces are managed.

Parameters:
interfaceQName - must be non null
serviceQName - must be non null
endpointName - must be non null
Returns:
a WSDL2.0 light description
Throws:
org.ow2.easywsdl.wsdl.api.WSDLException
See Also:
org.ow2.petals.component.framework.util

getEndpointList

public static final java.util.List<org.ow2.easywsdl.wsdl.api.Endpoint> getEndpointList(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description wsdlDescription,
                                                                                       javax.xml.namespace.QName serviceQNameFilter,
                                                                                       java.lang.String endpointNameFilter)
Get the endpoints into a wsdl description. Retrieve all of them if no filter name is provided.
Retrieve only the endpoints matching the service QName filter if provided.
Retrieve only the endpoints matching the endpoint name filter if provided.

Parameters:
wsdlDescription - the wsdl description generated by easy wsdl
serviceQNameFilter - if not null, only the endpoints with this service QName will be return
endpointNameFilter - if not null, only the endpoints with this name will be return
Returns:
The list of endpoints, empty if nothing found

getEndpointList

public static final java.util.List<org.ow2.easywsdl.wsdl.api.Endpoint> getEndpointList(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description wsdlDescription)
Get the endpoints into a wsdl description.

Parameters:
wsdlDescription - the wsdl description generated by easy wsdl
Returns:
The list of Endpoint, or null if the description is null

createWsdlDescription

public static final org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description createWsdlDescription(java.net.URL wsdlLocation)
                                                                                                throws org.ow2.easywsdl.wsdl.api.WSDLException
Create a wsdl description.
NOTE : Imported document are written in the description.

Parameters:
wsdlLocation - the location of the wsdl file
Returns:
the description of the document
Throws:
org.ow2.easywsdl.wsdl.api.WSDLException

createWsdlDescription

public static final org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description createWsdlDescription(java.net.URL wsdlLocation,
                                                                                                       boolean processAutogenerateEndpoint)
                                                                                                throws org.ow2.easywsdl.wsdl.api.WSDLException
Create a wsdl description.
NOTE : Imported document are written in the description.

Parameters:
wsdlLocation - the location of the wsdl file
processAutogenerateEndpoint - true if you want to replace the endpoints named Constants.Component#AUTOGENERATED_ENDPOINT_NAME
by a name generated by PEtALS
Returns:
the description of the document
Throws:
org.ow2.easywsdl.wsdl.api.WSDLException

createWsdlDescription

public static final org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description createWsdlDescription(java.net.URL wsdlLocation,
                                                                                                       boolean processAutogenerateEndpoint,
                                                                                                       boolean addImportedDocumentsInWsdl)
                                                                                                throws org.ow2.easywsdl.wsdl.api.WSDLException
Create a wsdl description.

Parameters:
wsdlLocation - the location of the wsdl file
processAutogenerateEndpoint - true if you want to replace the endpoints named Constants.Component#AUTOGENERATED_ENDPOINT_NAME
by a name generated by PEtALS
addImportedDocumentsInWsdl - if true the imported document are written in the description.
Returns:
the description of the document
Throws:
org.ow2.easywsdl.wsdl.api.WSDLException

convertDescriptionToDocument

public static final org.w3c.dom.Document convertDescriptionToDocument(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description wsdlDescription)
                                                               throws org.ow2.easywsdl.wsdl.api.WSDLException
Convert the description to a document

Parameters:
wsdlDescription - the description
Returns:
the document
Throws:
org.ow2.easywsdl.wsdl.api.WSDLException

convertDescriptionToString

public static final java.lang.String convertDescriptionToString(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description wsdlDescription)
                                                         throws org.ow2.easywsdl.wsdl.api.WSDLException
Convert the description to a string

Parameters:
wsdlDescription - the description
Returns:
the string
Throws:
org.ow2.easywsdl.wsdl.api.WSDLException

isDescriptionContaining

public static final boolean isDescriptionContaining(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description wsdlDescription,
                                                    javax.jbi.servicedesc.ServiceEndpoint endpoint)
Check if a description contains a specific endpoint

Parameters:
wsdlDescription - the description
endpoint - the endpoint. must be non null, with a service non null and a name non null
Returns:
true if the description contains the endpoint, false else

convertDescriptionToFile

public static final void convertDescriptionToFile(org.ow2.easywsdl.extensions.wsdl4complexwsdl.api.Description description,
                                                  java.io.File wsdlFile)
                                           throws org.ow2.easywsdl.wsdl.api.WSDLException
Write a description into a file.

Parameters:
description - the wsdl description
wsdlFile - The location of the destination wsdl file.
Throws:
org.ow2.easywsdl.wsdl.api.WSDLException


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.