public class UserNameManager extends Object
User
name is used. For remote entities the following logic
is used:
UserNameProvider
is registered for the entity's domain. If a provider
was found then use it to get the entity's nameModifier and Type | Method and Description |
---|---|
static void |
addUserNameProvider(String domain,
UserNameProvider provider)
Adds the specified
UserNameProvider as the provider of users of the specified domain. |
static String |
getUserName(org.xmpp.packet.JID entity)
Returns the name of the XMPP entity.
|
static String |
getUserName(org.xmpp.packet.JID entity,
String defaultName)
Returns the name of the XMPP entity.
|
static void |
removeUserNameProvider(String domain)
Removes any
UserNameProvider that was associated with the specified domain. |
public static void addUserNameProvider(String domain, UserNameProvider provider)
UserNameProvider
as the provider of users of the specified domain.domain
- the domain hosted by the UserNameProvider.provider
- the provider that will provide the name of users in the specified domain.public static void removeUserNameProvider(String domain)
UserNameProvider
that was associated with the specified domain.domain
- the domain hosted by a UserNameProvider.public static String getUserName(org.xmpp.packet.JID entity) throws UserNotFoundException
entity
- the JID of the entity to get its name.UserNotFoundException
- if the jid belongs to the local server but no user was
found for that jid.public static String getUserName(org.xmpp.packet.JID entity, String defaultName) throws UserNotFoundException
entity
- the JID of the entity to get its name.defaultName
- default name to return when no name was found.UserNotFoundException
- if the jid belongs to the local server but no user was
found for that jid.Copyright © 2003–2020 Ignite Realtime. All rights reserved.