org.objectweb.jonas_ws.deployment.api
Class WSDLFile

java.lang.Object
  extended by org.objectweb.jonas_ws.deployment.api.WSDLFile

public class WSDLFile
extends java.lang.Object

Gives methods to get WSDL informations and to validate these one.

Author:
Xavier Delplanque, Guillaume Sauthier

Constructor Summary
WSDLFile(java.lang.ClassLoader cl, java.lang.String name)
          Creates a new WSDLFile object.
WSDLFile(java.net.URL url, java.lang.String name)
          Creates a new WSDLFile object.
 
Method Summary
 boolean equals(java.lang.Object other)
          Return true if the 2 objects seems equals.
 javax.wsdl.Definition getDefinition()
          return WSDL definition, null if it's undefined.
protected static I18n getI18n()
           
 java.net.URL getLocation(javax.xml.namespace.QName portQName)
          return the given port location, null if the port is undefined.
 java.lang.String getName()
          Return wsdl file name
 int getNbServices()
          return the number of services defined inside the wsdl.
 javax.xml.namespace.QName getServiceQname()
          return the QName of the first service, null if no service is defined.
 boolean hasPort(javax.xml.namespace.QName portQName)
          return true if the port identified by portQname is defined in WSDL ports.
 boolean hasPort(java.lang.String portName)
          return true if the port identified by portName is defined in WSDL ports.
 boolean hasPortsIncludedIn(java.util.List portList)
          return true if all WSDL ports are defined in portList.
 boolean hasService(javax.xml.namespace.QName srvQName)
          return true if the service identified by srvQName is defined in WSDL services.
 boolean hasSOAPBinding(javax.xml.namespace.QName portQName)
          return true if the port identified by portQname use a SOAP binding.
 boolean hasSOAPHeader(javax.xml.namespace.QName shQName)
          return true if shQName is defined in WSDL services.
 void setLocation(javax.xml.namespace.QName portQName, java.net.URL loc)
          set the given port location if it exists.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WSDLFile

public WSDLFile(java.lang.ClassLoader cl,
                java.lang.String name)
         throws WSDeploymentDescException
Creates a new WSDLFile object.

Parameters:
cl - ClassLoader to use
name - wsdl file name
Throws:
WSDeploymentDescException - when a parse error occurs

WSDLFile

public WSDLFile(java.net.URL url,
                java.lang.String name)
         throws WSDeploymentDescException
Creates a new WSDLFile object.

Parameters:
url - URL to load
name - wsdl file name
Throws:
WSDeploymentDescException - when a parse error occurs
Method Detail

hasPort

public boolean hasPort(javax.xml.namespace.QName portQName)
return true if the port identified by portQname is defined in WSDL ports.

Parameters:
portQName - the port to check.
Returns:
if the gived Qname is contained in the WSDL.definition.service.port.

hasPort

public boolean hasPort(java.lang.String portName)
return true if the port identified by portName is defined in WSDL ports.

Parameters:
portName - the port to check.
Returns:
if the gived port is contained in the WSDL.definition.service.port.

hasService

public boolean hasService(javax.xml.namespace.QName srvQName)
return true if the service identified by srvQName is defined in WSDL services.

Parameters:
srvQName - the service to check.
Returns:
true if the given Qname is contained in the WSDL.definition.service.

hasSOAPHeader

public boolean hasSOAPHeader(javax.xml.namespace.QName shQName)
return true if shQName is defined in WSDL services.

Parameters:
shQName - a soap header Qname that could be defined in the WSDL.
Returns:
true if SOAP Header has been found in WSDL Definition.

hasPortsIncludedIn

public boolean hasPortsIncludedIn(java.util.List portList)
return true if all WSDL ports are defined in portList.

Parameters:
portList - the ports List to check.
Returns:
true if all WSDL ports are defined in WSDL.definition.service.port.

hasSOAPBinding

public boolean hasSOAPBinding(javax.xml.namespace.QName portQName)
return true if the port identified by portQname use a SOAP binding.

Parameters:
portQName - the port to check.
Returns:
if the port identified by portQname use a SOAP binding. return false if the portQname is not defined in the WSDL file.

getDefinition

public javax.wsdl.Definition getDefinition()
return WSDL definition, null if it's undefined.

Returns:
WSDL definition.

getNbServices

public int getNbServices()
return the number of services defined inside the wsdl.

Returns:
the number of services defined inside the wsdl.

getServiceQname

public javax.xml.namespace.QName getServiceQname()
return the QName of the first service, null if no service is defined.

Returns:
the QName of the first service, null if no service is defined.

getLocation

public java.net.URL getLocation(javax.xml.namespace.QName portQName)
                         throws WSDeploymentDescException
return the given port location, null if the port is undefined.

Parameters:
portQName - the port QName identifying the port searched.
Returns:
portQname location.
Throws:
WSDeploymentDescException - when port is not found

setLocation

public void setLocation(javax.xml.namespace.QName portQName,
                        java.net.URL loc)
set the given port location if it exists.

Parameters:
portQName - the port to set.
loc - the port location.

getName

public java.lang.String getName()
Return wsdl file name

Returns:
wsdl file name

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Returns a String representation of this WSDLFile.

equals

public boolean equals(java.lang.Object other)
Return true if the 2 objects seems equals. Because the equals() method doesn't exist on Definition, it's hard to known if 2 Definition are equals in value. So we just test lists lengths. Use it ONLY in test/debug case. !!!

Overrides:
equals in class java.lang.Object
Parameters:
other - the object to compare.
Returns:
true if the 2 objects seems equals.

getI18n

protected static I18n getI18n()
Returns:
Returns the i18n.