public abstract class AbstractProtocolProviderService extends java.lang.Object implements ProtocolProviderService
BIND_RETRIES_DEFAULT_VALUE, BIND_RETRIES_PROPERTY_NAME
Constructor and Description |
---|
AbstractProtocolProviderService() |
Modifier and Type | Method and Description |
---|---|
void |
addRegistrationStateChangeListener(RegistrationStateChangeListener listener)
Registers the specified listener with this provider so that it would
receive notifications on changes of its state or other properties such
as its local address and display name.
|
protected <T extends OperationSet> |
addSupportedOperationSet(java.lang.Class<T> opsetClass,
T opset)
Adds a specific OperationSet implementation to the set of
supported OperationSets of this instance.
|
void |
clearRegistrationStateChangeListener()
Clear all registration state change listeners.
|
protected void |
clearSupportedOperationSet()
Removes all OperationSet implementation from the set of
supported OperationSets for this instance.
|
void |
fireRegistrationStateChanged(RegistrationState oldState,
RegistrationState newState,
int reasonCode,
java.lang.String reason)
Creates a RegistrationStateChange event corresponding to the specified
old and new states and notifies all currently registered listeners.
|
void |
fireRegistrationStateChanged(RegistrationState oldState,
RegistrationState newState,
int reasonCode,
java.lang.String reason,
boolean userRequest)
Creates a RegistrationStateChange event corresponding to the specified
old and new states and notifies all currently registered listeners.
|
<T extends OperationSet> |
getOperationSet(java.lang.Class<T> opsetClass)
Returns the operation set corresponding to the specified class or null if
this operation set is not supported by the provider implementation.
|
java.lang.String |
getProtocolDisplayName()
Returns the protocol display name.
|
java.util.Collection<java.lang.Class<? extends OperationSet>> |
getSupportedOperationSetClasses()
Returns a collection containing all operation sets classes supported by
the current implementation.
|
java.util.Map<java.lang.String,OperationSet> |
getSupportedOperationSets()
Returns an array containing all operation sets supported by the current
implementation.
|
boolean |
isRegistered()
Indicates whether or not this provider is registered
|
boolean |
isRegistrationRequiredForCalling()
Indicates whether or not this provider must registered
when placing outgoing calls.
|
void |
removeRegistrationStateChangeListener(RegistrationStateChangeListener listener)
Removes the specified registration state change listener so that it does
not receive any further notifications upon changes of the
RegistrationState of this provider.
|
protected <T extends OperationSet> |
removeSupportedOperationSet(java.lang.Class<T> opsetClass)
Removes an OperationSet implementation from the set of
supported OperationSets for this instance.
|
java.lang.String |
toString()
A clear display for ProtocolProvider when its printed in logs.
|
void |
unregister(boolean userRequest)
Ends the registration of this protocol provider with the current
registration service.
|
boolean |
validateContactAddress(java.lang.String contactId,
java.util.List<java.lang.String> result)
Default implementation that always returns true.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAccountID, getProtocolIcon, getProtocolName, getRegistrationState, getTransportProtocol, isSignalingTransportSecure, register, shutdown, unregister
public void addRegistrationStateChangeListener(RegistrationStateChangeListener listener)
addRegistrationStateChangeListener
in interface ProtocolProviderService
listener
- the listener to register.protected <T extends OperationSet> void addSupportedOperationSet(java.lang.Class<T> opsetClass, T opset)
supportedOperationSets
which works with class
names instead of Class and also shortens the code which performs
such additions.T
- the exact type of the OperationSet implementation to
be addedopsetClass
- the Class of OperationSet under the
name of which the specified implementation is to be addedopset
- the OperationSet implementation to be addedprotected <T extends OperationSet> void removeSupportedOperationSet(java.lang.Class<T> opsetClass)
T
- the exact type of the OperationSet implementation to
be addedopsetClass
- the Class of OperationSet under the
name of which the specified implementation is to be addedprotected void clearSupportedOperationSet()
public void fireRegistrationStateChanged(RegistrationState oldState, RegistrationState newState, int reasonCode, java.lang.String reason)
oldState
- the state that the provider had before the change
occurrednewState
- the state that the provider is currently in.reasonCode
- a value corresponding to one of the REASON_XXX fields
of the RegistrationStateChangeEvent class, indicating the reason for
this state transition.reason
- a String further explaining the reason code or null if
no such explanation is necessary.public void fireRegistrationStateChanged(RegistrationState oldState, RegistrationState newState, int reasonCode, java.lang.String reason, boolean userRequest)
oldState
- the state that the provider had before the change
occurrednewState
- the state that the provider is currently in.reasonCode
- a value corresponding to one of the REASON_XXX fields
of the RegistrationStateChangeEvent class, indicating the reason for
this state transition.reason
- a String further explaining the reason code or null if
no such explanation is necessary.userRequest
- is the event by user request.public <T extends OperationSet> T getOperationSet(java.lang.Class<T> opsetClass)
getOperationSet
in interface ProtocolProviderService
T
- the exact type of the OperationSet that we're looking
foropsetClass
- the Class of the operation set that we're
looking for.public java.lang.String getProtocolDisplayName()
getProtocolDisplayName
in interface ProtocolProviderService
public boolean validateContactAddress(java.lang.String contactId, java.util.List<java.lang.String> result)
validateContactAddress
in interface ProtocolProviderService
contactId
- ignored.result
- ignoredpublic java.util.Map<java.lang.String,OperationSet> getSupportedOperationSets()
getSupportedOperationSets
in interface ProtocolProviderService
public java.util.Collection<java.lang.Class<? extends OperationSet>> getSupportedOperationSetClasses()
getSupportedOperationSetClasses
in interface ProtocolProviderService
Collection
containing instances of all supported
operation set classes (e.g. OperationSetPresence.class.public boolean isRegistered()
isRegistered
in interface ProtocolProviderService
public boolean isRegistrationRequiredForCalling()
isRegistrationRequiredForCalling
in interface ProtocolProviderService
public void removeRegistrationStateChangeListener(RegistrationStateChangeListener listener)
removeRegistrationStateChangeListener
in interface ProtocolProviderService
listener
- the listener to register for
RegistrationStateChangeEvents.public void clearRegistrationStateChangeListener()
public java.lang.String toString()
toString
in class java.lang.Object
public void unregister(boolean userRequest) throws OperationFailedException
unregister
in interface ProtocolProviderService
userRequest
- is the unregister by user request.OperationFailedException
- with the corresponding code it the
registration fails for some reason (e.g. a networking error or an
implementation problem).
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.