Commit 2386574f authored by Alex Wenckus's avatar Alex Wenckus Committed by alex

First crack at HttpBind integration inside of Wildfire

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/branches@5728 b35dd754-fafc-0310-a699-88a17e54d16e
parent 054bc06b
Name | Version
---------------------------------------------
ant.jar | Jetty 5.1.10
ant.jar | Jetty 6.1.0 (1.6.5)
ant-contrib.jar | 1.0b1
ant-subdirtask.jar | Revision 1.4 (CVS)
bouncycastle.jar | JDK 1.5, 133 (bcprov-jdk15-133.jar)
commons-logging.jar | Jetty 5.1.10
commons-el.jar | Jetty 5.1.10
commons-el.jar | Jetty 6.1.0 (1.0)
commons-httpclient.jar | 3.0
commons-codec.jar | 1.3
dom4j.jar | 1.6.1
hsqldb.jar | 1.8.0.5
jetty.jar | Jetty 5.1.10
jasper-compiler.jar | Jetty 5.1.10
jasper-runtime.jar | Jetty 5.1.10
jetty.jar | Jetty 6.1.0
jetty-util.jar | Jetty 6.1.0
jasper-compiler.jar | Jetty 6.1.0 (5.5.15)
jasper-runtime.jar | Jetty 6.1.0 (5.5.15)
jaxen.jar | 1.1 beta 4 (from DOM4J 1.6.1)
junit.jar | 3.8.1
jdic.jar | 0.9.1 (for windows only)
......@@ -23,7 +24,7 @@ jzlib.jar | 1.0.7
mysql.jar | 3.1.13
pack200task.jar | August 5, 2004
postgres.jar | 8.1-404 JDBC 3
servlet.jar | Jetty 5.1.10
servlet.jar | Jetty 6.1.0 (2.5)
shaj.jar | 0.5
sitemesh.jar | 2.2.1
standard.jar | Jakarta standard taglib 1.1.2
......
/**
* $RCSfile: $
* $Revision: $
* $Date: $
*
* Copyright (C) 2006 Jive Software. All rights reserved.
* This software is the proprietary information of Jive Software. Use is subject to license terms.
*/
package org.jivesoftware.wildfire.http;
/**
*
*/
public class HttpBindException extends Exception {
private boolean shouldCloseSession;
private int httpError;
public HttpBindException(String message, boolean shouldCloseSession, int httpError) {
super(message);
this.shouldCloseSession = shouldCloseSession;
this.httpError = httpError;
}
public int getHttpError() {
return httpError;
}
public boolean shouldCloseSession() {
return shouldCloseSession;
}
}
/**
* $RCSfile$
* $Revision: $
* $Date: $
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.wildfire.http;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Handler;
import org.mortbay.jetty.security.SslSocketConnector;
import org.mortbay.jetty.servlet.ServletHolder;
import org.mortbay.jetty.servlet.ServletHandler;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.net.SSLConfig;
import javax.net.ssl.SSLServerSocketFactory;
/**
* Manages connections to the server which use the HTTP Bind protocol specified in <a
* href="http://www.xmpp.org/extensions/xep-0124.html">XEP-0124</a>. The manager maps a servlet to
* an embedded servlet container using the ports provided in the constructor.
*
* @author Alexander Wenckus
*/
public class HttpBindManager {
private int plainPort;
private int sslPort;
private Server server;
private String serverName;
public HttpBindManager(String serverName, int plainPort, int sslPort) {
this.plainPort = plainPort;
this.sslPort = sslPort;
this.server = new Server();
this.serverName = serverName;
}
/**
* Starts the HTTP Bind service.
*
* @throws Exception if there is an error starting up the server.
*/
public void startup() throws Exception {
for(Connector connector : createConnectors()) {
server.addConnector(connector);
}
server.addHandler(createServletHandler());
server.start();
}
private Handler createServletHandler() {
ServletHolder servletHolder = new ServletHolder(
new HttpBindServlet(new HttpSessionManager(serverName)));
ServletHandler servletHandler = new ServletHandler();
servletHandler.addServletWithMapping(servletHolder, "/");
return servletHandler;
}
private Connector[] createConnectors() {
SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(plainPort);
if (sslPort > 0) {
try {
SslSocketConnector secureConnector = new JiveSslConnector();
secureConnector.setPort(sslPort);
secureConnector.setTrustPassword(SSLConfig.getTrustPassword());
secureConnector.setTruststoreType(SSLConfig.getStoreType());
secureConnector.setTruststore(SSLConfig.getTruststoreLocation());
secureConnector.setNeedClientAuth(false);
secureConnector.setWantClientAuth(false);
secureConnector.setKeyPassword(SSLConfig.getKeyPassword());
secureConnector.setKeystoreType(SSLConfig.getStoreType());
secureConnector.setKeystore(SSLConfig.getKeystoreLocation());
return new Connector[]{connector, secureConnector};
}
catch (Exception ex) {
Log.error("Error establishing SSL connector for HTTP Bind", ex);
}
}
return new Connector[]{connector};
}
/**
* Shutdown the HTTP Bind service, freeing any related resources.
*
* @throws Exception if there is an error shutting down the service.
*/
public void shutdown() throws Exception {
server.stop();
}
private class JiveSslConnector extends SslSocketConnector {
@Override
protected SSLServerSocketFactory createFactory() throws Exception {
return SSLConfig.getServerSocketFactory();
}
}
}
/**
* $RCSfile$
* $Revision: $
* $Date: $
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.wildfire.http;
import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlPullParserException;
import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.net.MXParser;
import org.dom4j.io.XMPPPacketReader;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.mortbay.util.ajax.ContinuationSupport;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;
/**
* Handles requests to the HTTP Bind service.
*
* @author Alexander Wenckus
*/
public class HttpBindServlet extends HttpServlet {
private HttpSessionManager sessionManager;
private static XmlPullParserFactory factory;
static {
try {
factory = XmlPullParserFactory.newInstance(MXParser.class.getName(), null);
}
catch (XmlPullParserException e) {
Log.error("Error creating a parser factory", e);
}
}
HttpBindServlet(HttpSessionManager sessionManager) {
this.sessionManager = sessionManager;
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
if (isContinuation(request, response)) {
return;
}
Document document;
try {
document = createDocument(request);
}
catch (Exception e) {
Log.warn("Error parsing user request. [" + request.getRemoteAddr() + "]");
response.sendError(HttpServletResponse.SC_BAD_REQUEST,
"Unable to parse request content: " + e.getMessage());
return;
}
Element node = document.getRootElement();
if (node == null || !"body".equals(node.getName())) {
Log.warn("Body missing from request content. [" + request.getRemoteAddr() + "]");
response.sendError(HttpServletResponse.SC_BAD_REQUEST,
"Body missing from request content.");
return;
}
String sid = node.attributeValue("sid");
// We have a new session
if (sid == null) {
createNewSession(request, response, node);
}
else {
handleSessionRequest(sid, request, response, node);
}
}
private boolean isContinuation(HttpServletRequest request, HttpServletResponse response)
throws IOException
{
HttpConnection connection = (HttpConnection) request.getAttribute("request-connection");
if (connection == null) {
return false;
}
respond(response, connection);
return true;
}
private void handleSessionRequest(String sid, HttpServletRequest request,
HttpServletResponse response, Element rootNode)
throws IOException
{
long rid = getLongAttribue(rootNode.attributeValue("rid"), -1);
if (rid <= 0) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Body missing RID (Request ID)");
return;
}
HttpSession session = sessionManager.getSession(sid);
if (session == null) {
Log.warn("Client provided invalid session: " + sid + ". [" +
request.getRemoteAddr() + "]");
response.sendError(HttpServletResponse.SC_NOT_FOUND, "Invalid SID.");
return;
}
synchronized (session) {
HttpConnection connection;
try {
connection = sessionManager.forwardRequest(rid, session,
request.isSecure(), rootNode);
}
catch (HttpBindException e) {
response.sendError(e.getHttpError(), e.getMessage());
if(e.shouldCloseSession()) {
session.close();
}
return;
}
catch (HttpConnectionClosedException nc) {
Log.error("Error sending packet to client.", nc);
return;
}
connection.setContinuation(ContinuationSupport.getContinuation(request, connection));
request.setAttribute("request-connection", connection);
respond(response, connection);
}
}
private void createNewSession(HttpServletRequest request, HttpServletResponse response,
Element rootNode)
throws IOException
{
long rid = getLongAttribue(rootNode.attributeValue("rid"), -1);
if (rid <= 0) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Body missing RID (Request ID)");
return;
}
HttpConnection connection = new HttpConnection(rid, request.isSecure());
connection.setSession(sessionManager.createSession(rootNode, connection));
respond(response, connection);
}
private void respond(HttpServletResponse response, HttpConnection connection)
throws IOException
{
byte[] content;
try {
content = connection.getDeliverable().getBytes("utf-8");
}
catch (HttpBindTimeoutException e) {
content = createEmptyBody().getBytes("utf-8");
}
response.setStatus(HttpServletResponse.SC_OK);
response.setContentType("text/xml");
response.setCharacterEncoding("utf-8");
response.setContentLength(content.length);
response.getOutputStream().write(content);
}
private String createEmptyBody() {
return "<body xmlns='http://jabber.org/protocol/httpbind'/>";
}
private long getLongAttribue(String value, long defaultValue) {
if (value == null || "".equals(value)) {
return defaultValue;
}
try {
return Long.valueOf(value);
}
catch (Exception ex) {
return defaultValue;
}
}
private Document createDocument(HttpServletRequest request) throws
DocumentException, IOException, XmlPullParserException {
// Reader is associated with a new XMPPPacketReader
XMPPPacketReader reader = new XMPPPacketReader();
reader.setXPPFactory(factory);
return reader.read(request.getInputStream());
}
}
/**
* $RCSfile$
* $Revision: $
* $Date: $
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.wildfire.http;
/**
* An exception which indicates that the maximum waiting time for a client response has been
* surpassed and an empty response should be returned to the requesting client.
*
* @author Alexander Wenckus
*/
class HttpBindTimeoutException extends Exception {
public HttpBindTimeoutException(String message) {
super(message);
}
public HttpBindTimeoutException() {
super();
}
}
/**
* $RCSfile: $
* $Revision: $
* $Date: $
*
* Copyright (C) 2006 Jive Software. All rights reserved.
* This software is the proprietary information of Jive Software. Use is subject to license terms.
*/
package org.jivesoftware.wildfire.http;
import org.jivesoftware.wildfire.Connection;
import org.mortbay.util.ajax.Continuation;
/**
* A connection to a client. The client will wait on getDeliverable() until the server forwards a
* message to it or the wait time on the session timesout.
*
* @author Alexander Wenckus
*/
public class HttpConnection {
private Connection.CompressionPolicy compressionPolicy;
private long requestId;
private String body;
private HttpSession session;
private Continuation continuation;
private boolean isClosed;
private boolean isSecure = false;
public HttpConnection(long requestId, boolean isSecure) {
this.requestId = requestId;
this.isSecure = isSecure;
}
public boolean validate() {
return false;
}
/**
* The connection should be closed without delivering a stanza to the requestor.
*/
public void close() {
if (isClosed) {
return;
}
try {
deliverBody(null);
}
catch (HttpConnectionClosedException e) {
/* Shouldn't happen */
}
}
public boolean isClosed() {
return isClosed;
}
public boolean isSecure() {
return isSecure;
}
/**
* Delivers content to the client. The content should be valid XMPP wrapped inside of a body.
* A <i>null</i> value for body indicates that the connection should be closed and the client
* sent an empty body.
*
* @param body the XMPP content to be forwarded to the client inside of a body tag.
*
* @throws HttpConnectionClosedException when this connection to the client has already recieved
* a deliverable to forward to the client
*/
public void deliverBody(String body) throws HttpConnectionClosedException {
// We only want to use this function once so we will close it when the body is delivered.
if (isClosed) {
throw new HttpConnectionClosedException("The http connection is no longer " +
"available to deliver content");
}
else {
isClosed = true;
}
if (continuation != null) {
continuation.setObject(body);
continuation.resume();
}
else {
this.body = body;
}
}
/**
* A call that will cause a wait, or in the case of Jetty the thread to be freed, if there is no
* deliverable currently available. Once the deliverable becomes available it is returned.
*
* @return the deliverable to send to the client
*
* @throws HttpBindTimeoutException to indicate that the maximum wait time requested by the
* client has been surpassed and an empty response should be returned.
*/
public String getDeliverable() throws HttpBindTimeoutException {
if (body == null && continuation != null) {
body = waitForDeliverable();
}
else if (body == null && continuation == null) {
throw new IllegalStateException("Continuation not set, cannot wait for deliverable.");
}
return body;
}
private String waitForDeliverable() throws HttpBindTimeoutException {
if (continuation.suspend(session.getWait() * 1000)) {
String deliverable = (String) continuation.getObject();
// This will occur when the hold attribute of a session has been exceded.
if (deliverable == null) {
throw new HttpBindTimeoutException();
}
return deliverable;
}
throw new HttpBindTimeoutException("Request " + requestId + " exceded response time from " +
"server of " + session.getWait() + " seconds.");
}
public boolean isCompressed() {
return false;
}
public Connection.CompressionPolicy getCompressionPolicy() {
return compressionPolicy;
}
public void setCompressionPolicy(Connection.CompressionPolicy compressionPolicy) {
this.compressionPolicy = compressionPolicy;
}
public long getRequestId() {
return requestId;
}
/**
* Set the session that this connection belongs to.
*
* @param session the session that this connection belongs to.
*/
void setSession(HttpSession session) {
this.session = session;
}
/**
* Returns the session that this connection belongs to.
*
* @return the session that this connection belongs to.
*/
public HttpSession getSession() {
return session;
}
void setContinuation(Continuation continuation) {
this.continuation = continuation;
}
}
/**
* $RCSfile$
* $Revision: $
* $Date: $
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.wildfire.http;
/**
* This exception is thrown when an action attempted on the connection to the client but the
* connection has been closed.
*
* @author Alexander Wenckus
*/
public class HttpConnectionClosedException extends Exception {
public HttpConnectionClosedException(String message) {
super(message);
}
}
/**
* $RCSfile$
* $Revision: $
* $Date: $
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.wildfire.http;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.multiplexer.ServerSurrogate;
import org.jivesoftware.multiplexer.ConnectionManager;
import org.jivesoftware.multiplexer.Session;
import org.jivesoftware.wildfire.SessionManager;
import org.jivesoftware.wildfire.ConnectionManager;
import org.jivesoftware.wildfire.Session;
import org.jivesoftware.wildfire.StreamID;
import org.dom4j.Element;
import java.util.*;
/**
*
*/
public class HttpSessionManager {
/**
* Milliseconds a connection has to be idle to be closed. Default is 30 minutes. Sending
* stanzas to the client is not considered as activity. We are only considering the connection
* active when the client sends some data or hearbeats (i.e. whitespaces) to the server.
* The reason for this is that sending data will fail if the connection is closed. And if
* the thread is blocked while sending data (because the socket is closed) then the clean up
* thread will close the socket anyway.
*/
private static int inactivityTimeout;
/**
* The connection manager MAY limit the number of simultaneous requests the client makes with
* the 'requests' attribute. The RECOMMENDED value is "2". Servers that only support polling
* behavior MUST prevent clients from making simultaneous requests by setting the 'requests'
* attribute to a value of "1" (however, polling is NOT RECOMMENDED). In any case, clients MUST
* NOT make more simultaneous requests than specified by the connection manager.
*/
private static int maxRequests;
/**
* The connection manager SHOULD include two additional attributes in the session creation
* response element, specifying the shortest allowable polling interval and the longest
* allowable inactivity period (both in seconds). Communication of these parameters enables
* the client to engage in appropriate behavior (e.g., not sending empty request elements more
* often than desired, and ensuring that the periods with no requests pending are
* never too long).
*/
private static int pollingInterval;
private String serverName;
private InactivityTimer timer = new InactivityTimer();
private SessionManager sessionManager;
private Map<String, HttpSession> sessionMap = new HashMap<String, HttpSession>();
static {
// Set the default read idle timeout. If none was set then assume 30 minutes
inactivityTimeout = JiveGlobals.getIntProperty("xmpp.httpbind.client.idle", 30);
maxRequests = JiveGlobals.getIntProperty("xmpp.httpbind.client.requests.max", 2);
pollingInterval = JiveGlobals.getIntProperty("xmpp.httpbind.client.requests.polling", 5);
}
public HttpSessionManager(String serverName) {
this.serverName = serverName;
this.sessionManager = SessionManager.getInstance();
}
public HttpSession getSession(String streamID) {
return sessionMap.get(streamID);
}
public HttpSession createSession(Element rootNode, HttpConnection connection) {
// TODO Check if IP address is allowed to connect to the server
// Default language is English ("en").
String language = rootNode.attributeValue("xml:lang");
if(language == null || "".equals(language)) {
language = "en";
}
int wait = getIntAttribute(rootNode.attributeValue("wait"), 60);
int hold = getIntAttribute(rootNode.attributeValue("hold"), 1);
// Indicate the compression policy to use for this connection
connection.setCompressionPolicy(serverSurrogate.getCompressionPolicy());
HttpSession session = createSession(serverName);
session.setWait(wait);
session.setHold(hold);
session.setSecure(connection.isSecure());
session.setMaxPollingInterval(pollingInterval);
session.setInactivityTimeout(inactivityTimeout);
// Store language and version information in the connection.
session.setLanaguage(language);
try {
connection.deliverBody(createSessionCreationResponse(session));
}
catch (HttpConnectionClosedException e) {
/* This won't happen here. */
}
timer.reset(session);
return session;
}
private HttpSession createSession(String serverName) {
// Create a ClientSession for this user.
StreamID streamID = SessionManager.getInstance().nextStreamID();
HttpSession session = new HttpSession(serverName, streamID);
// Register that the new session is associated with the specified stream ID
sessionMap.put(streamID.getID(), session);
// Send to the server that a new client session has been created
serverSurrogate.clientSessionCreated(streamID);
session.addSessionCloseListener(new SessionListener() {
public void connectionOpened(HttpSession session, HttpConnection connection) {
if (session instanceof HttpSession) {
timer.stop((HttpSession) session);
}
}
public void connectionClosed(HttpSession session, HttpConnection connection) {
if(session instanceof HttpSession) {
HttpSession http = (HttpSession) session;
if(http.getConnectionCount() <= 0) {
timer.reset(http);
}
}
}
public void sessionClosed(HttpSession session) {
sessionMap.remove(session.getStreamID());
timer.stop(session);
serverSurrogate.clientSessionClosed(session.getStreamID());
}
});
return session;
}
private static int getIntAttribute(String value, int defaultValue) {
if(value == null || "".equals(value)) {
return defaultValue;
}
try {
return Integer.valueOf(value);
}
catch (Exception ex) {
return defaultValue;
}
}
private String createSessionCreationResponse(HttpSession session) {
StringBuilder builder = new StringBuilder();
builder.append("<body")
.append(" xmlns='http://jabber.org/protocol/httpbind'").append(" authID='")
.append(session.getStreamID()).append("'")
.append(" sid='").append(session.getStreamID()).append("'")
.append(" secure='true" + "'").append(" requests='")
.append(String.valueOf(maxRequests)).append("'")
.append(" inactivity='").append(String.valueOf(session.getInactivityTimeout()))
.append("'")
.append(" polling='").append(String.valueOf(pollingInterval)).append("'")
.append(" wait='").append(String.valueOf(session.getWait())).append("'")
.append(">");
builder.append("<stream:features>");
builder.append(serverSurrogate.getSASLMechanismsElement(session).asXML());
builder.append("<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>");
builder.append("<session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\"/>");
builder.append("</stream:features>");
builder.append("</body>");
return builder.toString();
}
public HttpConnection forwardRequest(long rid, HttpSession session, boolean isSecure,
Element rootNode) throws HttpBindException,
HttpConnectionClosedException
{
//noinspection unchecked
List<Element> elements = rootNode.elements();
boolean isPoll = elements.size() <= 0;
HttpConnection connection = new HttpConnection(rid, isSecure);
session.addConnection(connection, isPoll);
for (Element packet : elements) {
serverSurrogate.send(packet, session.getStreamID());
}
return connection;
}
private class InactivityTimer extends Timer {
private Map<String, InactivityTimeoutTask> sessionMap
= new HashMap<String, InactivityTimeoutTask>();
public void stop(HttpSession session) {
InactivityTimeoutTask task = sessionMap.remove(session.getStreamID());
if(task != null) {
task.cancel();
}
}
public void reset(HttpSession session) {
stop(session);
if(session.isClosed()) {
return;
}
InactivityTimeoutTask task = new InactivityTimeoutTask(session);
schedule(task, session.getInactivityTimeout() * 1000);
sessionMap.put(session.getStreamID().getID(), task);
}
}
private class InactivityTimeoutTask extends TimerTask {
private Session session;
public InactivityTimeoutTask(Session session) {
this.session = session;
}
public void run() {
session.close();
}
}
}
/**
* $RCSfile: $
* $Revision: $
* $Date: $
*
* Copyright (C) 2006 Jive Software. All rights reserved.
* This software is the proprietary information of Jive Software. Use is subject to license terms.
*/
package org.jivesoftware.wildfire.http;
/**
*
*/
public interface SessionListener {
public void connectionOpened(HttpSession session, HttpConnection connection);
public void connectionClosed(HttpSession session, HttpConnection connection);
public void sessionClosed(HttpSession session);
}
......@@ -3,7 +3,7 @@
* $Revision: 1217 $
* $Date: 2005-04-11 18:11:06 -0300 (Mon, 11 Apr 2005) $
*
* Copyright (C) 2004 Jive Software. All rights reserved.
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
......@@ -36,13 +36,14 @@ public class SSLConfig {
private static String trustpass;
private static String keyStoreLocation;
private static String trustStoreLocation;
private static String storeType;
private SSLConfig() {
}
static {
String algorithm = JiveGlobals.getProperty("xmpp.socket.ssl.algorithm", "TLS");
String storeType = JiveGlobals.getProperty("xmpp.socket.ssl.storeType", "jks");
storeType = JiveGlobals.getProperty("xmpp.socket.ssl.storeType", "jks");
// Get the keystore location. The default location is security/keystore
keyStoreLocation = JiveGlobals.getProperty("xmpp.socket.ssl.keystore",
......@@ -151,4 +152,20 @@ public class SSLConfig {
return sslFactory.createServerSocket(port, -1, ifAddress);
}
}
public static String getKeystoreLocation() {
return keyStoreLocation;
}
public static String getTruststoreLocation() {
return trustStoreLocation;
}
public static String getStoreType() {
return storeType;
}
public static SSLJiveServerSocketFactory getServerSocketFactory() {
return sslFactory;
}
}
\ No newline at end of file
......@@ -16,8 +16,10 @@ import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.*;
import org.jivesoftware.wildfire.container.BasicModule;
import org.jivesoftware.wildfire.container.AdminConsolePlugin;
import org.jivesoftware.wildfire.multiplex.MultiplexerPacketDeliverer;
import org.jivesoftware.wildfire.net.*;
import org.mortbay.jetty.Server;
import java.io.IOException;
import java.net.InetAddress;
......@@ -82,6 +84,8 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
startClientListeners(localIPAddress);
// Start the port listener for secured clients
startClientSSLListeners(localIPAddress);
// Start the HTTP client listener
startHTTPBindListeners();
}
private void startServerListener(String localIPAddress) {
......@@ -282,6 +286,13 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
}
}
private void startHTTPBindListeners() {
Server jetty = AdminConsolePlugin.getJettyServer();
if(jetty == null) {
return;
}
}
public void initialize(XMPPServer server) {
super.initialize(server);
this.server = server;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment