org.jafer.registry.uddi.model
Class BusinessService

java.lang.Object
  extended by org.jafer.registry.uddi.model.BusinessService
All Implemented Interfaces:
java.io.Serializable, Service

public class BusinessService
extends java.lang.Object
implements Service

This class implements a service for a UDDI registry. This Class should never be directly instantiated. Updates made using this class will only be made to the uddi registry when the service provider is updated through the service manager

See Also:
Serialized Form

Field Summary
private  org.uddi4j.datatype.service.BusinessService businessService
          Stores a reference to the underlying business service object
static java.lang.String END_POINT
          Stores a reference to the binding template endpoint access type.
private static int MAX_DESCRIPTION_LENGTH
          Stores a reference to the maximumn number of characters for the description field
private static int MAX_NAME_LENGTH
          Stores a reference to the maximumn number of characters for the name field
private static int MAX_URL_LENGTH
          Stores a reference to the maximumn number of characters for the url field
private  TModelManager tModelManager
          Stores a reference to the TModelManager that loads and initialises all the required TModels.
static java.lang.String WSDL_POINT
          Stores a reference to the binding template wsdl access type.
 
Constructor Summary
BusinessService(TModelManager tModelManager, org.uddi4j.datatype.service.BusinessService service)
          Constructor of the business service
 
Method Summary
 void addCategory(Category category)
          Adds a jafer defined category to the service if it does not already exist.
 void addToServicesList(java.util.List uddiBusinessServices)
          Adds the service to the list of uddi4j business services.
static java.util.List extractBusinessServiceInfos(TModelManager tModelManager, java.util.List uddiBusinessServices)
          This method returns all the business services for the business entity.
private  java.lang.String getAccessPointURL(Protocol protocol, java.lang.String accessPointType)
          Returns the URL for the specified protocol access point
 java.lang.String getAccessUrl(Protocol protocol)
          Returns the access url for the service.
 java.util.List getCategories()
          This method returns all the categories supported linked to the service.
 java.lang.String getDescription()
          Returns the description of the service.
 java.lang.String getId()
          Returns the uniquie id of this service.
 java.lang.String getName()
          Returns the name of this service.
 java.lang.String getServiceProviderId()
          Returns the ID of the service provider that owns this service
 org.uddi4j.datatype.service.BusinessService getUDDIBusinessService()
          Returns the UDDI business service object.
 java.lang.String getWSDLUrl(Protocol protocol)
          Returns the WSDL file for the service.
private  boolean isAccessPointType(org.uddi4j.datatype.binding.BindingTemplate template, Protocol protocol, java.lang.String accessPointType)
          This method checks the template to see if it describes the specified access point type.
 void removeAllCategories()
          Removes all the categories from the service provider.
 void removeCategory(Category category)
          Removes the category from the service if it exists.
 void removeFromServicesList(java.util.List uddiBusinessServices)
          Removes the service from the list of uddi4j business services.
private  void setAccessPointURL(Protocol protocol, java.lang.String accessPointType, java.lang.String url)
          sets the URL for the specified protocol access point
 void setAccessUrl(Protocol protocol, java.lang.String url)
          Sets the access url for the service.
 void setDescription(java.lang.String description)
          Sets the description of th service.
 void setName(java.lang.String name)
          Sets the name of this service.
 void setUDDIBusinessService(org.uddi4j.datatype.service.BusinessService businessService)
          Sets the UDDI business service object.
 void setWSDLUrl(Protocol protocol, java.lang.String url)
          Sets the WSDL file for the service.
private  boolean supportsProtocol(org.uddi4j.datatype.binding.BindingTemplate template, Protocol protocol)
          This method checks the template to see if it supports the specified protocol
 boolean supportsProtocol(Protocol protocol)
          This method checks the service to see if it supports the specified protocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_NAME_LENGTH

private static final int MAX_NAME_LENGTH
Stores a reference to the maximumn number of characters for the name field

See Also:
Constant Field Values

MAX_URL_LENGTH

private static final int MAX_URL_LENGTH
Stores a reference to the maximumn number of characters for the url field

See Also:
Constant Field Values

MAX_DESCRIPTION_LENGTH

private static final int MAX_DESCRIPTION_LENGTH
Stores a reference to the maximumn number of characters for the description field

See Also:
Constant Field Values

tModelManager

