Package org.silverpeas.core.chat
Class ChatSettings
- java.lang.Object
-
- org.silverpeas.core.chat.ChatSettings
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ChatSettings.ChatACL
ACL on the behaviour of the chat client.static class
ChatSettings.JidFormatPolicy
-
Constructor Summary
Constructors Modifier Constructor Description protected
ChatSettings()
Constructs a new object wrapping all the settings on the Silverpeas chat service.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
clearMessagesOnReconnection()
Indicates if messages MUST be cleared after a user reconnection.static ChatSettings
get()
Gets an instance of theChatSettings
class.ChatSettings.ChatACL
getACL()
Gets the ACL on the chat client.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.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.String
getChatServerUrl()
Gets the URL at which the chat server is listening.String
getDefaultXmppDomain()
Gets the XMPP domain to use for any Silverpeas domains that have no mapping rule to a XMPP domain.String
getExplicitMappedXmppDomain(String silverpeasDomainId)
Gets the XMPP domain mapped with the specified Silverpeas domain.String
getFileTransferServiceUrl()
Gets the base URL of the HTTP file transfer service of the XMPP server.String
getICEServer()
Gets the fully qualified hostname or the IP address of the ICE server listening for audio/video communications.ChatSettings.JidFormatPolicy
getJidFormatPolicy()
Gets the policy on how the JID should be formatted.String
getMappedXmppDomain(String silverpeasDomainId)
Gets the XMPP domain in the chat server that is mapped to the specified Silverpeas domain.int
getMaxCachedMsgThresholdPerRoom()
Gets for a room the threshold of cached messages over that the messages are clean from the web browser storage.String
getRestApiAuthToken()
Gets the authorization token to use when communicating the REST API of the XMPP server.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.String
getSilverpeasChatClientId()
Gets the identifier of the chat client from point of view of Silverpeas server.String
getVisioDomainServer()
Gets the internal visio starter page that permits to perform the visio into an iframe.String
getVisioJwt()
Gets the JWT token in order to get rights to use the visio services.String
getVisioUrl()
Gets the URL that permits to perform the visio into an iframe.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.boolean
isChatEnabled()
Is the chat service enabled in Silverpeas?boolean
isChatServerSafeUrl()
Is the URL given bygetChatServerUrl()
a safe one.boolean
isReactionToEnabled()
Indicates if the 'reaction to' message is enabled.boolean
isReplyToEnabled()
Indicates if the 'reply to' message is enabled.boolean
isScreencastEnabled()
Indicates if the screencast is enabled.boolean
isVisioEnabled()
Indicates if the visio conference is enabled.
-
-
-
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.
-
get
public static ChatSettings get()
Gets an instance of theChatSettings
class.- Returns:
- a
ChatSettings
instance.
-
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 bygetChatServerUrl()
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.
-
getACL
public ChatSettings.ChatACL getACL()
Gets the ACL on the chat client.- Returns:
- a
ChatSettings.ChatACL
instance representing the ACL configured in the use of the chat client.
-
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.
-
-