|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A JcpCall is a transient association of (zero or more) addresses for the purposes of engaging in a real-time communications interchange. The call and its associated connection and address objects describe the control and media flows taking place in some underlying "real world" communication network. Other parties involved in the call may also exert control over it, thus the membership and state of the endpoints may change without explicit request by the jcp application. The JcpProvider adjusts the call, address and connection objects to reflect the results of these combined command actions.
JcpConnection
s.
A two-party call has two JcpConnections, and a conference call
has three or more JcpConnections. Each JcpConnection models the relationship
between a JcpCall and an JcpAddress, where an JcpAddress identifies a particular
party or set of parties on a call.
JcpProvider.createCall()
method, which returns a JcpCall object that
has zero Connections and is in the IDLE
state. The JcpCall
maintains a reference to its JcpProvider for the life of that JcpCall object.
The JcpProvider object instance does not change throughout the lifetime of
the JcpCall object. The JcpProvider associated with a JcpCall is obtained via the
getProvider()
method.
getState()
method. This state describes the current
progress of a telephone call, where is it in its life cycle, and how many
connections exist on the call. The JcpCall state may be one of three values:
IDLE
, ACTIVE
, or
INVALID
. The following is a description of each state:
JcpCall.IDLE |
This is the initial state for all calls. In this state, the JcpCall has zero
connections, that is getConnections() must
return null.
|
JcpCall.ACTIVE |
A call with some current ongoing activity is in this state. JcpCalls with one
or more associated JcpConnections must be in this state. If a JcpCall is in this
state, the getConnections() method must return an array
of size at least one.
|
JcpCall.INVALID |
This is the final state for all calls. JcpCall objects which lose all of their
JcpConnection objects (via a transition of the JcpConnection object into the
JcpConnection.DISCONNECTED state) moves into this state. Calls
in this state have zero JcpConnections and these JcpCall objects may not be used
for any future action. In this state, the
getConnections()
must return null.
|
getConnections()
method. A JcpCall retains a reference to a
JcpConnection only if it is not in the JcpConnection.DISCONNECTED
state. Therefore, if a JcpCall has a reference to a JcpConnection, then that
JcpConnection must not be in the JcpConnection.DISCONNECTED
state.
When a JcpConnection moves into the JcpConnection.DISCONNECTED
state
(e.g. when a party hangs up), the JcpCall loses its reference to that
JcpConnection which is no longer reported via the
JcpCall.getConnections()
method.
JcpCallListener
interface reports all events pertaining to
the JcpCall object. Events delivered to this interface must extend the
JcpCallEvent
interface. Applications can add listeners to a JcpCall
object
via the addCallListener(JcpCallListener)
method.
Connection-related events can be reported
via the JcpCallListener
interface or via the
JcpConnectionListener
interface.
These events include the
creation of these objects and their state changes. Events which are
reported
via the JcpCallListener
interface pertaining to JcpConnections
extend the JcpConnectionEvent
interface.
JcpCallEvent.CALL_EVENT_TRANSMISSION_ENDED
is delivered to
an object registered as a JcpCallListener
(or an extension of that interface).
This is the final event receives by the Listener.
addCallListener()
methods.
JcpCallListener
,
JcpConnectionListener
,
JcpConnection
,
JcpAddress
,
JcpCallEvent
Field Summary | |
static int |
ACTIVE
JcpCall.ACTIVE state indicates the Call has one or more Connections none of which is in the JcpConnection.DISCONNECTED state. |
static int |
IDLE
JcpCall.IDLE state indicates the Call has zero Connections. |
static int |
INVALID
The JcpCall.INVALID state indicates that the Call has lost all of its connections, that is, all of its Connection objects have moved into the JcpConnection.DISCONNECTED
state and are no longer associated with the Call. |
Method Summary | |
void |
addCallListener(JcpCallListener calllistener)
Add a listener to this call. |
JcpConnection[] |
getConnections()
Retrieves an array of connections asssociated with this call. |
JcpProvider |
getProvider()
Retrieves the provider handling this call object. |
int |
getState()
Retrieves the state of the call. |
void |
removeCallListener(JcpCallListener calllistener)
Removes a listener from this call. |
Field Detail |
public static final int IDLE
public static final int ACTIVE
JcpConnection.DISCONNECTED
state. The
Call object transitions into this state from the IDLE
state only.public static final int INVALID
JcpConnection.DISCONNECTED
state and are no longer associated with the Call.
A Call in this state cannot
be used for future actions.Method Detail |
public int getState()
IDLE
,
ACTIVE
or INVALID
.public void addCallListener(JcpCallListener calllistener) throws ResourceUnavailableException, MethodNotSupportedException
JcpProvider.addCallListener()
method.
See the specifications for these methods for more information.
JccProvider.addCallListener()
either of these methods
modifies the behavior of that listener as if it were added via
this method instead. Post-Conditions:
calllistener
- JcpCallListener object that receives the specified events.public void removeCallListener(JcpCallListener calllistener)
This method has different effects depending upon how the listener was added to the Call, as follows:
JcpCall.addCallListener()
, this method removes the
listener until it is re-applied by the application.
JccProvider.addCallListener()
,
this method removes
the listener for this call only. It does not affect whether this
listener will be added to future calls which come to that Address.
See JccProvider.addCallListener()
for more details.
If an listener is not part of the Call, then this method fails silently, i.e. no listener is removed and no exception is thrown.
Post-Conditions:
calllistener
- JcpCall Listener object.public JcpProvider getProvider()
public JcpConnection[] getConnections()
JcpConnection.DISCONNECTED
state. Further,
if the Call is in the IDLE
or INVALID
state,
this method returns null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |