org.jafer.registry.model
Interface ServiceProvider

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
BusinessEntity

public interface ServiceProvider
extends java.io.Serializable

This interface represents the service provider model support for JAFER.

Updates made using this interface will only be made to the registry when the service provider is updated through the service manager

Note: Be aware that the provider instance represents the details in the registry at the point in time of retrieval. When an update to the provider is made the information in the provider will replace any information in the registry and may cause other instances to no longer be up to date

Service provider instances should be strictly controlled and never cached by the caller to avoid becoming out of date with the registry. Updating outdated items will replace any changes made with the old values and may cause exceptions to be thrown if referenced objects have already been deleted in the registry


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.
 void removeAllCategories()
          Removes all the categories from the service provider.
 void removeAllServices()
          This method removes all the services.
 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 contact)
          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 url)
          Sets the home page for the service provider.
 void setName(java.lang.String name)
          Sets the name of the service provider.
 

Method Detail

getId

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

Returns:
The service id.

getName

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

Returns:
The service provider name. An empty string will be returned if not found.

setName

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

Parameters:
name - The name to set
Throws:
InvalidNameException
InvalidLengthException

getDescription

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

Returns:
The service provider description. An empty string will be returned if not found.

setDescription

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.

Parameters:
description - The description to set
Throws:
InvalidLengthException

getHomePage

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

Returns:
The url string to the home page. An empty string will be returned if not found.

setHomePage

void setHomePage(java.lang.String url)
                 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.

Parameters:
url - The url string to the home page
Throws:
InvalidLengthException

getContact

Contact getContact()
Get a COPY of the contact information for the service provider. If no contact information is found then null will be returned.

Returns:
Copy of the contact information or null if no contact assotiated

setContact

void setContact(Contact contact)
Set the contact information for the service provider. 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.

Parameters:
contact - The contact information

removeContact

void removeContact()
Removes the contact information for the service provider. This will only actually be applied when the service provider is updated with the registry via the service manager.


getCategories

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.

Returns:
A list of categories

addCategory

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.

Parameters:
category - The category to add

removeCategory

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.

Parameters:
category - The category to delete
Throws:
CategoryDoesNotExistException

removeAllCategories

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.


getServices

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.

Returns:
A list of ServiceInfo objects describing the known services

addService

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.

Parameters:
service - The service to add

removeService

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.

Parameters:
service - the service to remove
Throws:
ServiceDoesNotExistException

removeService

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.

Parameters:
serviceInfo - the serviceinfo of the service to remove
Throws:
ServiceDoesNotExistException

removeAllServices

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.