private TModelManager tModelManager
Stores a reference to the TModelManager that loads and initialises all the required TModels. It is expected to have already been initialised when it is used by this class


END_POINT

public static final java.lang.String END_POINT
Stores a reference to the binding template endpoint access type.
Note: This needs changing to 'endPoint' when moving to UDDI V3

See Also:
Constant Field Values

WSDL_POINT

public static final java.lang.String WSDL_POINT
Stores a reference to the binding template wsdl access type.
Note: This needs changing to 'wsdlDeployment' when moving to UDDI V3

See Also:
Constant Field Values

businessService

private org.uddi4j.datatype.service.BusinessService businessService
Stores a reference to the underlying business service object

Constructor Detail

BusinessService

public BusinessService(TModelManager tModelManager,
                       org.uddi4j.datatype.service.BusinessService service)
Constructor of the business service

Parameters:
tModelManager - The tmodel manager for the registry being accessed by this service
service - The actual UDDI Business Service
Method Detail

getUDDIBusinessService

public org.uddi4j.datatype.service.BusinessService getUDDIBusinessService()
Returns the UDDI business service object. This is not exposed on the interface to the caller and therefore should not be used outside of this framework.

Returns:
Returns the businessEntity.

setUDDIBusinessService

public void setUDDIBusinessService(org.uddi4j.datatype.service.BusinessService businessService)
Sets the UDDI business service object. This is not exposed on the interface to the caller and therefore should not be used outside of this framework.

Parameters:
businessService - The businessService to set.

getId

public java.lang.String getId()
Returns the uniquie id of this service.

Specified by:
getId in interface Service
Returns:
The service id.

getServiceProviderId

public java.lang.String getServiceProviderId()
Returns the ID of the service provider that owns this service

Specified by:
getServiceProviderId in interface Service
Returns:
The owning service provider ID

getName

public java.lang.String getName()
Returns the name of this service.

Specified by:
getName in interface Service
Returns:
The service name. An empty string will be returned if not found.

setName

public void setName(java.lang.String name)
             throws InvalidNameException,
                    InvalidLengthException
Sets the name of this service. This will only actually be applied when the service is updated with the registry via the service manager.

Specified by:
setName in interface Service
Parameters:
name - The name to set
Throws:
InvalidNameException
InvalidLengthException

getDescription

public java.lang.String getDescription()
Returns the description of the service.

Specified by:
getDescription in interface Service
Returns:
The business service name. An empty string will be returned if not found.

setDescription

public void setDescription(java.lang.String description)
                    throws InvalidLengthException
Sets the description of th service. This will only actually be applied when the service is updated with the registry via the service manager.

Specified by:
setDescription in interface Service
Parameters:
description - The description to set
Throws:
InvalidLengthException

getCategories

public java.util.List getCategories()
This method returns all the categories supported linked to the service. Some of these categories may represent categories outside of this toolkit but they are returned to allow the caller to remove them if they wish.

Specified by:
getCategories in interface Service
Returns:
A list of categories

addCategory

public void addCategory(Category category)
Adds a jafer defined category to the service if it does not already exist. This will only actually be applied when the service provider is updated with the registry via the service manager.

Specified by:
addCategory in interface Service
Parameters:
category - The category to add

removeCategory

public void removeCategory(Category category)
                    throws CategoryDoesNotExistException
Removes the category from the service if it exists. This will only actually be applied when the service provider is updated with the registry via the service manager.

Specified by:
removeCategory in interface Service
Parameters:
category - The category to delete
Throws:
CategoryDoesNotExistException

removeAllCategories

public void removeAllCategories()
Removes all the categories from the service provider. This will only actually be applied when the service provider is updated with the registry via the service manager.

Specified by:
removeAllCategories in interface Service

getAccessUrl

public java.lang.String getAccessUrl(Protocol protocol)
                              throws RegistryException
Returns the access url for the service. This can be used to connect to the actual service. This will only actually be applied when the service provider is updated with the registry via the service manager.

Specified by:
getAccessUrl in interface Service
Parameters:
protocol - The protocol type of the accesspoint to find
Returns:
The access point url. An empty string will be returned if not found.
Throws:
RegistryException

setAccessUrl

public void setAccessUrl(Protocol protocol,
                         java.lang.String url)
                  throws RegistryException,
                         InvalidLengthException
