de.fhg.igd.semoa.webservice.uddi
Class UddiProxy

java.lang.Object
  extended byde.fhg.igd.semoa.webservice.uddi.UddiProxy

public class UddiProxy
extends Object

This class represents an UDDI proxy which allows to register, unregister and find implementations for interfaces.

Version:
"$Id: UddiProxy.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Henno Buschmann, Jan Peters

Field Summary
protected  String businessKey_
          business key where to register services
protected  String inquiryURL_
          Inquiry URL of UDDI registry
private static Logger log_
          The Logger instance for this class
private  String password_
          password for the UDDI server
protected  org.uddi4j.client.UDDIProxy proxy_
          UDDI4J Proxy
protected  String publishURL_
          Publish URL of UDDI registry
protected  org.uddi4j.response.AuthToken token_
          UDDI server authentication token
private  String username_
          username for the UDDI server
 
Constructor Summary
UddiProxy()
           
 
Method Summary
 void connect()
          This method connects to the uddi server and obtains an authentication token.
 void disconnect()
          The disconnect method disconnects from the uddi server and discards the authentication token.
 boolean existWebservice(String name, String wsdlUrl, Vector interfaceKeys)
          The existWebservice method checks if a given webservice is already registred.
 String findInterface(String name, String hashcode)
          The findInterface method returns the interface key of a specific interface with the given name and hashcode.
 Vector findWebservices(String name)
          The findWebservices method is used to find webservices based on the name of the service.
 Vector findWebservices(Vector interfaceKeys)
          The findWebservices method finds services based on the implemented interfaces.
protected  String getBusinessKey(String name)
          Returns the key of the business entity with the given name.
protected  String getTModelName(String tModelKey)
          The getTModelName methods returns the name of a TModel to a corresponding TModel key.
 Webservice.Description getWebserviceDescription(String serviceKey)
          The getWebserviceDescription method returns information about a webservice.
 String registerInterface(String name, String hashcode)
          The registerInterface method registers an interface in the UDDI database and returns the key.
 void registerWebservice(String name, String description, String wsdlUrl, Vector interfaceKeys)
          The registerWebservice registers a webservice with interfaces.
 void revokeWebservice(String name, String description, String wsdlUrl, Vector interfaceKeys)
          The revokeWebservice method unregisters a webservice with the given data.
 void setConnectionData(String inquiryURL, String publishURL, String username, String password, String businessKey, String businessName)
          The setConnectionData sets data which is required to connect to the uddi server to use publishing API.
 String toString()
          Returns the String representation of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log_

private static Logger log_
The Logger instance for this class


username_

private String username_
username for the UDDI server


password_

private String password_
password for the UDDI server


proxy_

protected org.uddi4j.client.UDDIProxy proxy_
UDDI4J Proxy


token_

protected org.uddi4j.response.AuthToken token_
UDDI server authentication token


businessKey_

protected String businessKey_
business key where to register services


publishURL_

protected String publishURL_
Publish URL of UDDI registry


inquiryURL_

protected String inquiryURL_
Inquiry URL of UDDI registry

Constructor Detail

UddiProxy

public UddiProxy()
Method Detail

connect

public void connect()
             throws org.uddi4j.UDDIException,
                    org.uddi4j.transport.TransportException
This method connects to the uddi server and obtains an authentication token. Call setConnectionData first to set credentials.

Throws:
org.uddi4j.UDDIException - if the UDDIProxy cannot create the authentication token
org.uddi4j.transport.TransportException - if the UDDIProxy cannot create the authentication token

disconnect

public void disconnect()
                throws org.uddi4j.UDDIException,
                       org.uddi4j.transport.TransportException
The disconnect method disconnects from the uddi server and discards the authentication token.

Throws:
org.uddi4j.UDDIException - if the UDDIProxy cannot discard the authentication token
org.uddi4j.transport.TransportException - if the UDDIProxy cannot discard the authentication token

setConnectionData

public void setConnectionData(String inquiryURL,
                              String publishURL,
                              String username,
                              String password,
                              String businessKey,
                              String businessName)
                       throws MalformedURLException,
                              IllegalArgumentException,
                              IOException
The setConnectionData sets data which is required to connect to the uddi server to use publishing API.

Parameters:
inquiryURL - UDDI server URL to search the database
publishURL - UDDI server URL to publish services
username - UDDI server username
password - UDDI server password
businessKey - business key where to register services
Throws:
MalformedURLException - if the UDDIProxy cannot process one of the given URLs
IllegalArgumentException - if one or more parameters are invalid
IOException

getBusinessKey

protected String getBusinessKey(String name)
Returns the key of the business entity with the given name. If no business entity with this name is found, null is returned.

Parameters:
name - Name of the business entity to search
Returns:
The key of the business entity

findInterface

public String findInterface(String name,
                            String hashcode)
                     throws org.uddi4j.UDDIException,
                            org.uddi4j.transport.TransportException
The findInterface method returns the interface key of a specific interface with the given name and hashcode. If the interface is not found, it returns null.

Parameters:
name - Name of the interface.
hashcode - Hashcode of the interface
Returns:
the key of the interface
Throws:
org.uddi4j.UDDIException - if the UDDIProxy cannot process the input data
org.uddi4j.transport.TransportException - if the UDDIProxy cannot process the input data

registerInterface

