Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.contactlist.event
Class ProtoContactEvent

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

public class ProtoContactEvent
extends PropertyChangeEvent

Event delivered upon addition, removal or change of a protocol specific contact inside an existing meta contact.

Author:
Emil Ivov
See Also:
Serialized Form

Field Summary
static String PROTO_CONTACT_ADDED
          Indicates that the MetaContactEvent instance was triggered by the a protocol specific contact to a new MetaContact parent.
static String PROTO_CONTACT_MODIFIED
          Indicates that this event instance was triggered by changing a protocol specific contact in some way.
static String PROTO_CONTACT_MOVED
          Indicates that the MetaContactEvent instance was triggered by moving addition of a protocol specific contact to an existing MetaContact.
static String PROTO_CONTACT_REMOVED
          Indicates that the MetaContactEvent instance was triggered by the removal of a protocol specific contact from an existing MetaContact.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ProtoContactEvent(Contact source, String eventName, MetaContact oldParent, MetaContact newParent)
          Creates an instance of this ProtoContactEvent.
 
Method Summary
 MetaContact getNewParent()
          Returns the MetaContact that is parent of the source contact after the event occurred or null for a removed contact or when irrelevant.
 MetaContact getOldParent()
          Returns the MetaContact that was parent of the source contact before the event occurred or null for a new contact or when irrelevant.
 MetaContact getParent()
          Returns the MetaContact that is the most relevant parent of the source proto Contact.
 Contact getProtoContact()
          Returns the protoContact that this event is about.
 
Methods inherited from class java.beans.PropertyChangeEvent
getNewValue, getOldValue, getPropagationId, getPropertyName, setPropagationId
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTO_CONTACT_REMOVED

public static final String PROTO_CONTACT_REMOVED
Indicates that the MetaContactEvent instance was triggered by the removal of a protocol specific contact from an existing MetaContact.

See Also:
Constant Field Values

PROTO_CONTACT_ADDED

public static final String PROTO_CONTACT_ADDED
Indicates that the MetaContactEvent instance was triggered by the a protocol specific contact to a new MetaContact parent.

See Also:
Constant Field Values

PROTO_CONTACT_MOVED

public static final String PROTO_CONTACT_MOVED
Indicates that the MetaContactEvent instance was triggered by moving addition of a protocol specific contact to an existing MetaContact.

See Also:
Constant Field Values

PROTO_CONTACT_MODIFIED

public static final String PROTO_CONTACT_MODIFIED
Indicates that this event instance was triggered by changing a protocol specific contact in some way.

See Also:
Constant Field Values
Constructor Detail

ProtoContactEvent

public ProtoContactEvent(Contact source,
                         String eventName,
                         MetaContact oldParent,
                         MetaContact newParent)
Creates an instance of this ProtoContactEvent.

Parameters:
source - the proto Contact that this event is about.
eventName - the name of the event, one of the PROTO_CONTACT_XXX fields.
oldParent - the MetaContact that was parent of the source contact before the event occurred or null for a new contact or when irrelevant.
newParent - the MetaContact that is parent of the source contact after the event occurred or null for a removed contact or when irrelevant.
Method Detail

getProtoContact

public Contact getProtoContact()
Returns the protoContact that this event is about.

Returns:
he Contact that this event is about.

getOldParent

public MetaContact getOldParent()
Returns the MetaContact that was parent of the source contact before the event occurred or null for a new contact or when irrelevant.

Returns:
the MetaContact that was parent of the source contact before the event occurred or null for a new contact or when irrelevant.

getNewParent

public MetaContact getNewParent()
Returns the MetaContact that is parent of the source contact after the event occurred or null for a removed contact or when irrelevant.

Returns:
the MetaContact that is parent of the source contact after the event occurred or null for a removed contact or when irrelevant.

getParent

public MetaContact getParent()
Returns the MetaContact that is the most relevant parent of the source proto Contact. In the case of a moved or newly added Contact the method would return same as getNewParent() and would return the contact's old parent in the case of a PROTO_CONTACT_REMOVED event.

Returns:
the MetaContact that is most apt to be called parent to the source Contact.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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