Package org.jivesoftware.smack

Examples of org.jivesoftware.smack.XMPPConnection.login()


        ConnectionConfiguration config = new ConnectionConfiguration("localhost", 61222);
        //config.setDebuggerEnabled(true);

        XMPPConnection consumerCon = new XMPPConnection(config);
        consumerCon.connect();
        consumerCon.login("consumer", "consumer");
        consumerCon.addPacketListener(new XmppLogger("CONSUMER INBOUND"), new PacketFilter() {
            public boolean accept(Packet packet) {
                return true;
            }
        });
View Full Code Here


            }
        });

        XMPPConnection producerCon = new XMPPConnection(config);
        producerCon.connect();
        producerCon.login("producer", "producer");
        producerCon.addPacketListener(new XmppLogger("PRODUCER INBOUND"), new PacketFilter() {
            public boolean accept(Packet packet) {
                return true;
            }
        });
View Full Code Here

                if (createAccount) {
                    AccountManager accountManager = new AccountManager(connection);
                    accountManager.createAccount(user, password);
                }
                if (resource != null) {
                    connection.login(user, password, resource);
                }
                else {
                    connection.login(user, password);
                }
            }
View Full Code Here

                }
                if (resource != null) {
                    connection.login(user, password, resource);
                }
                else {
                    connection.login(user, password);
                }
            }
            else {
                log.info("Logging in anonymously to XMPP on connection: " + connection);
                connection.loginAnonymously();
View Full Code Here

            resource = sec.itemAt(0).getStringValue();
          }
        }
       
        if (resource == null){
          connection.login(user, password);
        } else connection.login(user, password, resource);
      }
     
      return BooleanValue.TRUE;
     
View Full Code Here

          }
        }
       
        if (resource == null){
          connection.login(user, password);
        } else connection.login(user, password, resource);
      }
     
      return BooleanValue.TRUE;
     
    } catch (XMPPException e) {
View Full Code Here

                if (createAccount) {
                    AccountManager accountManager = new AccountManager(connection);
                    accountManager.createAccount(user, password);
                }
                if (resource != null) {
                    connection.login(user, password, resource);
                } else {
                    connection.login(user, password);
                }
            } else {
                LOG.info("Logging in anonymously to XMPP on connection: " + connection);
View Full Code Here

                    accountManager.createAccount(user, password);
                }
                if (resource != null) {
                    connection.login(user, password, resource);
                } else {
                    connection.login(user, password);
                }
            } else {
                LOG.info("Logging in anonymously to XMPP on connection: " + connection);
                connection.loginAnonymously();
            }
View Full Code Here

        if ( user != null )
        {
            try
            {
                conn.login( user, password, RESOURCE_NAME );

                if ( !conn.isAuthenticated() )
                {
                    throw new JabberClientException( "Authentication failed." );
                }
View Full Code Here

                    try
                    {
                        conn.getAccountManager().createAccount( user, password );

                        conn.login( user, password, RESOURCE_NAME );
                    }
                    catch ( XMPPException createException )
                    {
                        throw new JabberClientException( "Can't create an account for user " + user + " on "
                                                         + getHost(), createException );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.