T
- the type of the ProtocolProviderService implementation
providing the AbstractOperationSetContactCapabilities implementationpublic abstract class AbstractOperationSetContactCapabilities<T extends ProtocolProviderService> extends java.lang.Object implements OperationSetContactCapabilities
Modifier and Type | Field and Description |
---|---|
protected T |
parentProvider
The ProtocolProviderService which provides this
OperationSetContactCapabilities.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractOperationSetContactCapabilities(T parentProvider)
Initializes a new AbstractOperationSetContactCapabilities
instance which is to be provided by a specific
ProtocolProviderService implementation.
|
Modifier and Type | Method and Description |
---|---|
void |
addContactCapabilitiesListener(ContactCapabilitiesListener listener)
Registers a specific ContactCapabilitiesListener to be notified
about changes in the list of OperationSet capabilities of
Contacts.
|
protected void |
fireContactCapabilitiesEvent(Contact sourceContact,
int eventID,
java.util.Map<java.lang.String,? extends OperationSet> opSets)
Fires a new ContactCapabilitiesEvent to notify the registered
ContactCapabilitiesListeners that a specific Contact
has changed its list of OperationSet capabilities.
|
<U extends OperationSet> |
getOperationSet(Contact contact,
java.lang.Class<U> opsetClass)
Gets the OperationSet corresponding to the specified
Class and supported by the specified Contact.
|
protected <U extends OperationSet> |
getOperationSet(Contact contact,
java.lang.Class<U> opsetClass,
boolean online)
Gets the OperationSet corresponding to the specified
Class and supported by the specified Contact.
|
java.util.Map<java.lang.String,OperationSet> |
getSupportedOperationSets(Contact contact)
Gets the OperationSets supported by a specific Contact.
|
protected java.util.Map<java.lang.String,OperationSet> |
getSupportedOperationSets(Contact contact,
boolean online)
Gets the OperationSets supported by a specific Contact.
|
protected boolean |
isOnline(Contact contact)
Determines whether a specific Contact is online (in contrast to
offline).
|
void |
removeContactCapabilitiesListener(ContactCapabilitiesListener listener)
Unregisters a specific ContactCapabilitiesListener to no longer
be notified about changes in the list of OperationSet
capabilities of Contacts.
|
protected final T extends ProtocolProviderService parentProvider
protected AbstractOperationSetContactCapabilities(T parentProvider)
parentProvider
- the ProtocolProviderService implementation
which will provide the new instancepublic void addContactCapabilitiesListener(ContactCapabilitiesListener listener)
addContactCapabilitiesListener
in interface OperationSetContactCapabilities
listener
- the ContactCapabilitiesListener which is to be
notified about changes in the list of OperationSet capabilities
of ContactsOperationSetContactCapabilities.addContactCapabilitiesListener(
ContactCapabilitiesListener)
protected void fireContactCapabilitiesEvent(Contact sourceContact, int eventID, java.util.Map<java.lang.String,? extends OperationSet> opSets)
sourceContact
- the Contact which is the source/cause of
the event to be firedeventID
- the ID of the event to be fired which indicates the
specifics of the change of the list of OperationSet capabilities
of the specified sourceContact and the details of the eventopSets
- the new set of operation sets for the given source contactpublic <U extends OperationSet> U getOperationSet(Contact contact, java.lang.Class<U> opsetClass)
getSupportedOperationSets(Contact)
and returns the associated
OperationSet. Since the implementation is suboptimal due to the
temporary Map allocations and lookups, extenders are advised to
override getOperationSet(Contact, Class, boolean)
.getOperationSet
in interface OperationSetContactCapabilities
U
- the type extending OperationSet for which the
specified contact is to be checked whether it possesses it as a
capabilitycontact
- the Contact for which the opsetClass
capability is to be queriedopsetClass
- the OperationSet Class for which the
specified contact is to be checked whether it possesses it as a
capabilityOperationSetContactCapabilities.getOperationSet(Contact, Class)
protected <U extends OperationSet> U getOperationSet(Contact contact, java.lang.Class<U> opsetClass, boolean online)
getSupportedOperationSets(Contact)
and returns the associated
OperationSet. Since the implementation is suboptimal due to the
temporary Map allocations and lookups, extenders are advised to
override.U
- the type extending OperationSet for which the
specified contact is to be checked whether it possesses it as a
capabilitycontact
- the Contact for which the opsetClass
capability is to be queriedopsetClass
- the OperationSet Class for which the
specified contact is to be checked whether it possesses it as a
capabilityonline
- true if contact is online; otherwise,
falseOperationSetContactCapabilities.getOperationSet(Contact, Class)
public java.util.Map<java.lang.String,OperationSet> getSupportedOperationSets(Contact contact)
ProtocolProviderService.getSupportedOperationSets()
on
the associated ProtocolProviderService implementation. Extenders
have to override the default implementation of
getSupportedOperationSets(Contact, boolean)
in order to provide
actual capability detection for the specified contact.getSupportedOperationSets
in interface OperationSetContactCapabilities
contact
- the Contact for which the supported
OperationSet capabilities are to be retrievedOperationSetContactCapabilities.getSupportedOperationSets(Contact)
protected java.util.Map<java.lang.String,OperationSet> getSupportedOperationSets(Contact contact, boolean online)
ProtocolProviderService.getSupportedOperationSets()
on
the associated ProtocolProviderService implementation. Extenders
have to override the default implementation in order to provide actual
capability detection for the specified contact.contact
- the Contact for which the supported
OperationSet capabilities are to be retrievedonline
- true if contact is online; otherwise,
falseOperationSetContactCapabilities.getSupportedOperationSets(Contact)
protected boolean isOnline(Contact contact)
contact
- the Contact which is to be determines whether it
is onlinepublic void removeContactCapabilitiesListener(ContactCapabilitiesListener listener)
removeContactCapabilitiesListener
in interface OperationSetContactCapabilities
listener
- the ContactCapabilitiesListener which is to no
longer be notified about changes in the list of OperationSet
capabilities of ContactsOperationSetContactCapabilities.removeContactCapabilitiesListener(
ContactCapabilitiesListener)
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.