public class ProtocolProviderServiceJabberImpl extends AbstractProtocolProviderService
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ProtocolProviderServiceJabberImpl.ConnectState
State for connect and login state.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GOOGLE_VOICE_DOMAIN
Google voice domain name.
|
static int |
SMACK_PACKET_REPLY_TIMEOUT
Smack packet reply timeout.
|
static java.lang.String |
URN_IETF_RFC_3264
Discovery Info URN for classic RFC3264-style Offer/Answer negotiation
with no support for Trickle ICE and low tolerance to transport/payload
separation.
|
static java.lang.String |
URN_REGISTER
URN for XEP-0077 inband registration
|
static java.lang.String |
URN_XMPP_IQ_VERSION
http://xmpp.org/extensions/xep-0092.html Software Version.
|
static java.lang.String |
URN_XMPP_JINGLE
Jingle's Discovery Info common URN.
|
static java.lang.String |
URN_XMPP_JINGLE_COIN
Jingle's Discovery Info URN for "XEP-298 :Delivering Conference
Information to Jingle Participants (Coin)" support.
|
static java.lang.String |
URN_XMPP_JINGLE_DTLS_SRTP
Jingle's Discovery Info URN for "XEP-0320: Use of DTLS-SRTP in
Jingle Sessions".
|
static java.lang.String |
URN_XMPP_JINGLE_ICE_UDP_1
Jingle's Discovery Info URN for ICE_UDP transport support.
|
static java.lang.String |
URN_XMPP_JINGLE_NODES
Jingle's Discovery Info URN for Jingle Nodes support.
|
static java.lang.String |
URN_XMPP_JINGLE_RAW_UDP_0
Jingle's Discovery Info URN for ICE_UDP transport support.
|
static java.lang.String |
URN_XMPP_JINGLE_RTP
Jingle's Discovery Info URN for RTP support.
|
static java.lang.String |
URN_XMPP_JINGLE_RTP_AUDIO
Jingle's Discovery Info URN for RTP support with audio.
|
static java.lang.String |
URN_XMPP_JINGLE_RTP_HDREXT
Jingle's Discovery Info URN for "XEP-0294: Jingle RTP Header Extensions
Negotiation" support.
|
static java.lang.String |
URN_XMPP_JINGLE_RTP_VIDEO
Jingle's Discovery Info URN for RTP support with video.
|
static java.lang.String |
URN_XMPP_JINGLE_RTP_ZRTP
Jingle's Discovery Info URN for ZRTP support with RTP.
|
static java.lang.String |
URN_XMPP_JINGLE_TRANSFER_0
Jingle's Discovery Info URN for "XEP-0251: Jingle Session Transfer"
support.
|
static java.lang.String |
VCARD_REPLY_TIMEOUT_PROPERTY
Property for vcard reply timeout.
|
BIND_RETRIES_DEFAULT_VALUE, BIND_RETRIES_PROPERTY_NAME
Constructor and Description |
---|
ProtocolProviderServiceJabberImpl() |
Modifier and Type | Method and Description |
---|---|
void |
disconnectAndCleanConnection()
Used to disconnect current connection and clean it.
|
AccountID |
getAccountID()
Returns the AccountID that uniquely identifies the account represented
by this instance of the ProtocolProviderService.
|
SecurityAuthority |
getAuthority()
Used when we need to re-register or someone needs to obtain credentials.
|
org.jivesoftware.smack.Connection |
getConnection()
Returns the Connectionopened by this provider
|
ScServiceDiscoveryManager |
getDiscoveryManager()
Returns the currently valid
ScServiceDiscoveryManager . |
java.lang.String |
getFullJid(Contact contact)
Returns the full jabber id (jid) corresponding to the given contact.
|
java.lang.String |
getFullJid(java.lang.String bareJid)
Returns the full jabber id (jid) corresponding to the given bare jid.
|
(package private) JabberStatusEnum |
getJabberStatusEnum()
Returns the current instance of JabberStatusEnum.
|
org.xmpp.jnodes.smack.SmackServiceNode |
getJingleNodesServiceNode()
Get the Jingle Nodes service.
|
java.lang.String |
getJitsiVideobridge()
Gets the entity ID of the first Jitsi Videobridge associated with
connection i.e. |
java.net.InetAddress |
getNextHop()
Returns the InetAddress that is most likely to be to be used
as a next hop when contacting our XMPP server.
|
java.lang.String |
getOurJID()
Returns our own Jabber ID.
|
ProtocolIcon |
getProtocolIcon()
Returns the jabber protocol icon.
|
java.lang.String |
getProtocolName()
Returns the short name of the protocol that the implementation of this
provider is based upon (like SIP, Jabber, ICQ/AIM, or others for
example).
|
RegistrationState |
getRegistrationState()
Returns the state of the registration of this protocol provider
|
(package private) javax.net.ssl.SSLSocket |
getSSLSocket()
Return the SSL socket (if TLS used).
|
TransportProtocol |
getTransportProtocol()
Returns the "transport" protocol of this instance used to carry the
control channel for the current protocol service.
|
(package private) UserCredentials |
getUserCredentials() |
protected void |
initialize(java.lang.String screenname,
JabberAccountID accountID)
Initialized the service implementation, and puts it in a sate where it
could interoperate with other services.
|
boolean |
isFeatureListSupported(java.lang.String jid,
java.lang.String... features)
Determines if the given list of features is supported by the
specified jabber id.
|
boolean |
isFeatureSupported(java.lang.String jid,
java.lang.String feature)
Determines if the given list of features is supported by the
specified jabber id.
|
boolean |
isGmailOrGoogleAppsAccount()
Returns true if our account is a Gmail or a Google Apps ones.
|
static boolean |
isGmailOrGoogleAppsAccount(java.lang.String domain)
Returns true if our account is a Gmail or a Google Apps ones.
|
boolean |
isInitialized()
Returns true if the provider service implementation is initialized and
ready for use by other services, and false otherwise.
|
boolean |
isSignalingTransportSecure()
Indicates if the XMPP transport channel is using a TLS secured socket.
|
void |
register(SecurityAuthority authority)
Starts the registration process.
|
(package private) void |
reregister(int authReasonCode)
Connects and logins again to the server.
|
void |
shutdown()
Makes the service implementation close all open sockets and release
any resources that it might have taken and prepare for
shutdown/garbage collection.
|
void |
startJingleNodesDiscovery()
Start auto-discovery of JingleNodes tracker/relays.
|
static void |
throwOperationFailedException(java.lang.String message,
int errorCode,
java.lang.Throwable cause,
Logger logger)
Logs a specific message and associated Throwable cause as an
error using the current Logger and then throws a new
OperationFailedException with the message, a specific error code
and the cause.
|
void |
unregister()
Ends the registration of this protocol provider with the service.
|
void |
unregister(boolean userRequest)
Ends the registration of this protocol provider with the service.
|
void |
unregisterInternal(boolean fireEvent)
Unregister and fire the event if requested
|
void |
unregisterInternal(boolean fireEvent,
boolean userRequest)
Unregister and fire the event if requested
|
boolean |
validateContactAddress(java.lang.String contactId,
java.util.List<java.lang.String> result)
Validates the node part of a JID and returns an error message if
applicable and a suggested correction.
|
addRegistrationStateChangeListener, addSupportedOperationSet, clearRegistrationStateChangeListener, clearSupportedOperationSet, fireRegistrationStateChanged, fireRegistrationStateChanged, getOperationSet, getProtocolDisplayName, getSupportedOperationSetClasses, getSupportedOperationSets, isRegistered, isRegistrationRequiredForCalling, removeRegistrationStateChangeListener, removeSupportedOperationSet, toString
public static final java.lang.String URN_XMPP_JINGLE
public static final java.lang.String URN_XMPP_JINGLE_RTP
public static final java.lang.String URN_XMPP_JINGLE_RTP_AUDIO
public static final java.lang.String URN_XMPP_JINGLE_RTP_VIDEO
public static final java.lang.String URN_XMPP_JINGLE_RTP_ZRTP
public static final java.lang.String URN_XMPP_JINGLE_RAW_UDP_0
public static final java.lang.String URN_XMPP_JINGLE_ICE_UDP_1
public static final java.lang.String URN_XMPP_JINGLE_NODES
public static final java.lang.String URN_XMPP_JINGLE_TRANSFER_0
public static final java.lang.String URN_XMPP_JINGLE_COIN
public static final java.lang.String URN_XMPP_JINGLE_DTLS_SRTP
public static final java.lang.String URN_IETF_RFC_3264
public static final java.lang.String URN_XMPP_IQ_VERSION
public static final java.lang.String URN_XMPP_JINGLE_RTP_HDREXT
public static final java.lang.String URN_REGISTER
public static final int SMACK_PACKET_REPLY_TIMEOUT
public static final java.lang.String VCARD_REPLY_TIMEOUT_PROPERTY
public static final java.lang.String GOOGLE_VOICE_DOMAIN
public RegistrationState getRegistrationState()
public void register(SecurityAuthority authority) throws OperationFailedException
authority
- the security authority that will be used for resolving
any security challenges that may be returned during the
registration or at any moment while we're registered.OperationFailedException
- with the corresponding code it the
registration fails for some reason (e.g. a networking error or an
implementation problem).void reregister(int authReasonCode)
authReasonCode
- indicates the reason of the re-authentication.public boolean isSignalingTransportSecure()
public TransportProtocol getTransportProtocol()
public void disconnectAndCleanConnection()
public void unregister()
public void unregister(boolean userRequest)
unregister
in interface ProtocolProviderService
unregister
in class AbstractProtocolProviderService
userRequest
- is the unregister by user request.public void unregisterInternal(boolean fireEvent)
fireEvent
- booleanpublic void unregisterInternal(boolean fireEvent, boolean userRequest)
fireEvent
- booleanpublic java.lang.String getProtocolName()
protected void initialize(java.lang.String screenname, JabberAccountID accountID)
screenname
- the account id/uin/screenname of the account that
we're about to createaccountID
- the identifier of the account that this protocol
provider represents.AccountID
public void shutdown()
public boolean isInitialized()
public AccountID getAccountID()
public boolean validateContactAddress(java.lang.String contactId, java.util.List<java.lang.String> result)
validateContactAddress
in interface ProtocolProviderService
validateContactAddress
in class AbstractProtocolProviderService
contactId
- the contact identifier to validateresult
- Must be supplied as an empty a list. Implementors add
items:
public org.jivesoftware.smack.Connection getConnection()
public ProtocolIcon getProtocolIcon()
JabberStatusEnum getJabberStatusEnum()
public boolean isFeatureListSupported(java.lang.String jid, java.lang.String... features)
jid
- the jabber id for which to checkfeatures
- the list of features to check forpublic boolean isFeatureSupported(java.lang.String jid, java.lang.String feature)
jid
- the jabber id that we'd like to get information aboutfeature
- the feature to check forpublic java.lang.String getFullJid(Contact contact)
contact
- the contact, for which we're looking for a jidpublic java.lang.String getFullJid(java.lang.String bareJid)
bareJid
- the bare contact address (i.e. no resource) whose full
jid we are looking for.public ScServiceDiscoveryManager getDiscoveryManager()
ScServiceDiscoveryManager
.ScServiceDiscoveryManager
.public java.lang.String getOurJID()
public java.net.InetAddress getNextHop() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if we don't have a valid server.public void startJingleNodesDiscovery()
public org.xmpp.jnodes.smack.SmackServiceNode getJingleNodesServiceNode()
public static void throwOperationFailedException(java.lang.String message, int errorCode, java.lang.Throwable cause, Logger logger) throws OperationFailedException
message
- the message to be logged and then wrapped in a new
OperationFailedExceptionerrorCode
- the error code to be assigned to the new
OperationFailedExceptioncause
- the Throwable that has caused the necessity to log
an error and have a new OperationFailedException thrownlogger
- the logger that we'd like to log the error message
and cause.OperationFailedException
- the exception that we wanted this method
to throw.public SecurityAuthority getAuthority()
UserCredentials getUserCredentials()
public boolean isGmailOrGoogleAppsAccount()
public static boolean isGmailOrGoogleAppsAccount(java.lang.String domain)
domain
- domain to checkpublic java.lang.String getJitsiVideobridge()
connection
i.e. provided by the serviceName of
connection.javax.net.ssl.SSLSocket getSSLSocket()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.