org.jafer.registry.model
Interface Service

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

public interface Service
extends java.io.Serializable

This interface represents the service model support for JAFER. Services can be added to a service provider to create their portfolio.

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

Note: Be aware that the service instance represents the details in the registry at the point in time of retrieval. When an update to the service 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 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 if it does not already exist.
 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
 java.lang.String getWSDLUrl(Protocol protocol)
          Returns the WSDL file for the service.
 void removeAllCategories()
          Removes all the categories from the service provider.
 void removeCategory(Category category)
          Removes the category from the service if it exists.
 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 setWSDLUrl(Protocol protocol, java.lang.String url)
          Sets the WSDL file for the service.
 boolean supportsProtocol(Protocol protocol)
          This method checks the service to see if it supports the specified protocol
 

Method Detail

getId

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

Returns:
The service id.

getServiceProviderId

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

Returns:
The owning service provider ID

getName

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

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

setName

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.

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

getDescription

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

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

setDescription

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.

Parameters:
description - The description to set
Throws:
InvalidLengthException

getCategories

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.

Returns:
A list of categories

addCategory

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.

Parameters:
category - The category to add

removeCategory

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.

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.


getAccessUrl

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.

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

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.

Parameters:
protocol - The protocol type of the accesspoint to set
url - The url to the access point. A blank string will remove the URL.
Throws:
RegistryException
InvalidLengthException

getWSDLUrl

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.

Parameters:
protocol - The protocol type of the accesspoint to find
Returns:
The wsdl file url. An empty string will be returned if not found.
Throws:
RegistryException

setWSDLUrl

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.

Parameters:
protocol - The protocol type of the accesspoint
url - The url to the access point to set. A blank string will remove the access point.
Throws:
RegistryException
InvalidLengthException

supportsProtocol

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

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