public B setPort(int port) { if (port < 0 || port > 65535) { throw new IllegalArgumentException( "Port must be a 16-bit unsigned integer (i.e. between 0-65535. Port was: " + port); } this.port = port; return getThis(); }
/** * Sets a CallbackHandler to obtain information, such as the password or * principal information during the SASL authentication. A CallbackHandler * will be used <b>ONLY</b> if no password was specified during the login while * using SASL authentication. * * @param callbackHandler to obtain information, such as the password or * principal information during the SASL authentication. * @return a reference to this builder. */ public B setCallbackHandler(CallbackHandler callbackHandler) { this.callbackHandler = callbackHandler; return getThis(); }
/** * Sets a custom SSLContext for creating SSL sockets. * <p> * For more information on how to create a SSLContext see <a href= * "http://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide.html#X509TrustManager" * >Java Secure Socket Extension (JSEE) Reference Guide: Creating Your Own X509TrustManager</a> * * @param context the custom SSLContext for new sockets. * @return a reference to this builder. */ public B setCustomSSLContext(SSLContext context) { this.customSSLContext = Objects.requireNonNull(context, "The SSLContext must not be null"); return getThis(); }
/** * Allow <code>null</code> or the empty String as username. * * Some SASL mechanisms (e.g. SASL External) may also signal the username (as "authorization identity"), in * which case Smack should not throw an IllegalArgumentException when the username is not set. * * @return a reference to this builder. */ public B allowEmptyOrNullUsernames() { allowEmptyOrNullUsername = true; return getThis(); }
/** * Set the enabled SSL/TLS protocols. * * @param enabledSSLProtocols * @return a reference to this builder. */ public B setEnabledSSLProtocols(String[] enabledSSLProtocols) { this.enabledSSLProtocols = enabledSSLProtocols; return getThis(); }
/** * Set the information about the Proxy used for the connection. * * @param proxyInfo the Proxy information. * @return a reference to this builder. */ public B setProxyInfo(ProxyInfo proxyInfo) { this.proxy = proxyInfo; return getThis(); }
/** * Set the HostnameVerifier used to verify the hostname of SSLSockets used by XMPP connections * created with this ConnectionConfiguration. * * @param verifier * @return a reference to this builder. */ public B setHostnameVerifier(HostnameVerifier verifier) { hostnameVerifier = verifier; return getThis(); }
/** * Sets the PKCS11 library file location, needed when the * Keystore type is PKCS11. * * @param pkcs11Library the path to the PKCS11 library file. * @return a reference to this builder. */ public B setPKCS11Library(String pkcs11Library) { this.pkcs11Library = pkcs11Library; return getThis(); }
/** * Set the name of the host providing the XMPP service. Note that this method does only allow DNS names and not * IP addresses. Use {@link #setHostAddress(InetAddress)} if you want to explicitly set the Internet address of * the host providing the XMPP service. * * @param host the DNS name of the host providing the XMPP service. * @return a reference to this builder. */ public B setHost(DnsName host) { this.host = host; return getThis(); }
/** * Set the Internet address of the host providing the XMPP service. If set, then this will overwrite anything * set via {@link #setHost(String)}. * * @param address the Internet address of the host providing the XMPP service. * @return a reference to this builder. * @since 4.2 */ public B setHostAddress(InetAddress address) { this.hostAddress = address; return getThis(); }
/** * Set the XMPP domain. The XMPP domain is what follows after the '@' sign in XMPP addresses (JIDs). * * @param xmppServiceDomain the XMPP domain. * @return a reference to this builder. * @throws XmppStringprepException if the given string is not a domain bare JID. */ public B setXmppDomain(String xmppServiceDomain) throws XmppStringprepException { this.xmppServiceDomain = JidCreate.domainBareFrom(xmppServiceDomain); return getThis(); }
public B setDnssecMode(DnssecMode dnssecMode) { this.dnssecMode = Objects.requireNonNull(dnssecMode, "DNSSEC mode must not be null"); return getThis(); }
/** * Set the Smack debugger factory used to construct Smack debuggers. * * @param debuggerFactory the Smack debugger factory. * @return a reference to this builder. */ public B setDebuggerFactory(SmackDebuggerFactory debuggerFactory) { this.debuggerFactory = debuggerFactory; return getThis(); }
/** * Set the enabled SSL/TLS ciphers. * * @param enabledSSLCiphers the enabled SSL/TLS ciphers * @return a reference to this builder. */ public B setEnabledSSLCiphers(String[] enabledSSLCiphers) { this.enabledSSLCiphers = enabledSSLCiphers; return getThis(); }
/** * Sets the keystore type. * * @param keystoreType the keystore type. * @return a reference to this builder. */ public B setKeystoreType(String keystoreType) { this.keystoreType = keystoreType; return getThis(); }
/** * Sets the path to the keystore file. The key store file contains the * certificates that may be used to authenticate the client to the server, * in the event the server requests or requires it. * * @param keystorePath the path to the keystore file. * @return a reference to this builder. */ public B setKeystorePath(String keystorePath) { this.keystorePath = keystorePath; return getThis(); }
/** * Sets the TLS security mode used when making the connection. By default, * the mode is {@link SecurityMode#ifpossible}. * * @param securityMode the security mode. * @return a reference to this builder. */ public B setSecurityMode(SecurityMode securityMode) { this.securityMode = securityMode; return getThis(); }
/** * Set the XMPP domain. The XMPP domain is what follows after the '@' sign in XMPP addresses (JIDs). * * @param xmppDomain the XMPP domain. * @return a reference to this builder. */ public B setXmppDomain(DomainBareJid xmppDomain) { this.xmppServiceDomain = xmppDomain; return getThis(); }
/** * Sets the socket factory used to create new xmppConnection sockets. * This is useful when connecting through SOCKS5 proxies. * * @param socketFactory used to create new sockets. * @return a reference to this builder. */ public B setSocketFactory(SocketFactory socketFactory) { this.socketFactory = socketFactory; return getThis(); }
public B enableDefaultDebugger() { this.debuggerFactory = SmackConfiguration.getDefaultSmackDebuggerFactory(); assert this.debuggerFactory != null; return getThis(); }