public abstract class AbstractOperationSetPersistentPresence<T extends ProtocolProviderService> extends java.lang.Object implements OperationSetPersistentPresence
Modifier and Type | Field and Description |
---|---|
protected T |
parentProvider
The provider that created us.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractOperationSetPersistentPresence(T parentProvider)
Initializes a new AbstractOperationSetPersistentPresence
instance created by a specific ProtocolProviderService .
|
Modifier and Type | Method and Description |
---|---|
void |
addContactPresenceStatusListener(ContactPresenceStatusListener listener)
Implementation of the corresponding ProtocolProviderService
method.
|
void |
addProviderPresenceStatusListener(ProviderPresenceStatusListener listener)
Adds a listener that would receive events upon changes of the provider
presence status.
|
void |
addServerStoredGroupChangeListener(ServerStoredGroupListener listener)
Registers a listener that would receive events upon changes in server
stored groups.
|
void |
addSubscriptionListener(SubscriptionListener listener)
Registers a listener that would get notifications any time a new
subscription was successfully added, has failed or was removed.
|
protected void |
fireContactPresenceStatusChangeEvent(Contact source,
ContactGroup parentGroup,
PresenceStatus oldValue)
Notifies all registered listeners of the new event.
|
void |
fireContactPresenceStatusChangeEvent(Contact source,
ContactGroup parentGroup,
PresenceStatus oldValue,
PresenceStatus newValue) |
void |
fireContactPresenceStatusChangeEvent(Contact source,
ContactGroup parentGroup,
PresenceStatus oldValue,
PresenceStatus newValue,
boolean isResourceChange) |
void |
fireContactPropertyChangeEvent(java.lang.String eventID,
Contact source,
java.lang.Object oldValue,
java.lang.Object newValue)
Notify all subscription listeners of the corresponding contact property
change event.
|
protected void |
fireProviderStatusChangeEvent(PresenceStatus oldValue)
Notifies all registered listeners of the new event.
|
protected void |
fireProviderStatusChangeEvent(PresenceStatus oldValue,
PresenceStatus newValue)
Notify all provider presence listeners of the corresponding event change
|
protected void |
fireProviderStatusMessageChangeEvent(java.lang.String oldStatusMessage,
java.lang.String newStatusMessage)
Notify all provider presence listeners that a new status message has been
set.
|
protected void |
fireServerStoredGroupEvent(ContactGroup source,
int eventID)
Notifies all registered listeners of the new event.
|
void |
fireSubscriptionEvent(Contact source,
ContactGroup parentGroup,
int eventID)
Notifies all registered listeners of the new event.
|
void |
fireSubscriptionEvent(Contact source,
ContactGroup parentGroup,
int eventID,
int errorCode,
java.lang.String errorReason) |
void |
fireSubscriptionMovedEvent(Contact source,
ContactGroup oldParent,
ContactGroup newParent)
Notifies all registered listeners of the new event.
|
Contact |
getLocalContact()
Returns the protocol specific contact instance representing the local
user or null if it is not supported.
|
void |
removeContactPresenceStatusListener(ContactPresenceStatusListener listener)
Removes the specified listener so that it won't receive any further
updates on contact presence status changes
|
void |
removeProviderPresenceStatusListener(ProviderPresenceStatusListener listener)
Unregisters the specified listener so that it does not receive further
events upon changes in local presence status.
|
void |
removeServerStoredGroupChangeListener(ServerStoredGroupListener listener)
Removes the specified group change listener so that it won't receive
any further events.
|
void |
removeSubscriptionListener(SubscriptionListener listener)
Removes the specified subscription listener.
|
void |
setDisplayName(Contact contact,
java.lang.String newName)
Sets the display name for contact to be newName.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createServerStoredContactGroup, createUnresolvedContact, createUnresolvedContactGroup, getServerStoredContactListRoot, moveContactToGroup, removeServerStoredContactGroup, renameServerStoredContactGroup, subscribe, subscribe, unsubscribe
createUnresolvedContact, findContactByID, getCurrentStatusMessage, getPresenceStatus, getSupportedStatusSet, publishPresenceStatus, queryContactStatus, setAuthorizationHandler
protected final T extends ProtocolProviderService parentProvider
protected AbstractOperationSetPersistentPresence(T parentProvider)
parentProvider
- the ProtocolProviderService which created
the new instancepublic void addContactPresenceStatusListener(ContactPresenceStatusListener listener)
addContactPresenceStatusListener
in interface OperationSetPresence
listener
- a presence status listener.public void addProviderPresenceStatusListener(ProviderPresenceStatusListener listener)
addProviderPresenceStatusListener
in interface OperationSetPresence
listener
- the listener to register for changes in our PresenceStatus.public void addServerStoredGroupChangeListener(ServerStoredGroupListener listener)
addServerStoredGroupChangeListener
in interface OperationSetPersistentPresence
listener
- a ServerStoredGroupChangeListener impl that would receive
events upon group changes.public void addSubscriptionListener(SubscriptionListener listener)
OperationSetPresence
addSubscriptionListener
in interface OperationSetPresence
listener
- the SubscriptionListener to registerprotected void fireContactPresenceStatusChangeEvent(Contact source, ContactGroup parentGroup, PresenceStatus oldValue)
source
- the contact that has caused the event.parentGroup
- the group that contains the source contact.oldValue
- the status that the source contact detained before
changing it.public void fireContactPresenceStatusChangeEvent(Contact source, ContactGroup parentGroup, PresenceStatus oldValue, PresenceStatus newValue)
public void fireContactPresenceStatusChangeEvent(Contact source, ContactGroup parentGroup, PresenceStatus oldValue, PresenceStatus newValue, boolean isResourceChange)
public void fireContactPropertyChangeEvent(java.lang.String eventID, Contact source, java.lang.Object oldValue, java.lang.Object newValue)
eventID
- the String ID of the event to dispatchsource
- the ContactJabberImpl instance that this event is
pertaining to.oldValue
- the value that the changed property had before the change
occurred.newValue
- the value that the changed property currently has (after
the change has occurred).protected void fireProviderStatusChangeEvent(PresenceStatus oldValue)
oldValue
- the presence status we were in before the change.protected void fireProviderStatusChangeEvent(PresenceStatus oldValue, PresenceStatus newValue)
oldValue
- the status our stack had so farnewValue
- the status we have from now onprotected void fireProviderStatusMessageChangeEvent(java.lang.String oldStatusMessage, java.lang.String newStatusMessage)
oldStatusMessage
- the status message our stack had so farnewStatusMessage
- the status message we have from now onprotected void fireServerStoredGroupEvent(ContactGroup source, int eventID)
source
- the contact that has caused the event.eventID
- an identifier of the event to dispatch.public void fireSubscriptionEvent(Contact source, ContactGroup parentGroup, int eventID)
source
- the contact that has caused the event.parentGroup
- the group that contains the source contact.eventID
- an identifier of the event to dispatch.public void fireSubscriptionEvent(Contact source, ContactGroup parentGroup, int eventID, int errorCode, java.lang.String errorReason)
public void fireSubscriptionMovedEvent(Contact source, ContactGroup oldParent, ContactGroup newParent)
source
- the contact that has been moved..oldParent
- the group where the contact was located before being
moved.newParent
- the group where the contact has been moved.public void removeContactPresenceStatusListener(ContactPresenceStatusListener listener)
removeContactPresenceStatusListener
in interface OperationSetPresence
listener
- the listener to remove.public void removeProviderPresenceStatusListener(ProviderPresenceStatusListener listener)
removeProviderPresenceStatusListener
in interface OperationSetPresence
listener
- ProviderPresenceStatusListenerpublic void removeServerStoredGroupChangeListener(ServerStoredGroupListener listener)
removeServerStoredGroupChangeListener
in interface OperationSetPersistentPresence
listener
- the ServerStoredGroupChangeListener to removepublic void removeSubscriptionListener(SubscriptionListener listener)
removeSubscriptionListener
in interface OperationSetPresence
listener
- the listener to remove.public void setDisplayName(Contact contact, java.lang.String newName) throws java.lang.IllegalArgumentException
setDisplayName
in interface OperationSetPersistentPresence
contact
- the Contact that we are renamingnewName
- a String containing the new display name for
metaContact.java.lang.IllegalArgumentException
- if contact is not an
instance that belongs to the underlying implementation.public Contact getLocalContact()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.