Package org.jivesoftware.smack

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


            System.exit(1);

        }

        try{
            connection.login(user, password);
            System.out.println("Logged in as " + connection.getUser());
            Presence presence = new Presence(Presence.Type.available);
            connection.sendPacket(presence);

        } catch (XMPPException ex){
View Full Code Here


    XMPPConnection connection = new XMPPConnection(connConfig);
   
   
    try {
      connection.connect();
      connection.login("admin", "admin");
     
      String username="demo";
      String pw="test";
      String email="test@test.ch";
      String fullName="gregor grunz";
View Full Code Here

  public void run() {
    try {
      XMPPConnection connection = client.getConnection();
      connection.connect();
      connection.login(client.getChatUsername(), client.getPassword(), IMConfig.RESOURCE);
     
      if (log.isDebug()) {
        log.debug("Connection to IM server with username: "+client.getChatUsername());
      }
     
View Full Code Here

   
    protected XMPPConnection connect(String resource) throws XMPPException {
      XMPPConnection c = new XMPPConnection(connConfig);
     
        c.connect();
        c.login(username, passwd, resource);       
        Presence presence = new Presence(Presence.Type.available);
        c.sendPacket(presence);
       
        return c;
    }
View Full Code Here

   
    protected XMPPConnection connect(String resource) throws XMPPException {
      XMPPConnection c = new XMPPConnection(connConfig);
     
        c.connect();
        c.login(username, passwd, resource);       
//        Presence presence = new Presence(Presence.Type.available);
//        c.sendPacket(presence);
       
        return c;
    }
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 (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

        XMPPConnection.DEBUG_ENABLED = true;
        XMPPConnection client = new XMPPConnection(connectionConfiguration);
       
        client.connect();
       
        client.login(username, password);
        return client;
    }

    protected Packet sendSync(XMPPConnection client, Packet request) {
        // Create a packet collector to listen for a response.
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.