org.jafer.registry.uddi.model
Class BusinessEntity

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

public class BusinessEntity
extends java.lang.Object
implements ServiceProvider

This class implements a service provider 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.business.BusinessEntity businessEntity
          Stores a reference to the underlying business entity object
private static java.lang.String HOMEPAGE
          Stores a reference to the HOMEPAGE use type for discovery urls
private static int MAX_DESCRIPTION_LENGTH
          Stores a reference to the maximumn number of characters for the description field
private static int MAX_HOMEPAGE_LENGTH
          Stores a reference to the maximumn number of characters for the home page field
private static int MAX_NAME_LENGTH
          Stores a reference to the maximumn number of characters for the name field
private  TModelManager tModelManager
          Stores a reference to the TModelManager that loads and initialises all the required TModels.
 
Constructor Summary
BusinessEntity(TModelManager tModelManager, org.uddi4j.datatype.business.BusinessEntity entity)
          Constructor of the business entity
 
Method Summary
 void addCategory(Category category)
          Adds a jafer defined category to the service provider if it does not already exist.
 void addService(Service service)
          This method adds the service to the service provider.
 java.util.List getCategories()
          This method returns all the categories supported linked to the service provider.
 Contact getContact()
          Get a COPY of the contact information for the service provider.
 java.lang.String getDescription()
          Returns the description for the service provider.
 java.lang.String getHomePage()
          Returns the home page for the service provider.
 java.lang.String getId()
          Returns the uniquie id of this service provider.
 java.lang.String getName()
          Returns the name of the service provider.
 java.util.List getServices()
          This method returns all the know services for the service provider at the time of retrieval.
 org.uddi4j.datatype.business.BusinessEntity getUDDIBusinessEntity()
          Returns the UDDI business entity object.
 void removeAllCategories()
          Removes all the categories from the service provider.
 void removeAllServices()
          This method removes all the services.
 void removeAnyBadServiceKeys()
          If a service is not owned directly by the provider and has been deleted then the relationship to this provider is left in an invlid state.
 void removeCategory(Category category)
          Removes the category from the service provider if it exists.
 void removeContact()
          Removes the contact information for the service provider.
 void removeService(Service service)
          This method removes the service from the service provider.
 void removeService(ServiceInfo serviceInfo)
          This method removes the service from the service provider.
 void setContact(Contact newContact)
          Set the contact information for the service provider.
 void setDescription(java.lang.String description)
          Sets the description for the service provider.
 void setHomePage(java.lang.String newUrl)
          Sets the home page for the service provider.
 void setName(java.lang.String name)
          Sets the name for the service provider.
 void setUDDIBusinessEntity(org.uddi4j.datatype.business.BusinessEntity businessEntity)
          Sets the UDDI business entity object.
 
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_HOMEPAGE_LENGTH

private static final int MAX_HOMEPAGE_LENGTH
Stores a reference to the maximumn number of characters for the home page 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


HOMEPAGE

private static final java.lang.String HOMEPAGE
Stores a reference to the HOMEPAGE use type for discovery urls

See Also:
Constant Field Values

businessEntity

private org.uddi4j.datatype.business.BusinessEntity businessEntity
Stores a reference to the underlying business entity object

Constructor Detail

BusinessEntity

public BusinessEntity(TModelManager tModelManager,
                      org.uddi4j.datatype.business.BusinessEntity entity)
Constructor of the business entity

Parameters:
tModelManager - The tmodel manager for the registry being accessed by this provider
entity - The actual UDDI Business Entity
Method Detail

getId

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

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

getUDDIBusinessEntity

public org.uddi4j.datatype.business.BusinessEntity getUDDIBusinessEntity()
Returns the UDDI business entity 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.

setUDDIBusinessEntity

public void setUDDIBusinessEntity(org.uddi4j.datatype.business.BusinessEntity businessEntity)
Sets the UDDI business entity object. This is not exposed on the interface to the caller and therefore should not be used outside of this framework.

Parameters:
businessEntity - The businessEntity to set.

getName

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

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

setName

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

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

getDescription

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

