org.eclipse.ecf.server.generic
Interface IGenericServerContainerGroupFactory


public interface IGenericServerContainerGroupFactory

Generic server container group factory service. This service interface defines the contract for dynamically creating ECF generic server container groups for a given hostname and port. A container group is a set of IContainer instances...all of which are associated with a single hostname and port combination.

Since:
4.0

Field Summary
static int DEFAULT_PORT
           
 
Method Summary
 IGenericServerContainerGroup createContainerGroup(java.lang.String hostname)
          Create a new container group given a hostname using the DEFAULT_PORT.
 IGenericServerContainerGroup createContainerGroup(java.lang.String hostname, int port)
          Create a new container group given a hostname, and port.
 IGenericServerContainerGroup createContainerGroup(java.lang.String hostname, int port, java.util.Map defaultContainerProperties)
          Create a new container group given a hostname, port, and a Map of default container properties.
 IGenericServerContainerGroup getContainerGroup(java.lang.String hostname, int port)
          Get the container group associated with the given hostname and port.
 IGenericServerContainerGroup[] getContainerGroups()
          Get all the container groups created by this container group factory.
 IGenericServerContainerGroup removeContainerGroup(java.lang.String hostname, int port)
          Remove the container group with the given hostname and port.
 

Field Detail

DEFAULT_PORT

static final int DEFAULT_PORT
See Also:
Constant Field Values
Method Detail

createContainerGroup

IGenericServerContainerGroup createContainerGroup(java.lang.String hostname,
                                                  int port,
                                                  java.util.Map defaultContainerProperties)
                                                  throws GenericServerContainerGroupCreateException
Create a new container group given a hostname, port, and a Map of default container properties.

Parameters:
hostname - the hostname associated with the new container group. Must not be null.
port - the port that the new container group will listen on (once IGenericServerContainerGroup.startListening() is called). Should be a valid tcp port, openable for listening by this process via IGenericServerContainerGroup.startListening().
defaultContainerProperties - a Map of default properties passed to any IContainer instances created within the resulting group.
Returns:
new generic server container group. Will not return null.
Throws:
GenericServerContainerGroupCreateException - if a container group exists for the given hostname and port combination.
See Also:
IGenericServerContainerGroup

createContainerGroup

IGenericServerContainerGroup createContainerGroup(java.lang.String hostname,
                                                  int port)
                                                  throws GenericServerContainerGroupCreateException
Create a new container group given a hostname, and port.

Parameters:
hostname - the hostname associated with the new container group. Must not be null.
port - the port that the new container group will listen on (once IGenericServerContainerGroup.startListening() is called). Should be a valid tcp port, openable for listening by this process via IGenericServerContainerGroup.startListening().
Returns:
new generic server container group. Will not return null.
Throws:
GenericServerContainerGroupCreateException - if a container group exists for the given hostname and port combination.
See Also:
IGenericServerContainerGroup

createContainerGroup

IGenericServerContainerGroup createContainerGroup(java.lang.String hostname)
                                                  throws GenericServerContainerGroupCreateException
Create a new container group given a hostname using the DEFAULT_PORT.

Parameters:
hostname - the hostname associated with the new container group. Must not be null.
Returns:
new generic server container group. Will not return null.
Throws:
GenericServerContainerGroupCreateException - if a container group exists for the given hostname and port combination.
See Also:
IGenericServerContainerGroup

getContainerGroup

IGenericServerContainerGroup getContainerGroup(java.lang.String hostname,
                                               int port)
Get the container group associated with the given hostname and port.

Parameters:
hostname - the hostname associated with the new container group. Must not be null.
port - the port of the desired container group.
Returns:
the existing generic server container group associated with the given hostname and port. If no container group exists with the given hostname and port, null will be returned.

getContainerGroups

IGenericServerContainerGroup[] getContainerGroups()
Get all the container groups created by this container group factory.

Returns:
array of generic server container groups. Will not return null, but may return empty array if no generic server container groups have been created by this factory.

removeContainerGroup

IGenericServerContainerGroup removeContainerGroup(java.lang.String hostname,
                                                  int port)
Remove the container group with the given hostname and port.

Parameters:
hostname - the hostname of the container group to remove. Must not be null.
port - the port of the desired container group.
Returns:
generic server container group removed. If no container group exists for this factory, then nothing was actually removed, and null will be returned.
See Also:
getContainerGroup(String, int)