Class XmppSessionConfiguration.Builder

    • Method Detail

      • defaultResponseTimeout

        public final XmppSessionConfiguration.Builder defaultResponseTimeout​(Duration defaultResponseTimeout)
        Sets the default response timeout for synchronous calls, usually IQ calls.
        Parameters:
        defaultResponseTimeout - The default response timeout.
        Returns:
        The builder.
      • authenticationMechanisms

        public final XmppSessionConfiguration.Builder authenticationMechanisms​(String... authenticationMechanisms)
        Sets the preferred mechanisms used for this XMPP session.

        6.3.3. Mechanism Preferences

        Any entity that will act as a SASL client or a SASL server MUST maintain an ordered list of its preferred SASL mechanisms according to the client or server, where the list is ordered according to local policy or user configuration (which SHOULD be in order of perceived strength to enable the strongest authentication possible). The initiating entity MUST maintain its own preference order independent of the preference order of the receiving entity. A client MUST try SASL mechanisms in its preference order. For example, if the server offers the ordered list "PLAIN SCRAM-SHA-1 GSSAPI" or "SCRAM-SHA-1 GSSAPI PLAIN" but the client's ordered list is "GSSAPI SCRAM-SHA-1", the client MUST try GSSAPI first and then SCRAM-SHA-1 but MUST NOT try PLAIN (since PLAIN is not on its list).

        Parameters:
        authenticationMechanisms - The preferred mechanisms.
        Returns:
        The builder.
      • initialPresence

        public final XmppSessionConfiguration.Builder initialPresence​(Supplier<Presence> presenceSupplier)
        Sets a supplier for initial presence which is sent during login. If the supplier is null or returns null, no initial presence is sent.
        Parameters:
        presenceSupplier - The presence supplier.
        Returns:
        The builder.
        See Also:
        4.2. Initial Presence
      • language

        public final XmppSessionConfiguration.Builder language​(Locale language)
        Sets the preferred or default language for any human-readable XML character data to be sent over the stream.
        Parameters:
        language - The language.
        Returns:
        The builder.
        See Also:
        4.7.4. xml:lang
      • nameServer

        public final XmppSessionConfiguration.Builder nameServer​(String nameServer)
        Sets the name server used for resolving DNS SRV and TXT records during connecting.

        For Oracle JDK, you could use one of sun.net.dns.ResolverConfiguration.open().nameservers().

        If no name server is set, Google DNS Server (8.8.8.8) is used.

        Parameters:
        nameServer - The name server.
        Returns:
        The builder.
      • threadFactory

        public final XmppSessionConfiguration.Builder threadFactory​(ThreadFactory threadFactory)
        Sets a custom thread factory.

        This is useful in managed environments where the thread creation should be managed by a container, e.g. javax.enterprise.concurrent.ManagedThreadFactory

        Parameters:
        threadFactory - The thread factory.
        Returns:
        The builder.
      • closeOnShutdown

        public final XmppSessionConfiguration.Builder closeOnShutdown​(boolean closeOnShutdown)
        Indicates whether the XMPP session is closed, when the JVM is shut down.

        If true (default), a shutdown hook is added to the runtime, which will gracefully close the session on shutdown.

        If false, no shutdown hook will be added to the runtime.

        Parameters:
        closeOnShutdown - true, if a shutdown hook shall be added to the runtime.
        Returns:
        The builder.
      • executor

        public final XmppSessionConfiguration.Builder executor​(Executor executor)
        Sets the executor, which processes inbound stanzas.
        Parameters:
        executor - The executor.
        Returns:
        The builder.