de.uka.cmtm.serviceregistry.publish.uddi
Class UddiUtils

java.lang.Object
  extended by de.uka.cmtm.serviceregistry.publish.uddi.UddiUtils

public class UddiUtils
extends Object

Some utility methods to encapsulate UDDI calls

Author:
tilmann

Constructor Summary
UddiUtils(UDDIProxy uddiProxy)
          Create new UddiUtils for querying only
UddiUtils(UDDIProxy uddiProxy, AuthToken authToken)
          Create new UddiUtils for querying and publishing
 
Method Summary
 List<BusinessInfo> findBusinesses(String name, int maxNumber)
          Find all businesses with a name starting with the contents of the name parameter
 List<ServiceInfo> findServices(String businessKey, CategoryBag categoryBag, int maxNumber)
          Find all services belonging to a business with the given key and containing all references from the given CategoryBag.
 TModel findTModel(String name, CategoryBag categoryBag)
          Search for a tModel with the given name and CategoryBag
 AuthToken getAuthToken()
           
 BusinessEntity getBusinessEntity(String businessKey)
          Retrieve the BusinessEntity with the given key
 BusinessService getBusinessService(String serviceKey)
          Retrieve the BusinessService with the given key
 TModel getTModel(String tModelKey)
          Retrieve the TModel with the given key
 BindingTemplate publishBindingTemplate(AccessPoint accessPoint, String serviceKey, TModelInstanceDetails tModelInstanceDetails)
          Publish a new BindingTemplate with the given parameters.
 BusinessEntity publishBusiness(String name, String description)
          Publish the business with given name and description and return it.
 BusinessService publishService(String name, String description, String businessKey, CategoryBag categoryBag)
          Publish a new BusinessService with the given parameters
 TModel publishTModel(String name, String description, String overviewUrl, CategoryBag categoryBag)
          Publish the tModel with given name, description overview URL and category bag and return it.
 void setAuthToken(AuthToken authToken)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UddiUtils

public UddiUtils(UDDIProxy uddiProxy)
Create new UddiUtils for querying only

Parameters:
uddiProxy - the UDDIProxy to be used

UddiUtils

public UddiUtils(UDDIProxy uddiProxy,
                 AuthToken authToken)
Create new UddiUtils for querying and publishing

Parameters:
uddiProxy - the UDDIProxy to be used
authToken - the AuthToken to be used
Method Detail

findBusinesses

public List<BusinessInfo> findBusinesses(String name,
                                         int maxNumber)
                                  throws UDDIException,
                                         TransportException
Find all businesses with a name starting with the contents of the name parameter

Parameters:
name - the beginning of the business name to be searched
maxNumber - the maximum number of results to retrieve
Returns:
a collection containing the results
Throws:
UDDIException
TransportException

findServices

public List<ServiceInfo> findServices(String businessKey,
                                      CategoryBag categoryBag,
                                      int maxNumber)
                               throws UDDIException,
                                      TransportException
Find all services belonging to a business with the given key and containing all references from the given CategoryBag.

Parameters:
businessKey - the key of the business
categoryBag - the category bag constraints
maxNumber - the maximum number of results to retrieve
Returns:
a collection containing the results
Throws:
UDDIException
TransportException

findTModel

public TModel findTModel(String name,
                         CategoryBag categoryBag)
                  throws UDDIException,
                         TransportException
Search for a tModel with the given name and CategoryBag

Parameters:
name - the name of the tModel
categoryBag - the category bag constraints
Returns:
a TModel if found, null otherwise
Throws:
UDDIException
TransportException

getTModel

public TModel getTModel(String tModelKey)
                 throws UDDIException,
                        TransportException
Retrieve the TModel with the given key

Parameters:
tModelKey - the key
Returns:
the TModel
Throws:
UDDIException
TransportException

getBusinessEntity

public BusinessEntity getBusinessEntity(String businessKey)
                                 throws UDDIException,
                                        TransportException
Retrieve the BusinessEntity with the given key

Parameters:
businessKey - the key
Returns:
the BusinessEntity
Throws:
UDDIException
TransportException

getBusinessService

public BusinessService getBusinessService(String serviceKey)
                                   throws UDDIException,
                                          TransportException
Retrieve the BusinessService with the given key

Parameters:
serviceKey - the key
Returns:
the BusinessService
Throws:
UDDIException
TransportException

publishBusiness

public BusinessEntity publishBusiness(String name,
                                      String description)
                               throws TransportException,
                                      UDDIException
Publish the business with given name and description and return it. If a business with the given name can be found, don't publish anything. Return the found business instead.

Parameters:
name - the name of the business
description - the description of the business
Returns:
the published/found business
Throws:
TransportException
UDDIException

publishTModel

public TModel publishTModel(String name,
                            String description,
                            String overviewUrl,
                            CategoryBag categoryBag)
                     throws UDDIException,
                            TransportException
Publish the tModel with given name, description overview URL and category bag and return it. If a tModel with the given name and category bag can be found, don't publish anything. Return the found tModel instead.

Parameters:
name - the name of the tModel
description - the description of the tModel
overviewUrl - the overview URL of the tModel
categoryBag - the category bag of the tModel
Returns:
the published/found tModel
Throws:
UDDIException
TransportException

publishBindingTemplate

public BindingTemplate publishBindingTemplate(AccessPoint accessPoint,
                                              String serviceKey,
                                              TModelInstanceDetails tModelInstanceDetails)
                                       throws TransportException,
                                              UDDIException
Publish a new BindingTemplate with the given parameters.

Parameters:
accessPoint - the AccessPoint of the BindingTemplate
serviceKey - the key of the service
tModelInstanceDetails - the TModelInstanceDetails
Returns:
the newly published BindingTemplate
Throws:
TransportException
UDDIException

publishService

public BusinessService publishService(String name,
                                      String description,
                                      String businessKey,
                                      CategoryBag categoryBag)
                               throws TransportException,
                                      UDDIException
Publish a new BusinessService with the given parameters

Parameters:
name - the name of the service
description - the description of the service
businessKey - the key of the business
categoryBag - the CategoryBag of the service
Returns:
the newly published BusinessService
Throws:
TransportException
UDDIException

getAuthToken

public AuthToken getAuthToken()

setAuthToken

public void setAuthToken(AuthToken authToken)