📄 java.telephony.connection.html
字号:
<!--NewPage--><html><head><!-- Generated by javadoc on Fri Feb 07 16:42:30 PST 1997 --><a name="_top_"></a><title> Interface java.telephony.Connection</title></head><body><pre><a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-java.telephony.html">This Package</a> <a href="java.telephony.CallObserver.html#_top_">Previous</a> <a href="java.telephony.JtapiPeer.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre><hr><h1> Interface java.telephony.Connection</h1><dl> <dt> public interface <b>Connection</b> <dt> extends <a href="java.lang.Object.html#_top_">Object</a></dl>A Connection represents a link (i.e. an association) between a Call objectand an Address object. The purpose of a Connection object is to describethis relationship between the Address and a Call. A Connection object existsif the Address is a part of the telephone call. Each Connection has a<EM>state</EM> which describes the particular stage of the relationshipbetween the Call and Address. For example, when the Address is activelypart of a telephone call, the Connection state which relates the twois CONNECTED. If there is an incoming call to an Address, the Connectionstate is ALERTING. These various states are described below. In mostsituations, the state of the Connection describes what actions arepossible on the Connection.<p>Connection objects are immutable in terms of its Call and Addressreferences. In other words, the Call and Address object references donot change throughout the lifetime of the Connection object instance. Thesame Connection object may not be used in another telephone call. Theexistence of a Connection implies that its Address is associated with itsCall in the manner described by the Connection's state.<p>Although a Connection's Address and Call references remain valid throughoutthe lifetime of the Connection object, the same is not true for the Calland Address object's references to this Connection. Particularly, when a Connection moves into the Connection.DISCONNECTED state, it is no longerlisted by the <EM>Call.getConnections()</EM> and<EM>Address.getConnections()</EM> methods. Typically, when a Connectionmoves into the Connection.DISCONNECTED state, the application losesits references to it to faciliate its garbage collection.<p>Connections may be viewed as a container for zero or more TerminalConnectionobjects. Connection objects represent the relationship between the Call andthe Address, whereas TerminalConnection objects represent the relationshipbetween the Call and the Terminal. The relationship between the Call andthe Address may be views as a "logical" view of the Call, i.e. where theendpoints are telephone number addresses. The relationship between a Calland a Terminal represents the "physical" view of the Call, i.e. at whichTerminal the telephone calls terminates. The TerminalConnection objectspecification provides further information.<p>Below is a description of each Connection state in real-world terms. Thesereal-world descriptions have no bearing on the specifications of methods,they only serve to provide a more intuitive understanding of what is goingon.<p>The Connection.IDLE state is the initial state for all new Connections.Connections which are in the Connection.IDLE state are not actively part ofa telephone call, yet their references to the Call and Address objects arevalid. Connections typically do not stay in the Connection.IDLE state forlong, quickly transitioning to other states.<p>The Connection.DISCONNECTED state implies it is no longer part of thetelephone call, although its references to Call and Address still remainvalid. A Connection in the Connection.DISCONNECTED state is interpreted asonce previously belonging to this telephone call.<p>The Connection.INPROGRESS state implies that the Connection, whichrepresents the destination end of a telephone call, is in the process ofcontacting the destination side. Under certain circumstances, the Connectionmay not progress beyond this state. Extension packages elaborate further onthis state in various situations.<p>The Connection.ALERTING state implies that the Address is being notified ofan incoming call. Typically, the Connection.ALERTING Connection willanswer the telephone call.<p>The Connection.CONNECTED state implies that a Connection and its Address isactively part of a telephone call. In common terms, two people talking toone another are represented by two Connections in the Connection.CONNECTEDstate.<p>The Connection.UNKNOWN state implies that the implementation is unable todetermine the current state of the Connection. Typically, method are invalidon Connections which are in the Connection.UNKNOWN state. Connections maymove in and out of the Connection.UNKNOWN state at any time.<p>The Connection.FAILED state indicates that a Connection to that end of thecall has failed for some reason. One reason why a Connection would be in theConnection.FAILED state is because the party was busy.<p>With these loose, real-world meanings in the back of one's mind, theConnection class defines a finite-state diagram which describes theallowable Connection state transitions. This finite-state diagram must beguaranteed by the implementation. Each method which causes a change ina Connection state must be consistent with this state diagram. The finitestate diagram of the Connection states appears in graphical in the Overviewdocument for the Java Telephony API. Below, the finite state diagram appearsbelow in text:<p>All states may transition into and out of the UNKNOWN state which is notrepresented below.<p><UL><LI>IDLE ---> ALERTING | CONNECTED | DISCONNECTED | FAILED | INPROGRESS<LI>INPROGRESS ---> ALERTING | CONNECTED | DISCONNECTED | FAILED<LI>ALERTING ---> CONNECTED | DISCONNECTED | FAILED | UNKNOWN<LI>CONNECTED ---> DISCONNECTED | FAILED | UNKNOWN<LI>DISCONNECTED ---> UNKNOWN<LI>FAILED ---> DISCONNECTED | UNKNOWN</UL><p>The Connection object supports the <EM>disconnect()</EM> method which dropsan entire Connection from the telephone call. The result of this method isto move this Connection object into the Connection.DISCONNECTED state atwhich time the address, nor any of its Terminals are associated with thetelephone call.<p>When a Connection object changes state, the application is notified via anevent through the CallObserver interface. A Call object is notified onlyif the Connection is part of the Call. The CallObserver interface is alsonotified when a new Connection has been created on a Call.<p><dl> <dt> <b>See Also:</b> <dd> <a href="java.telephony.CallObserver.html#_top_">CallObserver</a></dl><hr><a name="index"></a><h2> <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index"></h2><dl> <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o "> <a href="#ALERTING"><b>ALERTING</b></a> <dd> The Connection.ALERTING state implies that the Address is being notified ofan incoming call. <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o "> <a href="#CONNECTED"><b>CONNECTED</b></a> <dd> The Connection.CONNECTED state implies that a Connection and its Address isactively part of a telephone call. <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o "> <a href="#DISCONNECTED"><b>DISCONNECTED</b></a> <dd> The Connection.DISCONNECTED state implies it is no longer part of thetelephone call, although its references to Call and Address still remainvalid. <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o "> <a href="#FAILED"><b>FAILED</b></a> <dd> The Connection.FAILED state indicates that a Connection to that end of thecall has failed for some reason. <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o "> <a href="#IDLE"><b>IDLE</b></a> <dd> The Connection.IDLE state is the initial state for all new Connections. <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o "> <a href="#INPROGRESS"><b>INPROGRESS</b></a> <dd> The Connection.INPROGRESS state implies that the Connection, whichrepresents the destination end of a telephone call, is in the process ofcontacting the destination side. <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o "> <a href="#UNKNOWN"><b>UNKNOWN</b></a> <dd> The Connection.UNKNOWN state implies that the implementation is unable todetermine the current state of the Connection.</dl><h2> <img src="images/method-index.gif" width=207 height=38 alt="Method Index"></h2><dl> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#disconnect()"><b>disconnect</b></a>() <dd> Drops a Connection from an active telephone call. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getAddress()"><b>getAddress</b></a>() <dd> Returns the Address object associated with this Connection. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getCall()"><b>getCall</b></a>() <dd> Returns the Call object associated with this Connection. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getConnectionCapabilities(java.telephony.Terminal, java.telephony.Address)"><b>getConnectionCapabilities</b></a>(Terminal, Address) <dd> Gets the ConnectionCapabilities object with respect to a Terminal andan Address. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getState()"><b>getState</b></a>() <dd> Returns the current state of the Connection. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getTerminalConnections()"><b>getTerminalConnections</b></a>() <dd> Returns an array of TerminalConnections associated with this Connection.</dl><a name="variables"></a><h2> <img src="images/variables.gif" width=153 height=38 alt="Variables"></h2><a name="IDLE"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a><b>IDLE</b><pre> public final static int IDLE</pre><dl> <dd> The Connection.IDLE state is the initial state for all new Connections.Connections which are in the Connection.IDLE state are not actively part ofa telephone call, yet their references to the Call and Address objects arevalid. Connections typically do not stay in the Connection.IDLE state forlong, quickly transitioning to other states.</dl><a name="INPROGRESS"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a><b>INPROGRESS</b><pre> public final static int INPROGRESS</pre><dl> <dd> The Connection.INPROGRESS state implies that the Connection, whichrepresents the destination end of a telephone call, is in the process ofcontacting the destination side. Under certain circumstances, theConnection may not progress beyon this state. Extension packages elaboratefurther on this state in various situations.</dl><a name="ALERTING"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a><b>ALERTING</b><pre> public final static int ALERTING</pre><dl>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -