org.jboss.services.binding
Interface ServiceBindingStore

All Known Implementing Classes:
PojoServiceBindingStore

public interface ServiceBindingStore

SPI through which ServiceBindingManager interacts with a store of service binding metadata.

Version:
$Revision: 82920 $
Author:
Mike Finn., Scott.Stark@jboss.org, Brian Stansberry

Method Summary
 void addServiceBinding(String serverName, ServiceBindingMetadata binding)
          Add a ServiceBinding to the store for the given serverName.
 String getDefaultHostName(String serverName)
          Gets the default value to use as the host name for the given serverName.
 int getDefaultPortOffset(String serverName)
          Gets the offset from a base value that by default should be added to port values for a given serverName.
 ServiceBinding getServiceBinding(String serverName, String serviceName, String bindingName)
          Obtain a ServiceBinding object for the given server name, target service and binding name.
 Set<ServiceBinding> getServiceBindings(String serverName)
          Gets all service bindings for the given server name.
 void removeServiceBinding(String serverName, ServiceBindingMetadata binding)
          Remove a ServiceBinding from the store for the given serverName.
 

Method Detail

getServiceBinding

ServiceBinding getServiceBinding(String serverName,
                                 String serviceName,
                                 String bindingName)
                                 throws NoSuchBindingException
Obtain a ServiceBinding object for the given server name, target service and binding name.

Parameters:
serverName - the name identifying the server instance in which the service is running.
serviceName - the name of the service
bindingName - the name of the binding, or null to indicate the default binding.
Returns:
the ServiceBinding if one exists for the tuple.
Throws:
NoSuchBindingException - if no matching binding exists
IllegalArgumentException - if serverName is unknown to the store.

getServiceBindings

Set<ServiceBinding> getServiceBindings(String serverName)
Gets all service bindings for the given server name.

Parameters:
serverName - the name identifying the server instance in which the service is running. Cannot be null.
Returns:
the set of service bindings for the server name. Will not be null.
Throws:
IllegalArgumentException - if serverName is unknown to the store.

addServiceBinding

void addServiceBinding(String serverName,
                       ServiceBindingMetadata binding)
                       throws DuplicateServiceException,
                              UnknownHostException
Add a ServiceBinding to the store for the given serverName.

Parameters:
serverName - the name identifying the JBoss server instance in which the service is running.
binding - metadata for the binding to add
Throws:
DuplicateServiceException - thrown if a configuration for the pair already exists.
UnknownHostException - if the host specified by the metadata is unknown
IllegalArgumentException - if serverName is unknown to the store.

removeServiceBinding

void removeServiceBinding(String serverName,
                          ServiceBindingMetadata binding)
Remove a ServiceBinding from the store for the given serverName.

Parameters:
serverName - the name identifying the JBoss server instance in which the service is running.
binding - the binding
Throws:
IllegalArgumentException - if serverName is unknown to the store.

getDefaultPortOffset

int getDefaultPortOffset(String serverName)
Gets the offset from a base value that by default should be added to port values for a given serverName.

Parameters:
serverName - the name of the binding set
Returns:
the offset
Throws:
IllegalArgumentException - if serverName is unknown to the store.

getDefaultHostName

String getDefaultHostName(String serverName)
Gets the default value to use as the host name for the given serverName.

Parameters:
serverName - the name of the binding set
Returns:
the host name
Throws:
IllegalArgumentException - if serverName is unknown to the store.


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.