Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class CallPeerChangeEvent
extends PropertyChangeEvent

CallPeerChangeEvent-s are triggerred whenever a change occurs in a CallPeer. Dispatched events may be of one of the following types.

CALL_PEER_STATUS_CHANGE - indicates a change in the status of the peer.

CALL_PEER_DISPLAY_NAME_CHANGE - means that peer's displayName has changed

CALL_PEER_ADDRESS_CHANGE - means that peer's address has changed.

CALL_PEER_ADDRESS_CHANGE - means that the transport address of the peer (the one that we use to communicate with her) has changed.

CALL_PEER_IMAGE_CHANGE - peer updated photo.

Author:
Emil Ivov
See Also:
Serialized Form

Field Summary
static String CALL_PEER_ADDRESS_CHANGE
          An event type indicating that the corresponding event is caused by a change of the peer's address.
static String CALL_PEER_DISPLAY_NAME_CHANGE
          An event type indicating that the corresponding event is caused by a change of the peer's display name.
static String CALL_PEER_IMAGE_CHANGE
          An event type indicating that the corresponding event is caused by a change of the peer's photo/picture.
static String CALL_PEER_STATE_CHANGE
          An event type indicating that the corresponding event is caused by a change of the CallPeer's status.
static String CALL_PEER_TRANSPORT_ADDRESS_CHANGE
          An event type indicating that the corresponding event is caused by a change of the peer's address.
static int NORMAL_CALL_CLEARING
          Code indicating normal call clear.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CallPeerChangeEvent(CallPeer source, String type, Object oldValue, Object newValue)
          Creates a CallPeerChangeEvent with the specified source, type, oldValue and newValue.
CallPeerChangeEvent(CallPeer source, String type, Object oldValue, Object newValue, String reason)
          Creates a CallPeerChangeEvent with the specified source, type, oldValue and newValue.
CallPeerChangeEvent(CallPeer source, String type, Object oldValue, Object newValue, String reason, int reasonCode)
          Creates a CallPeerChangeEvent with the specified source, type, oldValue and newValue.
 
Method Summary
 String getEventType()
          Returns the type of this event.
 int getReasonCode()
          Returns a reason code for the event (may be -1).
 String getReasonString()
          Returns a reason string further explaining the event (may be null).
 CallPeer getSourceCallPeer()
          Returns the CallPeer that this event is about.
 String toString()
          Returns a String representation of this CallPeerChangeEvent.
 
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
 

Field Detail

CALL_PEER_STATE_CHANGE

public static final String CALL_PEER_STATE_CHANGE
An event type indicating that the corresponding event is caused by a change of the CallPeer's status.

See Also:
Constant Field Values

CALL_PEER_DISPLAY_NAME_CHANGE

public static final String CALL_PEER_DISPLAY_NAME_CHANGE
An event type indicating that the corresponding event is caused by a change of the peer's display name.

See Also:
Constant Field Values

CALL_PEER_ADDRESS_CHANGE

public static final String CALL_PEER_ADDRESS_CHANGE
An event type indicating that the corresponding event is caused by a change of the peer's address.

See Also:
Constant Field Values

CALL_PEER_TRANSPORT_ADDRESS_CHANGE

public static final String CALL_PEER_TRANSPORT_ADDRESS_CHANGE
An event type indicating that the corresponding event is caused by a change of the peer's address.

See Also:
Constant Field Values

CALL_PEER_IMAGE_CHANGE

public static final String CALL_PEER_IMAGE_CHANGE
An event type indicating that the corresponding event is caused by a change of the peer's photo/picture.

See Also:
Constant Field Values

NORMAL_CALL_CLEARING

public static final int NORMAL_CALL_CLEARING
Code indicating normal call clear.

See Also:
Constant Field Values
Constructor Detail

CallPeerChangeEvent

public CallPeerChangeEvent(CallPeer source,
                           String type,
                           Object oldValue,
                           Object newValue)
Creates a CallPeerChangeEvent with the specified source, type, oldValue and newValue.

Parameters:
source - the peer that produced the event.
type - the type of the event (i.e. address change, state change etc.).
oldValue - the value of the changed property before the event occurred
newValue - current value of the changed property.

CallPeerChangeEvent

public CallPeerChangeEvent(CallPeer source,
                           String type,
                           Object oldValue,
                           Object newValue,
                           String reason)
Creates a CallPeerChangeEvent with the specified source, type, oldValue and newValue.

Parameters:
source - the peer that produced the event.
type - the type of the event (i.e. address change, state change etc.).
oldValue - the value of the changed property before the event occurred
newValue - current value of the changed property.
reason - a string containing a human readable explanation for the reason that triggerred this event (may be null).

CallPeerChangeEvent

public CallPeerChangeEvent(CallPeer source,
                           String type,
                           Object oldValue,
                           Object newValue,
                           String reason,
                           int reasonCode)
Creates a CallPeerChangeEvent with the specified source, type, oldValue and newValue.

Parameters:
source - the peer that produced the event.
type - the type of the event (i.e. address change, state change etc.).
oldValue - the value of the changed property before the event occurred
newValue - current value of the changed property.
reason - a string containing a human readable explanation for the reason that triggered this event (may be null).
reasonCode - a code for the reason that triggered this event (may be -1 as not specified).
Method Detail

getEventType

public String getEventType()
Returns the type of this event.

Returns:
a string containing one of the following values: CALL_PEER_STATUS_CHANGE, CALL_PEER_DISPLAY_NAME_CHANGE, CALL_PEER_ADDRESS_CHANGE, CALL_PEER_IMAGE_CHANGE

toString

public String toString()
Returns a String representation of this CallPeerChangeEvent.

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

getSourceCallPeer

public CallPeer getSourceCallPeer()
Returns the CallPeer that this event is about.

Returns:
a reference to the CallPeer that is the source of this event.

getReasonString

public String getReasonString()
Returns a reason string further explaining the event (may be null). The string would be mostly used for events issued upon a CallPeerState transition that has led to a FAILED state.

Returns:
a reason string further explaining the event or null if no reason was set.

getReasonCode

public int getReasonCode()
Returns a reason code for the event (may be -1).

Returns:
a reason code for the event or -1 if no reason code was set.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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