public String registerInterface(String name,
                                String hashcode)
                         throws org.uddi4j.UDDIException,
                                org.uddi4j.transport.TransportException,
                                IllegalArgumentException
The registerInterface method registers an interface in the UDDI database and returns the key. If the interface already exists the key is returned without new registration.

Parameters:
name - Name of the interface
hashcode - Hashcode of the interface
Returns:
the key of the interface
Throws:
org.uddi4j.UDDIException - if the UDDIProxy cannot save the TModel
org.uddi4j.transport.TransportException - if the UDDIProxy cannot save the TModel
IllegalArgumentException - if one or more parameters are invalid

registerWebservice

public void registerWebservice(String name,
                               String description,
                               String wsdlUrl,
                               Vector interfaceKeys)
                        throws org.uddi4j.UDDIException,
                               org.uddi4j.transport.TransportException,
                               IllegalArgumentException
The registerWebservice registers a webservice with interfaces.

Parameters:
name - Name of the webservice
description - Description of the webservice
wsdlUrl - URL to the WSDL file
interfaceKeys - Keys of the implemented interfaces (get with findInterface)
Throws:
org.uddi4j.UDDIException - if the UDDIProxy cannot save the service
org.uddi4j.transport.TransportException - if the UDDIProxy cannot save the service
IllegalArgumentException - if one or more parameters are invalid

revokeWebservice

public void revokeWebservice(String name,
                             String description,
                             String wsdlUrl,
                             Vector interfaceKeys)
                      throws org.uddi4j.UDDIException,
                             org.uddi4j.transport.TransportException,
                             IllegalArgumentException,
                             Exception
The revokeWebservice method unregisters a webservice with the given data. The first service found is deleted. If no service is found the method returns with an error.

Parameters:
name - Name of the webservice
description - Description of the webservice
wsdlUrl - URL to the WSDL file
interfaceKeys - Vector of keys of the interfaces
Throws:
org.uddi4j.UDDIException - if the UDDIProxy cannot remove the service
org.uddi4j.transport.TransportException - if the UDDIProxy cannot remove the service
IllegalArgumentException - if one or more parameters are invalid
Exception - if no webservice is found

findWebservices

public Vector findWebservices(String name)
                       throws org.uddi4j.UDDIException,
                              org.uddi4j.transport.TransportException,
                              IllegalArgumentException
The findWebservices method is used to find webservices based on the name of the service.

Parameters:
name - Name of the webservice. Wildcards such as "∗" (matching any corresponding path element) and "-" (matching any corresponding path element as well as any following path elements) are supported.
Returns:
A Vector of service Keys (String)
Throws:
org.uddi4j.UDDIException - if the UDDIProxy cannot find the service
org.uddi4j.transport.TransportException - if the UDDIProxy cannot find the service
IllegalArgumentException - if one or more parameters are invalid

findWebservices

public Vector findWebservices(Vector interfaceKeys)
                       throws org.uddi4j.UDDIException,
                              org.uddi4j.transport.TransportException,
                              IllegalArgumentException
The findWebservices method finds services based on the implemented interfaces.

Parameters:
interfaceKeys - vector of keys of the interfaces the service implements (use findInterface)
Returns:
Vector of service keys (Strings). If no service is found the Vector is empty.
Throws:
org.uddi4j.UDDIException - if the UDDIProxy cannot find the service
org.uddi4j.transport.TransportException - if the UDDIProxy cannot find the service
IllegalArgumentException - if one or more parameters are invalid

existWebservice

public boolean existWebservice(String name,
                               String wsdlUrl,
                               Vector interfaceKeys)
                        throws org.uddi4j.UDDIException,
                               org.uddi4j.transport.TransportException,
                               IllegalArgumentException
The existWebservice method checks if a given webservice is already registred.

Parameters:
name - name of the webservice
wsdlUrl - WSDL URL of the webservice
interfaceKeys - interface keys of the webservice (use findInterface)
Returns:
returns true if the webservice is already registered, otherwise false
Throws:
org.uddi4j.UDDIException - if the UDDIProxy cannot find the service
org.uddi4j.transport.TransportException - if the UDDIProxy cannot find the service
IllegalArgumentException - if one or more parameters are invalid

getWebserviceDescription

public Webservice.Description getWebserviceDescription(String serviceKey)
                                                throws org.uddi4j.UDDIException,
                                                       org.uddi4j.transport.TransportException,
                                                       IllegalArgumentException
The getWebserviceDescription method returns information about a webservice.

Parameters:
serviceKey - the key of the webservice
Returns:
returns a WebserviceInfo class with the asked information
Throws:
org.uddi4j.UDDIException - if the UDDIProxy cannot find the service description
org.uddi4j.transport.TransportException - if the UDDIProxy cannot find the service description
IllegalArgumentException - if the service key is null

getTModelName

protected String getTModelName(String tModelKey)
                        throws org.uddi4j.UDDIException,
                               org.uddi4j.transport.TransportException,
                               IllegalArgumentException
The getTModelName methods returns the name of a TModel to a corresponding TModel key.

Parameters:
tModelKey - key of the TModel
Returns:
name of the TModel
Throws:
org.uddi4j.UDDIException - if the UDDIProxy cannot fetch the TModel details
org.uddi4j.transport.TransportException - if the UDDIProxy cannot fetch the TModel details
IllegalArgumentException - if the key is invalid

toString

public String toString()
Returns the String representation of this instance.

Returns:
the String representation of this instance.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.