Class MucClientConfiguration
-
- All Implemented Interfaces:
public class MucClientConfigurationRepresents the configuration of a MucClient.
Boris Grozev
-
-
Field Summary
Fields Modifier and Type Field Description public static StringHOSTNAMEpublic static StringPORTpublic static StringDOMAINpublic static StringUSERNAMEpublic static StringPASSWORDpublic static StringMUC_JIDSpublic static StringMUC_NICKNAMEpublic static StringDISABLE_CERTIFICATE_VERIFICATIONpublic static StringIQ_HANDLER_MODEpublic static StringSECURITY_MODEpublic final Stringid
-
Constructor Summary
Constructors Constructor Description MucClientConfiguration(String id)Initializes a new MucClientConfiguration instance.
-
Method Summary
Modifier and Type Method Description StringgetId()static Collection<MucClientConfiguration>loadFromConfigService(ConfigurationService config, String prefix, boolean removeIncomplete)Loads a list of MucClientConfiguration objects based on properties read from a ConfigurationService with a given prefix.static Collection<MucClientConfiguration>loadFromMap(Map<String, String> properties, String prefix, boolean removeIncomplete)Loads a list of MucClientConfiguration objects based on properties in a Map with a given prefix.StringgetHostname()voidsetHostname(String hostname)Sets the hostname (i.e. StringgetPort()voidsetPort(String port)Sets the XMPP server's port. StringgetDomain()voidsetDomain(String domain)Sets the XMPP domain. StringgetUsername()voidsetUsername(String username)Sets the username to use to authenticate to the XMPP server. StringgetPassword()voidsetPassword(String password)Sets the password to use to authenticate to the XMPP server. List<String>getMucJids()voidsetMucJids(List<String> mucJids)Sets the list of JIDs of the MUCs to join. StringgetMucNickname()voidsetMucNickname(String mucNickname)Sets the nickname to use when joining the MUCs. booleangetDisableCertificateVerification()voidsetDisableCertificateVerification(boolean disableCertificateVerification)Sets whether TLS certificate verification should be disabled. StringgetIqHandlerMode()voidsetIqHandlerMode(String iqHandlerMode)Sets string which represents the mode (sync or async) to use for the smack IQ request handler. ConnectionConfiguration.SecurityModegetSecurityMode()Gets the security mode for the Smack XMPP connection. voidsetSecurityMode(ConnectionConfiguration.SecurityMode securityMode)Sets the security mode ("required", "ifpossible", or "disabled") for the Smack XMPP connection, or null for the default behavior. booleanisComplete()Checks whether this MucClientConfiguration has all of the required properties. voidsetProperty(String name, String value)Sets a property. StringtoString()-
-
Constructor Detail
-
MucClientConfiguration
MucClientConfiguration(String id)
Initializes a new MucClientConfiguration instance.- Parameters:
id- the ID.
-
-
Method Detail
-
getId
String getId()
- Returns:
the ID of this MucClientManager.
-
loadFromConfigService
static Collection<MucClientConfiguration> loadFromConfigService(ConfigurationService config, String prefix, boolean removeIncomplete)
Loads a list of MucClientConfiguration objects based on properties read from a ConfigurationService with a given
prefix. See loadFromMap for the format of the properties.- Parameters:
config- the ConfigurationService to read properties from.prefix- the prefix for property names.removeIncomplete- whether to remove any incomplete (see isComplete) entries from the returned collection, or to return all of them regardless.- Returns:
a list of MucClientConfigurations described by properties in
configwith a prefix ofprefix.
-
loadFromMap
static Collection<MucClientConfiguration> loadFromMap(Map<String, String> properties, String prefix, boolean removeIncomplete)
Loads a list of MucClientConfiguration objects based on properties in a Map with a given
prefix. The properties can be described with map entries like this for an ID of "": PREFIX.HOSTNAME=hostname1 PREFIX.DOMAIN=domain Or like this for an ID of "id1": PREFIX.id1.HOSTNAME=hostname2 PREFIX.id1.USERNAME=user- Parameters:
properties- the Map which contains the properties.prefix- the common prefix (to be ignored) for the keys in the map.removeIncomplete- whether to remove any incomplete (see isComplete) entries from the returned collection, or to return all of them regardless.- Returns:
a list of MucClientConfigurations described by the entries of
propertieswith a prefix ofprefix.
-
getHostname
String getHostname()
- Returns:
the hostname (i.e. the address to connect to).
-
setHostname
void setHostname(String hostname)
Sets the hostname (i.e. the address to connect to).
- Parameters:
hostname- the hostname
-
setPort
void setPort(String port)
Sets the XMPP server's port.
- Parameters:
port- the XMPP server's port
-
setDomain
void setDomain(String domain)
Sets the XMPP domain.
- Parameters:
domain- the domain to set.
-
getUsername
String getUsername()
- Returns:
the username to use to authenticate to the XMPP server.
-
setUsername
void setUsername(String username)
Sets the username to use to authenticate to the XMPP server.
-
getPassword
String getPassword()
- Returns:
the password to use to authenticate to the XMPP server.
-
setPassword
void setPassword(String password)
Sets the password to use to authenticate to the XMPP server.
-
getMucJids
List<String> getMucJids()
- Returns:
the JID of the MUC to join, e.g. "JvbBrewery@conference.example.com,JigasiBrewery@conference.example.com"
-
setMucJids
void setMucJids(List<String> mucJids)
Sets the list of JIDs of the MUCs to join.
- Parameters:
mucJids- the list of full JIDs of the MUCs to join.
-
getMucNickname
String getMucNickname()
- Returns:
the nickname to use when joining the MUCs.
-
setMucNickname
void setMucNickname(String mucNickname)
Sets the nickname to use when joining the MUCs.
- Parameters:
mucNickname- the nickname.
-
getDisableCertificateVerification
boolean getDisableCertificateVerification()
- Returns:
whether TLS certificate verification should be disabled.
-
setDisableCertificateVerification
void setDisableCertificateVerification(boolean disableCertificateVerification)
Sets whether TLS certificate verification should be disabled.
- Parameters:
disableCertificateVerification- whether to disable TLS certificate verification.
-
getIqHandlerMode
String getIqHandlerMode()
- Returns:
a string which represents the mode (sync or async) to use for the smack IQ request handler.
-
setIqHandlerMode
void setIqHandlerMode(String iqHandlerMode)
Sets string which represents the mode (sync or async) to use for the smack IQ request handler.
-
getSecurityMode
ConnectionConfiguration.SecurityMode getSecurityMode()
Gets the security mode for the Smack XMPP connection.
-
setSecurityMode
void setSecurityMode(ConnectionConfiguration.SecurityMode securityMode)
Sets the security mode ("required", "ifpossible", or "disabled") for the Smack XMPP connection, or null for the default behavior.
-
isComplete
boolean isComplete()
Checks whether this MucClientConfiguration has all of the required properties.
- Returns:
trueif all required properties are set, andfalseotherwise.
-
setProperty
void setProperty(String name, String value)
Sets a property.
- Parameters:
name- the name of the property.value- the value to set.
-
-
-
-