Codota Logo
ConnectionConfiguration.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.jivesoftware.smack.ConnectionConfiguration
constructor

Best Java code snippets using org.jivesoftware.smack.ConnectionConfiguration.<init> (Showing top 20 results out of 315)

  • Common ways to obtain ConnectionConfiguration
private void myMethod () {
ConnectionConfiguration c =
  • Codota IconString host;String serviceName;new ConnectionConfiguration(host, port, serviceName)
  • Codota IconString host;new ConnectionConfiguration(host, port)
  • Codota IconString serviceName;new ConnectionConfiguration(serviceName)
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com", 5222);
config.setSASLAuthenticationEnabled(true);
XMPPConnection xmpp = new XMPPConnection(config);
try
{
  SASLAuthentication.registerSASLMechanism("X-FACEBOOK-PLATFORM", SASLXFacebookPlatformMechanism.class);
  SASLAuthentication.supportSASLMechanism("X-FACEBOOK-PLATFORM", 0);
  xmpp.connect();
  xmpp.login(apiKey + "|" + sessionKey, sessionSecret, "Application");
} catch (XMPPException e)
{
  xmpp.disconnect();
  e.printStackTrace();
}
origin: stackoverflow.com

 public static final String HOST = "http://54.254.220.129";
public static final int PORT = 5222;
public static final String SERVICE = "localhost";
public static final String USERNAME = "admin@localhost";
public static final String PASSWORD = "########";

ConnectionConfiguration connConfig = new ConnectionConfiguration(HOST, PORT, SERVICE);
XMPPConnection connection = new XMPPConnection(connConfig);

connection.connect();
connection.login(USERNAME, PASSWORD);
origin: stackoverflow.com

 public Mymain(String username, String password) throws IOException, XMPPException, NullPointerException, InterruptedException, InvocationTargetException {
  initComponents();
  welcome.setText(name);

  ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
  connection = new XMPPConnection(config);
  connection.connect();
  connection.login(username, password);
  name = username;

  setVisible(true);
}
origin: stackoverflow.com

ConnectionConfiguration connConfig = new ConnectionConfiguration("abc.hostname.com",5222);
   configure(ProviderManager.getInstance());
   connection = new XMPPConnection(connConfig);
   connection.connect();
   connection.login(userName, password);
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration("hostname/IP address", 5222, "servicename/domainname");  
connection = new XMPPConnection(config);  
connection.connect();  
connection.login("user1", "password");`
origin: stackoverflow.com

 //Setting up connection
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
    connection = new XMPPConnection(config);
    connection.connect();
//login
    connection.login(userName, password);
//get your roster   
  Roster roster = connection.getRoster();
//add a new roster entry aka SEND INVITATION

roster.createEntry(address, name, groups);
origin: stackoverflow.com

 ConnectionConfiguration cf = new ConnectionConfiguration("jabber.ccc.de",5222, "test");
cf.setTruststorePassword("changeme");
this.connection = new XMPPConnection(cf);
this.connection.connect();
this.connection.login("user", "password");
origin: stackoverflow.com

ConnectionConfiguration connFig = new ConnectionConfiguration(SERVER,
    PORT);
connFig.setSASLAuthenticationEnabled(true);
origin: stackoverflow.com

 public void login(String userName, String password) throws XMPPException
{       
  SASLAuthentication.registerSASLMechanism("DIGEST-MD5",MySASLDigestMD5Mechanism. class);
  ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com",5222);

  config.setSASLAuthenticationEnabled(true);
  config.setRosterLoadedAtLogin (true);

  connection = new XMPPConnection(config);
  connection.connect();
  connection.login(userName, password);
}
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com", 5222);
config.setSASLAuthenticationEnabled(true);
mFbConnection = new XMPPConnection(config);

try {
  SASLAuthentication.registerSASLMechanism("X-FACEBOOK-PLATFORM", SASLXFacebookPlatformMechanism.class);
  SASLAuthentication.supportSASLMechanism("X-FACEBOOK-PLATFORM", 0);
  mFbConnection.connect();
  mFbConnection.login(apiKey, accessToken, "Application");
} catch (XMPPException e) {
  mFbConnection.disconnect();
  e.printStackTrace();
}
origin: stackoverflow.com

/* this config I missed out */
 ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
 config.setCompressionEnabled(true);
 config.setSASLAuthenticationEnabled(false);
 connection = new XMPPConnection(config);
origin: loldevs/riotapi

private static ConnectionConfiguration buildConnectionConfiguration(Shard shard) {
  ConnectionConfiguration connConf = new ConnectionConfiguration(shard.chatUrl, Shard.JABBER_PORT, "pvp.net");
  connConf.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
  connConf.setSocketFactory(SSLSocketFactory.getDefault());
  return connConf;
}
origin: stackoverflow.com

 private ConnectionStatus status;
 private XMPPConnection xmppConnection;

public void connect(String server, int port, String s) throws Exception
{
xmppConnection = new XMPPConnection(new ConnectionConfiguration(server, port,s));
xmppConnection.connect();
xmppConnection.addConnectionListener(this);
xmppConnection.getChatManager().addChatListener(this); 
}
origin: stackoverflow.com

 // Create the configuration for this new connection
ConnectionConfiguration config = new ConnectionConfiguration("jabber.org", 5222);
config.setCompressionEnabled(true);
config.setSASLAuthenticationEnabled(true);

Connection connection = new XMPPConnection(config);
// Connect to the server
connection.connect();
// Log into the server
connection.login("danilodeveloper", "password", "SomeResource");
// getting the Openfire contacts that danilodeveloper has
Roster roster = connection.getRoster();
// the contacts
Collection<RosterEntry> entries = roster.getEntries();
origin: stackoverflow.com

 private final static String server_host = "talk.google.com";
private final static int SERVER_PORT = 5222;
private final static String SERVICE_NAME = "gmail.com";

ConnectionConfiguration config = new ConnectionConfiguration( server_host, SERVER_PORT , SERVICE_NAME);
    XMPPConnection m_connection = new XMPPConnection(config);
        try {
           SASLAuthentication.supportSASLMechanism("PLAIN");
           config.setSASLAuthenticationEnabled(true);     
           m_connection.connect();
          Roster.setDefaultSubscriptionMode(Roster.SubscriptionMode.manual);
        } catch (XMPPException e) {
          e.printStackTrace();
        }
origin: stackoverflow.com

 ConnectionConfiguration cc = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
XMPPConnection connection = new XMPPConnection(cc);
try {
   connection.connect();

   // You have to put this code before you login
   SASLAuthentication.supportSASLMechanism("PLAIN", 0);

   // You have to specify your gmail addres WITH @gmail.com at the end
   connection.login("some.account@gmail.com", "password", "resource");

   // See if you are authenticated
   System.out.println(connection.isAuthenticated());

} catch (XMPPException e1) {
   e1.printStackTrace();
}
origin: stackoverflow.com

 ConnectionConfiguration cc = new ConnectionConfiguration("jabber.org", 5222, "jabber.org");
XMPPConnection connection = new XMPPConnection(cc);
try {
   connection.connect();

   // You have to put this code before you login
   SASLAuthentication.supportSASLMechanism("PLAIN", 0);

   // You have to specify your Jabber ID addres WITHOUT @jabber.org at the end
   connection.login("your.jabber", "password", "resource");

   // See if you are authenticated
   System.out.println(connection.isAuthenticated());

} catch (XMPPException e1) {
   e1.printStackTrace();
}
origin: stackoverflow.com

 ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com", 5222);
config.setSASLAuthenticationEnabled(true);
config.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);
XMPPConnection xmpp = new XMPPConnection(config);
SASLAuthentication.registerSASLMechanism("X-FACEBOOK-PLATFORM",SASLXFacebookPlatformMechanism.class);
SASLAuthentication.supportSASLMechanism("X-FACEBOOK-PLATFORM", 0);
xmpp.connect();
xmpp.login(appSecret, accessToken, "Application");
origin: stackoverflow.com

ConnectionConfiguration connConfig = new ConnectionConfiguration("ip", 5222);
     XMPPConnection connection = new XMPPConnection(connConfig);
     connection.connect();
     connection.login("username", "password");
     AccountManager accountManager = connection.getAccountManager();
     accountManager.createAccount("adminCreated1", "123456");
     connection.disconnect();
origin: stackoverflow.com

 ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("localhost", 5222);
connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
connectionConfiguration.setSASLAuthenticationEnabled(true);
connectionConfiguration.setKeystorePath("src/main/resources/bogus_mina_tls.cert");
connectionConfiguration.setTruststorePath("src/main/resources/bogus_mina_tls.cert");
connectionConfiguration.setTruststorePassword("boguspw");
org.jivesoftware.smackConnectionConfiguration<init>

Popular methods of ConnectionConfiguration

  • setSecurityMode
    Sets the TLS security mode used when making the connection. By default, the mode is SecurityMode#ena
  • setCompressionEnabled
    Sets if the connection is going to use stream compression. Stream compression will be requested afte
  • setDebuggerEnabled
    Sets if the new connection about to be establish is going to be debugged. By default the value of Co
  • setReconnectionAllowed
    Sets if the reconnection mechanism is allowed to be used. By default reconnection is allowed.
  • setSASLAuthenticationEnabled
    Sets whether the client will use SASL authentication when logging into the server. If SASL authentic
  • setRosterLoadedAtLogin
    Sets if the roster will be loaded from the server when logging in. This is the common behaviour for
  • getResource
    Returns the resource to use when trying to reconnect to the server.
  • getUsername
    Returns the username to use when trying to reconnect to the server.
  • isCompressionEnabled
    Returns true if the connection is going to use stream compression. Stream compression will be reques
  • setSendPresence
    Sets if an initial available presence will be sent to the server. By default an available presence w
  • setSocketFactory
    Sets the socket factory used to create new xmppConnection sockets. This is useful when connecting th
  • getCallbackHandler
    Returns a CallbackHandler to obtain information, such as the password or principal information durin
  • setSocketFactory,
  • getCallbackHandler,
  • getPassword,
  • getSecurityMode,
  • isSendPresence,
  • setCallbackHandler,
  • getHost,
  • getPort,
  • getServiceName

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • requestLocationUpdates (LocationManager)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now