Package org.jivesoftware.smack

Examples of org.jivesoftware.smack.ConnectionListener


      conConfig.setReconnectionAllowed(true);
      //conConfig.setDebuggerEnabled(true);
      if (connection == null || !connection.isAuthenticated()) {
        connection = new XMPPConnection(conConfig);
        connection.connect();
        connection.addConnectionListener(new ConnectionListener() {
 
          public void connectionClosed() {
            log.warn("IM admin connection closed!");
          }
 
View Full Code Here


        log.error("Error occured while connecting to Googletalk server.",e1);
        throw new AxisFault("Error occured while connecting to Googletalk server.");
     
    }
   
    ConnectionListener connectionListener = null;
    connectionListener = new ConnectionListener(){
      public void connectionClosed() {
        log.debug("Connection closed normally");
      }
      public void connectionClosedOnError(
          Exception e1) {
View Full Code Here

            PresenceWrapper oldWrapper = presences.remove(presence.getFrom());
            if(oldWrapper != null)
              logPresence(oldWrapper);
          }
        } }, new AndFilter());//new PacketTypeFilter(Presence.class));
      connection.addConnectionListener(new ConnectionListener(){
        public void connectionClosed() {
          doConnect();
        }
        public void connectionClosedOnError(Exception e) {
          e.printStackTrace();
View Full Code Here

//          }
        }
        asyncAppendToChatHistory(account.jid,"- You changed your status to " + GOIMIcons.getShowTextForPresence(account.xmpp.getOwnPresence()),false,"","* ");
      } };
    account.xmpp.ownPresenceChanged.addListener(ownPresenceChangeListener);
    connectionListener = new ConnectionListener() {
      public void connectionClosed() {
        getDisplay().asyncExec(new Runnable() { public void run() {
          appendToChatHistory(account.jid," - You disconnected from the Jabber Server",false,"","* "); // - You will need to reopen this Window when reconnecting.",false,"","* ");
        }});
      }
 
View Full Code Here

            initMUCOccupantList();
          }
        }
        asyncAppendToChatHistory(account.jid,"- You changed your status to " + GOIMIcons.getShowTextForPresence(account.xmpp.getOwnPresence()),false,"","* ");
      } };
    mucConnectionListener = new ConnectionListener() {
      public void connectionClosed() {
        getDisplay().asyncExec(new Runnable() { public void run() {
          getModeratorsItem().removeAll();
          getParticipantsItem().removeAll();
          getVisitorsItem().removeAll();
View Full Code Here

                  reply.setOs(System.getProperty("os.name") + " " + System.getProperty("os.version") + " (Java: " + System.getProperty("java.vendor") + " " + System.getProperty("java.version") + ")");
                  conn.sendPacket(reply);
                }
              }
            }},new AndFilter());
          conn.addConnectionListener(new ConnectionListener() {
            public void connectionClosed() {
            }
            public void connectionClosedOnError(final Exception e) {
              conn = null;
              Presence previousPresence = lastPresenceSent;
View Full Code Here

   * @param serverCredentials
   * @throws XMPPException
   */
  public void connect(final XMPPServerCredentials serverCredentials) throws AxisFault {
    if(XMPPConstants.XMPP_SERVER_TYPE_JABBER.equals(serverCredentials.getServerType())){
      ConnectionListener connectionListener = null;
      try
      {
        //XMPPConnection.DEBUG_ENABLED = true;
        xmppConnection = new XMPPConnection(serverCredentials.getServerUrl());
        xmppConnection.connect();
        connectionListener = new ConnectionListener(){

          public void connectionClosed() {
            log.debug("Connection closed normally");
          }

View Full Code Here

            }
        };

        // Create a thread that will listen for any connection closed event
        connListener = new ConnectionListener() {
            public void connectionClosed() {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        statusField.setValue("Closed");
                        EnhancedDebuggerWindow.connectionClosed(EnhancedDebugger.this);
View Full Code Here

                            packet.toXML());
                }
            }
        };

        connListener = new ConnectionListener() {
            public void connectionClosed() {
                System.out.println(
                        dateFormatter.format(new Date()) + " Connection closed (" +
                        connection.hashCode() +
                        ")");
View Full Code Here

     * @param connection
     *            The connection to set up
     */
    private void installConnectionListeners(final Connection connection) {
        if (connection != null) {
            connectionListener = new ConnectionListener() {
                public void connectionClosed() {
                    unregisterInstanceFor(connection);
                }

                public void connectionClosedOnError(java.lang.Exception e) {
View Full Code Here

TOP

Related Classes of org.jivesoftware.smack.ConnectionListener

Copyright © 2018 www.massapicom. 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.