1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
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 | 8 | public class XmppsConnector extends XmppConnector |
20 | |
{ |
21 | |
|
22 | |
public static final String XMPPS = "xmpps"; |
23 | |
|
24 | |
public String getProtocol() |
25 | |
{ |
26 | 20 | return XMPPS; |
27 | |
} |
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
protected XMPPConnection doCreateXmppConnection(EndpointURI endpointURI) throws XMPPException |
34 | |
{ |
35 | 0 | XMPPConnection xmppConnection = null; |
36 | |
|
37 | 0 | if (endpointURI.getPort() != -1) |
38 | |
{ |
39 | 0 | xmppConnection = new SSLXMPPConnection(endpointURI.getHost(), endpointURI.getPort()); |
40 | |
} |
41 | |
else |
42 | |
{ |
43 | 0 | xmppConnection = new SSLXMPPConnection(endpointURI.getHost()); |
44 | |
} |
45 | |
|
46 | 0 | return xmppConnection; |
47 | |
} |
48 | |
|
49 | |
} |