1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
/*******************************************************************************
* Copyright (c) 2010 Composent, Inc. and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Composent, Inc. - initial API and implementation
******************************************************************************/
package org.eclipse.ecf.server.generic;
import java.util.Map;
import org.eclipse.ecf.core.IContainer;
/**
* 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 {@link IContainer} instances...all of which are associated with a single
* hostname and port combination.
*
* @since 4.0
*/
public interface IGenericServerContainerGroupFactory {
public int DEFAULT_PORT = 3282;
/**
* @since 6.0
*/
public int DEFAULT_SECURE_PORT = 4282;
/**
* Create a new container group given a hostname, port, and a Map of default container properties.
* @param hostname the hostname associated with the new container group. Must not be <code>null</code>.
* @param port the port that the new container group will listen on (once {@link IGenericServerContainerGroup#startListening()}
* is called). Should be a valid tcp port, openable for listening by this process via {@link IGenericServerContainerGroup#startListening()}.
* @param defaultContainerProperties a Map of default properties passed to any IContainer instances created within the resulting group.
* @return new generic server container group. Will not return <code>null</code>.
* @throws GenericServerContainerGroupCreateException if a container group exists for the given hostname and port combination.
*
* @see IGenericServerContainerGroup
*/
public IGenericServerContainerGroup createContainerGroup(String hostname, int port, Map defaultContainerProperties) throws GenericServerContainerGroupCreateException;
/**
* Create a new container group given a hostname, and port.
* @param hostname the hostname associated with the new container group. Must not be <code>null</code>.
* @param port the port that the new container group will listen on (once {@link IGenericServerContainerGroup#startListening()}
* is called). Should be a valid tcp port, openable for listening by this process via {@link IGenericServerContainerGroup#startListening()}.
* @return new generic server container group. Will not return <code>null</code>.
* @throws GenericServerContainerGroupCreateException if a container group exists for the given hostname and port combination.
*
* @see IGenericServerContainerGroup
*/
public IGenericServerContainerGroup createContainerGroup(String hostname, int port) throws GenericServerContainerGroupCreateException;
/**
* Create a new container group given a hostname using the {@link #DEFAULT_PORT}.
* @param hostname the hostname associated with the new container group. Must not be <code>null</code>.
* @return new generic server container group. Will not return <code>null</code>.
* @throws GenericServerContainerGroupCreateException if a container group exists for the given hostname and port combination.
*
* @see IGenericServerContainerGroup
*/
public IGenericServerContainerGroup createContainerGroup(String hostname) throws GenericServerContainerGroupCreateException;
/**
* Get the container group associated with the given hostname and port.
* @param hostname the hostname associated with the new container group. Must not be <code>null</code>.
* @param port the port of the desired container group.
* @return the existing generic server container group associated with the given hostname and port. If no container group
* exists with the given hostname and port, <code>null</code> will be returned.
*
*/
public IGenericServerContainerGroup getContainerGroup(String hostname, int port);
/**
* Get all the container groups created by this container group factory.
* @return array of generic server container groups. Will not return <code>null</code>, but
* may return empty array if no generic server container groups have been created by this factory.
*/
public IGenericServerContainerGroup[] getContainerGroups();
/**
* Remove the container group with the given hostname and port.
*
* @param hostname the hostname of the container group to remove. Must not be <code>null</code>.
* @param port the port of the desired container group.
* @return generic server container group removed. If no container group exists for this factory, then
* nothing was actually removed, and <code>null</code> will be returned.
*
* @see #getContainerGroup(String, int)
*/
public IGenericServerContainerGroup removeContainerGroup(String hostname, int port);
/**
* @since 6.0
*/
public boolean isSecureTransport();
}
|