powered by Jive Software

Can't use connect()

Hi,

I started using Smack following the documentation.
I want to connect like in the doc :

ConnectionConfiguration config = new ConnectionConfiguration("jabber.org", 5222);
Connection conn2 = new XMPPConnection(config);
conn2.connect();

But XMPPConnection is abstract.

I created myConnection class.

class myConnection extends XMPPConnection{     public myConnection(ConnectionConfiguration configuration) {
        super(configuration);
    }
            @Override
    public String getUser() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }     @Override
    public String getConnectionID() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }     @Override
    public boolean isConnected() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }     @Override
    public boolean isAuthenticated() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }     @Override
    public boolean isAnonymous() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }     @Override
    public boolean isSecureConnection() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }     @Override
    protected void sendPacketInternal(Packet packet) throws SmackException.NotConnectedException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }     @Override
    public boolean isUsingCompression() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }     @Override
    protected void connectInternal() throws SmackException, IOException, XMPPException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }     @Override
    public void login(String string, String string1, String string2) throws XMPPException, SmackException, SaslException, IOException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }     @Override
    public void loginAnonymously() throws XMPPException, SmackException, SaslException, IOException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }     @Override
    protected void shutdown() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    }

Then try :

ConnectionConfiguration config = new ConnectionConfiguration("192.168.93.139", 5222);
                myConnection conn = new myConnection(config);
        conn.connect();

But JAVA send me an error message :

Exception in thread “main” java.lang.UnsupportedOperationException: Not supported yet.

at javaapplication2.myConnection.connectInternal(myConnection.java:71)

at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:391)

at javaapplication2.JavaApplication2.main(JavaApplication2.java:40)

Java Result: 1

Thx for your help.

Which Smack version are you using? Which documentation are you referring to?