Specified by:
getDescription in interface ServiceProvider
Returns:
The service provider description. An empty string will be returned if not found.

setDescription

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

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

getHomePage

public java.lang.String getHomePage()
Returns the home page for the service provider.

Specified by:
getHomePage in interface ServiceProvider
Returns:
The url string to the home page. An empty string will be returned if not found.

setHomePage

public void setHomePage(java.lang.String newUrl)
                 throws InvalidLengthException
Sets the home page for the service provider. This will only actually be applied when the service provider is updated with the registry via the service manager.

Specified by:
setHomePage in interface ServiceProvider
Parameters:
newUrl - The url string to the home page
Throws:
InvalidLengthException

getContact

public Contact getContact()
Get a COPY of the contact information for the service provider. This will relate to the first UDDI business entity contact details object. If no contact information is found then null will be returned.

Specified by:
getContact in interface ServiceProvider
Returns:
Copy of the contact information or null if no contact assotiated

setContact

public void setContact(Contact newContact)
Set the contact information for the service provider. This will relate to the first UDDI business entity contact details object. If it already exists it will be overwritten with this contact. This will only actually be applied when the service provider is updated with the registry via the service manager.

Specified by:
setContact in interface ServiceProvider
Parameters:
newContact - The contact information

removeContact

public void removeContact()
Removes the contact information for the service provider. This will relate to the first UDDI business entity contact details object. This will only actually be applied when the service provider is updated with the registry via the service manager.

Specified by:
removeContact in interface ServiceProvider

getCategories

public java.util.List getCategories()
This method returns all the categories supported linked to the service provider. 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 ServiceProvider
Returns:
A list of categories

addCategory

public void addCategory(Category category)
Adds a jafer defined category to the service provider 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 ServiceProvider
Parameters:
category - The category to add

removeCategory

public void removeCategory(Category category)
                    throws CategoryDoesNotExistException
Removes the category from the service provider 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 ServiceProvider
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 ServiceProvider

getServices

public java.util.List getServices()
This method returns all the know services for the service provider at the time of retrieval. ServiceInfo objects are returned that can be used to delete the service or to obtain the full detail odf the service through the service locator.

Specified by:
getServices in interface ServiceProvider
Returns:
A list of ServiceInfo objects describing the known services

addService

public void addService(Service service)
This method adds the service to the service provider. This will only actually be applied when the service provider is updated with the registry via the service manager.
Note: The service added must exist in the registry for the update to succeed.

Specified by:
addService in interface ServiceProvider
Parameters:
service - The service to add

removeService

public void removeService(Service service)
                   throws ServiceDoesNotExistException
This method removes the service from the service provider. This will only actually be applied when the service provider is updated with the registry via the service manager.
Note: Once the service provider has been updated by the service manager any instances of the service will no longer be valid and can not be added again later, instead it must be re-registered.

Specified by:
removeService in interface ServiceProvider
Parameters:
service - the service to remove
Throws:
ServiceDoesNotExistException

removeService

public void removeService(ServiceInfo serviceInfo)
                   throws ServiceDoesNotExistException
This method removes the service from the service provider. This will only actually be applied when the service provider is updated with the registry via the service manager.
Note: Once the service provider has been updated by the service manager any instances of the service will no longer be valid and can not be added again later, instead it must be re-registered.

Specified by:
removeService in interface ServiceProvider
Parameters:
serviceInfo - the serviceinfo of the service to remove
Throws:
ServiceDoesNotExistException

removeAllServices

public void removeAllServices()
This method removes all the services. This will only actually be applied when the service provider is updated with the registry via the service manager.

Specified by:
removeAllServices in interface ServiceProvider

removeAnyBadServiceKeys

public void removeAnyBadServiceKeys()
                             throws ServiceDoesNotExistException
If a service is not owned directly by the provider and has been deleted then the relationship to this provider is left in an invlid state. This method cleans the invalid services so that an update will be successful. This method will not cater for shared services that are deleted since this provider instance was retreieved. This is not exposed on the interface to the caller and therefore should not be used outside of this framework.

Throws:
ServiceDoesNotExistException