Class ChatSettings


  • @Bean
    @Singleton
    public class ChatSettings
    extends Object
    Setting properties of the chat service. It loads the SILVERPEAS_HOME/properties/org/silverpeas/chat/settings/chat.properties and provides all the settings required by the Silverpeas Chat to work correctly.
    Author:
    mmoquillon
    • Constructor Detail

      • ChatSettings

        protected ChatSettings()
        Constructs a new object wrapping all the settings on the Silverpeas chat service.
    • Method Detail

      • getSilverpeasChatClientId

        public String getSilverpeasChatClientId()
        Gets the identifier of the chat client from point of view of Silverpeas server.
        Returns:
        a string representing an identifier.
      • getMaxCachedMsgThresholdPerRoom

        public int getMaxCachedMsgThresholdPerRoom()
        Gets for a room the threshold of cached messages over that the messages are clean from the web browser storage.
        Returns:
        a threshold as integer.
      • clearMessagesOnReconnection

        public boolean clearMessagesOnReconnection()
        Indicates if messages MUST be cleared after a user reconnection.

        It can avoid getting a huge history on WEB browser clients and improve the time access to last messages.

        Returns:
        a boolean.
      • isReplyToEnabled

        public boolean isReplyToEnabled()
        Indicates if the 'reply to' message is enabled.
        Returns:
        true of enabled, false otherwise.
      • isReactionToEnabled

        public boolean isReactionToEnabled()
        Indicates if the 'reaction to' message is enabled.
        Returns:
        true of enabled, false otherwise.
      • isVisioEnabled

        public boolean isVisioEnabled()
        Indicates if the visio conference is enabled.
        Returns:
        true of enabled, false otherwise.
      • getVisioUrl

        public String getVisioUrl()
        Gets the URL that permits to perform the visio into an iframe.
        Returns:
        a string representing an URL.
      • getVisioDomainServer

        public String getVisioDomainServer()
        Gets the internal visio starter page that permits to perform the visio into an iframe.
        Returns:
        a string representing a domain server.
      • getVisioJwt

        public String getVisioJwt()
        Gets the JWT token in order to get rights to use the visio services.
        Returns:
        a string representing a JWT token.
      • isScreencastEnabled

        public boolean isScreencastEnabled()
        Indicates if the screencast is enabled.
        Returns:
        true of enabled, false otherwise.
      • getChatServerUrl

        public String getChatServerUrl()
        Gets the URL at which the chat server is listening.
        Returns:
        the chat server's URL.
      • isChatServerSafeUrl

        public boolean isChatServerSafeUrl()
        Is the URL given by getChatServerUrl() a safe one.

        In case it is, SSL validations of requests performed between Silverpeas's server and the XMPP server are bypassed.

        Returns:
        the chat server's URL.
      • getICEServer

        public String getICEServer()
        Gets the fully qualified hostname or the IP address of the ICE server listening for audio/video communications.
        Returns:
        the hostname or the IP address of the ICE server.
      • getRestApiUrl

        public String getRestApiUrl()
        Gets the fully qualified URL of the REST API of the XMPP server with which Silverpeas can use to create and to remove XMPP users accounts.
        Returns:
        the URL of the REST API published by the remote XMPP server.
      • getBOSHServiceUrl

        public String getBOSHServiceUrl()
        Gets the fully qualified URL of the BOSH service of the XMPP server which wich Silverpeas can use to establish XMPP communications through the web.
        Returns:
        the URL of the BOSH service provided by the remote XMPP server.
      • getWebsocketServiceUrl

        public String getWebsocketServiceUrl()
        Gets the fully qualified URL of the websocket service of the XMPP server which wich Silverpeas can use to establish XMPP communications through the web.
        Returns:
        the URL of the websocket service provided by the remote XMPP server.
      • getFileTransferServiceUrl

        public String getFileTransferServiceUrl()
        Gets the base URL of the HTTP file transfer service of the XMPP server.
        Returns:
        the URL of the file transfer service used by the XMPP server to transfer files between users.
      • getRestApiAuthToken

        public String getRestApiAuthToken()
        Gets the authorization token to use when communicating the REST API of the XMPP server.
        Returns:
        the authorization token of the XMPP server's REST API.
      • getExplicitMappedXmppDomain

        public String getExplicitMappedXmppDomain​(String silverpeasDomainId)
        Gets the XMPP domain mapped with the specified Silverpeas domain. If the given domain isn't mapped with any XMPP domain, then returns an empty string.
        Parameters:
        silverpeasDomainId - the unique identifier of a domain in Silverpeas. Can be null or empty in that case an empty string is returned.
        Returns:
        the XMPP domain mapped with the specified Silverpeas domain. If no XMPP domain mapping is defined for the given domain then returns an empty string.
      • getDefaultXmppDomain

        public String getDefaultXmppDomain()
        Gets the XMPP domain to use for any Silverpeas domains that have no mapping rule to a XMPP domain. If no such default XMPP domain is defined, then the Silverpeas domains with no mapping rule won't be mapped to a XMPP domain and hence the users of those domains won't have an XMPP account; the chat won't be enabled for them.
        Returns:
        default domain identifier as string.
      • getMappedXmppDomain

        public String getMappedXmppDomain​(String silverpeasDomainId)
        Gets the XMPP domain in the chat server that is mapped to the specified Silverpeas domain. If there is no explicit XMPP domain mapped to the given Silverpeas domain, then uses the default XMPP domain set in the chat service settings. If no such default XMPP domain is set, then returns an empty string.
        Parameters:
        silverpeasDomainId - the unique identifier of a user domain in Silverpeas.
        Returns:
        the XMPP domain that is explicitly or by default mapped to the given user domain in Silverpeas. If no mapping exists with the given domain in the chat service settings, then returns an empty string.
      • getAllowedUserGroups

        public List<String> getAllowedUserGroups()
        Gets all the user groups in Silverpeas that are allowed to use the chat service, id est the groups for which the chat is enabled. If no groups of users is defined, then an empty string is returned and the chat is enabled for all the groups in Silverpeas (default behaviour).
        Returns:
        an array of group identifiers or an empty array if all the groups are allowed.
      • getJidFormatPolicy

        public ChatSettings.JidFormatPolicy getJidFormatPolicy()
        Gets the policy on how the JID should be formatted. This policy applies only on the local part of the JID.
        Returns:
        the policy on how the local part of the JID should be formatted.
      • isChatEnabled

        public boolean isChatEnabled()
        Is the chat service enabled in Silverpeas?
        Returns:
        true if the chat service is explicitly enabled and if the chat service properties are set.