Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol.event
Class ContactPresenceStatusChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by java.beans.PropertyChangeEvent
          extended by net.java.sip.communicator.service.protocol.event.ContactPresenceStatusChangeEvent
All Implemented Interfaces:
Serializable

public class ContactPresenceStatusChangeEvent
extends PropertyChangeEvent

Instances of this class represent a change in the status of a particular contact.

Author:
Emil Ivov
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ContactPresenceStatusChangeEvent(Contact source, ProtocolProviderService sourceProvider, ContactGroup parentGroup, PresenceStatus oldValue, PresenceStatus newValue)
          Creates an event instance indicating that the specified source contact has changed status from oldValue to newValue.
 
Method Summary
 PresenceStatus getNewStatus()
          Returns the status of the provider after this event took place.
 PresenceStatus getOldStatus()
          Returns the status of the provider before this event took place.
 ContactGroup getParentGroup()
          Returns (if applicable) the group containing the contact that cause this event.
 Contact getSourceContact()
          Returns the provider that the source contact belongs to.
 ProtocolProviderService getSourceProvider()
          Returns the provider that the source contact belongs to.
 String toString()
          Returns a String representation of this ContactPresenceStatusChangeEvent
 
Methods inherited from class java.beans.PropertyChangeEvent
getNewValue, getOldValue, getPropagationId, getPropertyName, setPropagationId
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContactPresenceStatusChangeEvent

public ContactPresenceStatusChangeEvent(Contact source,
                                        ProtocolProviderService sourceProvider,
                                        ContactGroup parentGroup,
                                        PresenceStatus oldValue,
                                        PresenceStatus newValue)
Creates an event instance indicating that the specified source contact has changed status from oldValue to newValue.

Parameters:
source - the provider that generated the event
sourceProvider - the protocol provider that the contact belongs to.
parentGroup - the group containing the contact that caused this event (to be set as null in cases where groups are not supported);
oldValue - the status the source countact was in before enetering the new state.
newValue - the status the source contact is currently in.
Method Detail

getSourceProvider

public ProtocolProviderService getSourceProvider()
Returns the provider that the source contact belongs to.

Returns:
the provider that the source contact belongs to.

getSourceContact

public Contact getSourceContact()
Returns the provider that the source contact belongs to.

Returns:
the provider that the source contact belongs to.

getOldStatus

public PresenceStatus getOldStatus()
Returns the status of the provider before this event took place.

Returns:
a PresenceStatus instance indicating the event the source provider was in before it entered its new state.

getNewStatus

public PresenceStatus getNewStatus()
Returns the status of the provider after this event took place. (i.e. at the time the event is being dispatched).

Returns:
a PresenceStatus instance indicating the event the source provider is in after the status change occurred.

getParentGroup

public ContactGroup getParentGroup()
Returns (if applicable) the group containing the contact that cause this event. In the case of a non persistent presence operation set this field is null.

Returns:
the ContactGroup (if there is one) containing the contact that caused the event.

toString

public String toString()
Returns a String representation of this ContactPresenceStatusChangeEvent

Overrides:
toString in class EventObject
Returns:
A a String representation of this ContactPresenceStatusChangeEvent.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.