01: /*
02: * $Id: XmppsConnector.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.transport.xmpp;
12:
13: import org.mule.api.endpoint.EndpointURI;
14:
15: import org.jivesoftware.smack.SSLXMPPConnection;
16: import org.jivesoftware.smack.XMPPConnection;
17: import org.jivesoftware.smack.XMPPException;
18:
19: public class XmppsConnector extends XmppConnector {
20:
21: public static final String XMPPS = "xmpps";
22:
23: public String getProtocol() {
24: return XMPPS;
25: }
26:
27: /**
28: * This method creates a {@link SSLXMPPConnection} to allow secure communication to the Jabber
29: * server.
30: */
31: protected XMPPConnection doCreateXmppConnection(
32: EndpointURI endpointURI) throws XMPPException {
33: XMPPConnection xmppConnection = null;
34:
35: if (endpointURI.getPort() != -1) {
36: xmppConnection = new SSLXMPPConnection(endpointURI
37: .getHost(), endpointURI.getPort());
38: } else {
39: xmppConnection = new SSLXMPPConnection(endpointURI
40: .getHost());
41: }
42:
43: return xmppConnection;
44: }
45:
46: }
|