Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class SubscriptionMovedEvent
extends EventObject

Events of this class represent the fact that a server stored subscription/contact has been moved from one server stored group to another. Such events are only generated by implementations of OperationSetPersistentPresence as non persistent presence operation sets do not support the notion of server stored groups.

Author:
Emil Ivov
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
SubscriptionMovedEvent(Contact sourceContact, ProtocolProviderService sourceProvider, ContactGroup oldParent, ContactGroup newParent)
          Creates an event instance with the specified source contact and old and new parent.
 
Method Summary
 ContactGroup getNewParentGroup()
          Returns a reference to the ContactGroup that currently contains the source contact.
 ContactGroup getOldParentGroup()
          Returns a reference to the ContactGroup that contained the source contact before it was moved.
 Contact getSourceContact()
          Returns a reference to the contact that has been moved.
 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.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubscriptionMovedEvent

public SubscriptionMovedEvent(Contact sourceContact,
                              ProtocolProviderService sourceProvider,
                              ContactGroup oldParent,
                              ContactGroup newParent)
Creates an event instance with the specified source contact and old and new parent.

Parameters:
sourceContact - the Contact that has been moved.
sourceProvider - a reference to the ProtocolProviderService that the source Contact belongs to.
oldParent - the ContactGroup that has previously been the parent
newParent - the new ContactGroup parent of sourceContact
Method Detail

getSourceContact

public Contact getSourceContact()
Returns a reference to the contact that has been moved.

Returns:
a reference to the Contact that has been moved.

getOldParentGroup

public ContactGroup getOldParentGroup()
Returns a reference to the ContactGroup that contained the source contact before it was moved.

Returns:
a reference to the previous ContactGroup parent of the source Contact.

getNewParentGroup

public ContactGroup getNewParentGroup()
Returns a reference to the ContactGroup that currently contains the source contact.

Returns:
a reference to the current ContactGroup parent of the source Contact.

getSourceProvider

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

Returns:
the provider that the source contact belongs to.

toString

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

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

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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