Examples of ConnectionConfiguration


Examples of org.jivesoftware.smack.ConnectionConfiguration

                if (config.getServletConfig().getInitParameter(XMPP_DEBUG) != null) {
                    XMPPConnection.DEBUG_ENABLED = true;
                }
            }

            ConnectionConfiguration config = null;
            int port = -1;
            try {
                port = uri.getPort();
            } catch (Throwable t) {
                ;
            }
            if (port == -1) {
                config = new ConnectionConfiguration(uri.getHost());
            } else {
                config = new ConnectionConfiguration(uri.getHost(), port);

            }

            xmppConnection = new XMPPConnection(config);
            xmppConnection.connect();
View Full Code Here

Examples of org.jivesoftware.smack.ConnectionConfiguration

    // Implementation methods
    // -------------------------------------------------------------------------
    protected XMPPConnection createConnection() throws XMPPException {
        XMPPConnection connection;
        if (port > 0) {
            connection = new XMPPConnection(new ConnectionConfiguration(host, port));
        } else {
            connection = new XMPPConnection(host);
        }

        connection.connect();
View Full Code Here

Examples of org.jivesoftware.smack.ConnectionConfiguration

        // allow for the server to bootstrap
        Thread.sleep(200);
    }
   
    protected XMPPConnection connectClient(int port, String username, String password) throws Exception {
        ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("localhost", port);
        connectionConfiguration.setCompressionEnabled(false);
        connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
        connectionConfiguration.setSASLAuthenticationEnabled(true);
        connectionConfiguration.setDebuggerEnabled(false);
       
        XMPPConnection.DEBUG_ENABLED = true;
        XMPPConnection client = new XMPPConnection(connectionConfiguration);
       
        client.connect();
View Full Code Here

Examples of org.jivesoftware.smack.ConnectionConfiguration

    // -------------------------------------------------------------------------
    protected XMPPConnection createConnection() throws XMPPException {
        XMPPConnection connection;
        if (port > 0) {           
            if (getServiceName() == null) {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port));
            } else {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port, getServiceName()));
            }
        } else {
            connection = new XMPPConnection(host);
        }
View Full Code Here

Examples of org.jivesoftware.smack.ConnectionConfiguration

        String me = args.length > 0 ? args[0] : "user1";
        String to = args.length < 2 ? null : args[1];

        try {
            ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("localhost");
            //            ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("xmpp.eu");
            connectionConfiguration.setCompressionEnabled(false);
            connectionConfiguration.setSelfSignedCertificateEnabled(true);
            connectionConfiguration.setExpiredCertificatesCheckEnabled(false);
            connectionConfiguration.setDebuggerEnabled(true);
            connectionConfiguration.setSASLAuthenticationEnabled(true);
            connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
            XMPPConnection.DEBUG_ENABLED = true;
            XMPPConnection connection = new XMPPConnection(connectionConfiguration);
            connection.connect();

            SASLAuthentication saslAuthentication = connection.getSASLAuthentication();
View Full Code Here

Examples of org.jivesoftware.smack.ConnectionConfiguration

        // allow for the server to bootstrap
        Thread.sleep(200);
    }

    protected XMPPConnection connectClient(int port, String username, String password) throws Exception {
        ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("localhost", port);
        connectionConfiguration.setCompressionEnabled(false);
        connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
        connectionConfiguration.setSASLAuthenticationEnabled(true);
        connectionConfiguration.setDebuggerEnabled(false);
        connectionConfiguration.setKeystorePath("src/main/config/bogus_mina_tls.cert");
        connectionConfiguration.setTruststorePath("src/main/config/bogus_mina_tls.cert");
        connectionConfiguration.setTruststorePassword("boguspw");

        XMPPConnection.DEBUG_ENABLED = true;
        XMPPConnection client = new XMPPConnection(connectionConfiguration);

        client.connect();
View Full Code Here

Examples of org.jivesoftware.smack.ConnectionConfiguration

        // allow for the server to bootstrap
        Thread.sleep(200);
    }

    protected XMPPConnection connectClient(int port, String username, String password) throws Exception {
        ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("localhost", port);
        connectionConfiguration.setCompressionEnabled(false);
        connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
        connectionConfiguration.setSASLAuthenticationEnabled(true);
        connectionConfiguration.setDebuggerEnabled(false);
        connectionConfiguration.setKeystorePath("src/main/config/bogus_mina_tls.cert");
        connectionConfiguration.setTruststorePath("src/main/config/bogus_mina_tls.cert");
        connectionConfiguration.setTruststorePassword("boguspw");

        XMPPConnection.DEBUG_ENABLED = true;
        XMPPConnection client = new XMPPConnection(connectionConfiguration);

        client.connect();
View Full Code Here

Examples of org.jivesoftware.smack.ConnectionConfiguration

        this.resource = resource;
    }

    @Override
    public void afterPropertiesSet() throws XMPPException {
        ConnectionConfiguration configuration = createConnectionConfiguration(host, port, serviceName);
        Assert.notNull(configuration, "'configuration' must not be null");
        Assert.hasText(username, "'username' must not be empty");
        Assert.hasText(password, "'password' must not be empty");

        connection = new XMPPConnection(configuration);
View Full Code Here

Examples of org.jivesoftware.smack.ConnectionConfiguration

     * @param serviceName the name of the service to connect to. May be {@code null}
     */
    protected ConnectionConfiguration createConnectionConfiguration(String host, int port, String serviceName) {
        Assert.hasText(host, "'host' must not be empty");
        if (StringUtils.hasText(serviceName)) {
            return new ConnectionConfiguration(host, port, serviceName);
        }
        else {
            return new ConnectionConfiguration(host, port);
        }
    }
View Full Code Here

Examples of org.jivesoftware.smack.ConnectionConfiguration

    for (String s: to.split(";")) {
      if (s != null && !"".equals(s)) {
        this.toUsers.add(s);
      }
    }
        ConnectionConfiguration conf = new ConnectionConfiguration(server, port , service);
        XMPPConnection connection = null;
        try {

           if(server !=null && !server.equals("") && port != 0){
             connection = new XMPPConnection(conf);
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.