Sets the access url for the service. This can be used to connect to the actual service. This will only actually be applied when the service provider is updated with the registry via the service manager.

Specified by:
setAccessUrl in interface Service
Parameters:
protocol - The protocol type of the accesspoint to set
url - The url to the access point
Throws:
RegistryException
InvalidLengthException

getWSDLUrl

public java.lang.String getWSDLUrl(Protocol protocol)
                            throws RegistryException
Returns the WSDL file for the service. This describes the service and can also point to a connection point internally. This will only actually be applied when the service provider is updated with the registry via the service manager.

Specified by:
getWSDLUrl in interface Service
Parameters:
protocol - The protocol type of the accesspoint to find
Returns:
The wsdl url. An empty string will be returned if not found.
Throws:
RegistryException
RegistryException

setWSDLUrl

public void setWSDLUrl(Protocol protocol,
                       java.lang.String url)
                throws RegistryException,
                       InvalidLengthException
Sets the WSDL file for the service. This describes the service and can also point to a connection point internally. This will only actually be applied when the service provider is updated with the registry via the service manager.

Specified by:
setWSDLUrl in interface Service
Parameters:
url - The url to the access point to set
protocol - The protocol type of the accesspoint
Throws:
InvalidLengthException
RegistryException

supportsProtocol

public boolean supportsProtocol(Protocol protocol)
                         throws RegistryException
This method checks the service to see if it supports the specified protocol

Specified by:
supportsProtocol in interface Service
Parameters:
protocol - The protocol type of the accesspoint to set
Returns:
true if the template supports the protocol
Throws:
RegistryException

extractBusinessServiceInfos

public static java.util.List extractBusinessServiceInfos(TModelManager tModelManager,
                                                         java.util.List uddiBusinessServices)
This method returns all the business services for the business entity. This is not exposed on the interface to the caller and therefore should not be used outside of this framework.

Parameters:
tModelManager - The tmodel manager for the registry being accessed by this service
uddiBusinessServices - A list of uddi business service descriptions
Returns:
A list of ServiceInfo objects

addToServicesList

public void addToServicesList(java.util.List uddiBusinessServices)
Adds the service to the list of uddi4j business services. This is not exposed on the interface to the caller and therefore should not be used outside of this framework.

Parameters:
uddiBusinessServices - the list of uddi4j business services to add to

removeFromServicesList

public void removeFromServicesList(java.util.List uddiBusinessServices)
                            throws ServiceDoesNotExistException
Removes the service from the list of uddi4j business services. This is not exposed on the interface to the caller and therefore should not be used outside of this framework.

Parameters:
uddiBusinessServices - The list of uddi services to remove from
Throws:
ServiceDoesNotExistException

getAccessPointURL

private java.lang.String getAccessPointURL(Protocol protocol,
                                           java.lang.String accessPointType)
                                    throws RegistryException
Returns the URL for the specified protocol access point

Parameters:
protocol - the protocol to search under
accessPointType - The type of access point looking for
Returns:
The URL found
Throws:
RegistryException

setAccessPointURL

private void setAccessPointURL(Protocol protocol,
                               java.lang.String accessPointType,
                               java.lang.String url)
                        throws RegistryException
sets the URL for the specified protocol access point

Parameters:
protocol - the protocol to search under
accessPointType - The type of access point looking to set URL on
url - The URL to set
Throws:
RegistryException

isAccessPointType

private boolean isAccessPointType(org.uddi4j.datatype.binding.BindingTemplate template,
                                  Protocol protocol,
                                  java.lang.String accessPointType)
                           throws RegistryException
This method checks the template to see if it describes the specified access point type. A match is defined as the binding template decription and accesspoint url type having the same text as the accessPointType supplied
Note: This needs changing to just check the useType when moving to UDDI V3

Parameters:
template - The template to check
protocol - The protocol type of the accesspoint to set
accessPointType - The access point type to check for
Returns:
true if the template describes the specified access point type
Throws:
RegistryException

supportsProtocol

private boolean supportsProtocol(org.uddi4j.datatype.binding.BindingTemplate template,
                                 Protocol protocol)
                          throws RegistryException
This method checks the template to see if it supports the specified protocol

Parameters:
template - The template to check
protocol - The protocol type of the accesspoint to set
Returns:
true if the template supports the protocol
Throws:
RegistryException