KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > messenger > ConnectionManager


1 /**
2  * $RCSfile: ConnectionManager.java,v $
3  * $Revision: 1.7 $
4  * $Date: 2005/07/03 20:55:39 $
5  *
6  * Copyright (C) 2004 Jive Software. All rights reserved.
7  *
8  * This software is published under the terms of the GNU Public License (GPL),
9  * a copy of which is included in this distribution.
10  */

11
12 package org.jivesoftware.messenger;
13
14 import java.net.Socket JavaDoc;
15 import java.util.Iterator JavaDoc;
16 import org.xmlpull.v1.XmlPullParserException;
17
18 /**
19  * Coordinates connections (accept, read, termination) on the server.
20  *
21  * @author Iain Shigeoka
22  */

23 public interface ConnectionManager {
24
25     /**
26      * Returns an array of the ports managed by this connection manager.
27      *
28      * @return an iterator of the ports managed by this connection manager
29      * (can be an empty but never null).
30      */

31     public Iterator JavaDoc<ServerPort> getPorts();
32
33     /**
34      * Adds a socket to be managed by the connection manager.
35      *
36      * @param socket the socket to add to this manager for management.
37      * @param isSecure true if the connection is secure.
38      * @param serverPort holds information about the port on which the server is listening for
39      * connections.
40      */

41     public void addSocket(Socket JavaDoc socket, boolean isSecure, ServerPort serverPort)
42             throws XmlPullParserException;
43
44     /**
45      * Sets if the port listener for unsecured clients will be available or not. When disabled
46      * there won't be a port listener active. Therefore, new clients won't be able to connect to
47      * the server.
48      *
49      * @param enabled true if new unsecured clients will be able to connect to the server.
50      */

51     public void enableClientListener(boolean enabled);
52
53     /**
54      * Returns true if the port listener for unsecured clients is available. When disabled
55      * there won't be a port listener active. Therefore, new clients won't be able to connect to
56      * the server.
57      *
58      * @return true if the port listener for unsecured clients is available.
59      */

60     public boolean isClientListenerEnabled();
61
62     /**
63      * Sets if the port listener for secured clients will be available or not. When disabled
64      * there won't be a port listener active. Therefore, new secured clients won't be able to
65      * connect to the server.
66      *
67      * @param enabled true if new secured clients will be able to connect to the server.
68      */

69     public void enableClientSSLListener(boolean enabled);
70
71     /**
72      * Returns true if the port listener for secured clients is available. When disabled
73      * there won't be a port listener active. Therefore, new secured clients won't be able to
74      * connect to the server.
75      *
76      * @return true if the port listener for unsecured clients is available.
77      */

78     public boolean isClientSSLListenerEnabled();
79
80     /**
81      * Sets if the port listener for external components will be available or not. When disabled
82      * there won't be a port listener active. Therefore, new external components won't be able to
83      * connect to the server.
84      *
85      * @param enabled true if new external components will be able to connect to the server.
86      */

87     public void enableComponentListener(boolean enabled);
88
89     /**
90      * Returns true if the port listener for external components is available. When disabled
91      * there won't be a port listener active. Therefore, new external components won't be able to
92      * connect to the server.
93      *
94      * @return true if the port listener for external components is available.
95      */

96     public boolean isComponentListenerEnabled();
97
98     /**
99      * Sets if the port listener for remote servers will be available or not. When disabled
100      * there won't be a port listener active. Therefore, new remote servers won't be able to
101      * connect to the server.
102      *
103      * @param enabled true if new remote servers will be able to connect to the server.
104      */

105     public void enableServerListener(boolean enabled);
106
107     /**
108      * Returns true if the port listener for remote servers is available. When disabled
109      * there won't be a port listener active. Therefore, new remote servers won't be able to
110      * connect to the server.
111      *
112      * @return true if the port listener for remote servers is available.
113      */

114     public boolean isServerListenerEnabled();
115
116     /**
117      * Sets the port to use for unsecured clients. Default port: 5222.
118      *
119      * @param port the port to use for unsecured clients.
120      */

121     public void setClientListenerPort(int port);
122
123     /**
124      * Returns the port to use for unsecured clients. Default port: 5222.
125      *
126      * @return the port to use for unsecured clients.
127      */

128     public int getClientListenerPort();
129
130     /**
131      * Sets the port to use for secured clients. Default port: 5223.
132      *
133      * @param port the port to use for secured clients.
134      */

135     public void setClientSSLListenerPort(int port);
136
137     /**
138      * Returns the port to use for secured clients. Default port: 5223.
139      *
140      * @return the port to use for secured clients.
141      */

142     public int getClientSSLListenerPort();
143
144     /**
145      * Sets the port to use for external components.
146      *
147      * @param port the port to use for external components.
148      */

149     public void setComponentListenerPort(int port);
150
151     /**
152      * Returns the port to use for external components.
153      *
154      * @return the port to use for external components.
155      */

156     public int getComponentListenerPort();
157
158     /**
159      * Sets the port to use for remote servers. This port is used for remote servers to connect
160      * to this server. Default port: 5269.
161      *
162      * @param port the port to use for remote servers.
163      */

164     public void setServerListenerPort(int port);
165
166     /**
167      * Returns the port to use for remote servers. This port is used for remote servers to connect
168      * to this server. Default port: 5269.
169      *
170      * @return the port to use for remote servers.
171      */

172     public int getServerListenerPort();
173 }
174
Popular Tags