Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class CallEvent
extends EventObject

An event class representing that an incoming or an outgoing call has been created. The event id indicates the exact reason for this event.

Author:
Emil Ivov
See Also:
Serialized Form

Field Summary
static int CALL_ENDED
          An event id value indicating that this event has been triggered as a result of a call being ended (all its peers have left).
static int CALL_INITIATED
          An event id value indicating that this event has been triggered as a result of an outgoing call.
static int CALL_RECEIVED
          An event id value indicating that this event has been triggered as a result of an incoming call.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CallEvent(Call call, int eventID)
          Creates an event instance indicating that an incoming/outgoing call has been created
 
Method Summary
 int getEventID()
          Returns an event ID int indicating whether this event was triggered by an outgoing or an incoming call.
 Map<MediaType,MediaDirection> getMediaDirections()
          Return the media directions map
 List<MediaType> getMediaTypes()
          Return the media types supported by this call, if information is available.
 Call getSourceCall()
          Returns the Call that trigered this event.
 boolean isVideoCall()
          Returns whether or not the call is a video call.
 void setMediaDirections(Map<MediaType,MediaDirection> mediaDirections)
          Update media types for the event.
 String toString()
          Returns a String representation of this CallEvent.
 
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_INITIATED

public static final int CALL_INITIATED
An event id value indicating that this event has been triggered as a result of an outgoing call.

See Also:
Constant Field Values

CALL_RECEIVED

public static final int CALL_RECEIVED
An event id value indicating that this event has been triggered as a result of an incoming call.

See Also:
Constant Field Values

CALL_ENDED

public static final int CALL_ENDED
An event id value indicating that this event has been triggered as a result of a call being ended (all its peers have left).

See Also:
Constant Field Values
Constructor Detail

CallEvent

public CallEvent(Call call,
                 int eventID)
Creates an event instance indicating that an incoming/outgoing call has been created

Parameters:
call - the call that triggered this event.
eventID - determines whether this is an incoming or an outgoing call.
Method Detail

getSourceCall

public Call getSourceCall()
Returns the Call that trigered this event.

Returns:
the Call that trigered this event.

getEventID

public int getEventID()
Returns an event ID int indicating whether this event was triggered by an outgoing or an incoming call.

Returns:
on of the CALL_XXX static member ints.

toString

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

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

getMediaTypes

public List<MediaType> getMediaTypes()
Return the media types supported by this call, if information is available. It can be empty list if information wasn't provided for this event and call.

Returns:
the supported media types of current call.

getMediaDirections

public Map<MediaType,MediaDirection> getMediaDirections()
Return the media directions map

Returns:
the supported media direction map of current call.

setMediaDirections

public void setMediaDirections(Map<MediaType,MediaDirection> mediaDirections)
Update media types for the event.

Parameters:
mediaDirections - the new media types.

isVideoCall

public boolean isVideoCall()
Returns whether or not the call is a video call.

Returns:
true if the call is a video call, false otherwise

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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