The JavaDoc suggest that the usual way would be to call
// Create a connection to the igniterealtime.org XMPP server. XMPPConnection con = new XMPPTCPConnection("igniterealtime.org"); // Connect to the server con.connect();
However, the connect() method is not in the interface. (also disconnect() and login(…), which are mentioned).
Should be simple to pull them up from AbstractXMPPConnection.
In fact here is the javadoc wrong, or in other words: It’s by design that the XMPPConnection interface does not declare any methods to change the connection state. This is mainly for two reasons:
It doesn’t need to. XMPPConnection (the interface) is used everywhere in Smack, and nowhere, besides the exception of ReconnectionManager, methods to manipulate the connection state are required.
There could be XMPP connection types that are always connected (for whatever reason)