📄 genconnection.java
字号:
throw new javax.csapi.cc.jcc.InvalidStateException(this.getFrameConn(),
javax.csapi.cc.jcc.InvalidStateException.CONNECTION_OBJECT,
this.getFrameConn().getState(),
ise.getMessage());
} catch (javax.telephony.PrivilegeViolationException pve) {
throw new javax.csapi.cc.jcc.PrivilegeViolationException(
javax.csapi.cc.jcc.PrivilegeViolationException.ORIGINATOR_VIOLATION,
pve.getMessage());
} catch (javax.telephony.ResourceUnavailableException rue) {
int exType = rue.getType();
int newType;
switch (exType) {
case javax.telephony.ResourceUnavailableException.NO_DIALTONE: {
newType = javax.csapi.cc.jcc.ResourceUnavailableException.NO_DIALTONE;
break;
}
case javax.telephony.ResourceUnavailableException.OBSERVER_LIMIT_EXCEEDED: {
newType = javax.csapi.cc.jcc.ResourceUnavailableException.NO_DIALTONE;
break;
}
case javax.telephony.ResourceUnavailableException.ORIGINATOR_UNAVAILABLE: {
newType = javax.csapi.cc.jcc.ResourceUnavailableException.NO_DIALTONE;
break;
}
case javax.telephony.ResourceUnavailableException.OUTSTANDING_METHOD_EXCEEDED: {
newType = javax.csapi.cc.jcc.ResourceUnavailableException.NO_DIALTONE;
break;
}
case javax.telephony.ResourceUnavailableException.TRUNK_LIMIT_EXCEEDED: {
newType = javax.csapi.cc.jcc.ResourceUnavailableException.NO_DIALTONE;
break;
}
case javax.telephony.ResourceUnavailableException.UNSPECIFIED_LIMIT_EXCEEDED: {
newType = javax.csapi.cc.jcc.ResourceUnavailableException.NO_DIALTONE;
break;
}
case javax.telephony.ResourceUnavailableException.USER_RESPONSE: {
newType = javax.csapi.cc.jcc.ResourceUnavailableException.NO_DIALTONE;
break;
}
default: {
newType = javax.csapi.cc.jcc.ResourceUnavailableException.UNKNOWN;
}
}
throw new javax.csapi.cc.jcc.ResourceUnavailableException(newType);
} catch (javax.telephony.MethodNotSupportedException mnse) {
throw new RuntimeException("Release failed due to " + mnse);
}
}
/**
* release the connection with a cause code.
*
* <P>Note: For now, the cause code is ignored since the JccTpi has no current way of passing
* it on to the low-level implementation.
*/
public void release(int cause) throws javax.csapi.cc.jcc.InvalidStateException, javax.csapi.cc.jcc.PrivilegeViolationException, javax.csapi.cc.jcc.ResourceUnavailableException {
this.release();
}
/**
* routeConnection method comment.
*/
public void routeConnection(boolean attachMedia)
throws
javax.csapi.cc.jcc.MethodNotSupportedException,
javax.csapi.cc.jcc.ResourceUnavailableException,
javax.csapi.cc.jcc.InvalidPartyException,
javax.csapi.cc.jcc.InvalidArgumentException,
javax.csapi.cc.jcc.InvalidStateException,
javax.csapi.cc.jcc.PrivilegeViolationException {
// unblock
this.continueProcessing();
// Get the calling address and called address name
GenAddress caller = this.getCallingAddr();
Address jtapiCaller = null;
if (caller != null)
jtapiCaller = caller.getFrameAddr();
String calledAddr = this.getAddress().getName();
// Get the call that this is associated with
Connection[] conns = null;
GenCall call = (GenCall) this.getCall();
FreeCall fCall = call.getFrameCall();
Terminal firstTerm = jtapiCaller.getTerminals()[0];
// See if routing is requested
String route = this.getRouteAddress();
if (route == null)
route = calledAddr;
boolean partyFailed = false;
try {
// synchronize on the GenCall so that we ensure these methods and "getConnections()"
// do not run at the same time.
synchronized (call) {
conns = (Connection[]) fCall.connect(firstTerm, jtapiCaller, route);
call.removePendingConn(this);
}
} catch (javax.telephony.InvalidStateException ise) {
throw new javax.csapi.cc.jcc.InvalidStateException(
fCall,
ise.getObjectType(),
ise.getState(),
ise.getMessage());
} catch (javax.telephony.InvalidPartyException ise) {
partyFailed = true;
} catch (javax.telephony.PrivilegeViolationException pve) {
int type = pve.getType();
int newType;
switch (type) {
case javax.telephony.PrivilegeViolationException.DESTINATION_VIOLATION :
{
newType =
javax.csapi.cc.jcc.PrivilegeViolationException.DESTINATION_VIOLATION;
}
case javax.telephony.PrivilegeViolationException.ORIGINATOR_VIOLATION :
{
newType =
javax.csapi.cc.jcc.PrivilegeViolationException.ORIGINATOR_VIOLATION;
}
default :
{
newType =
javax.csapi.cc.jcc.PrivilegeViolationException.UNKNOWN_VIOLATION;
}
}
throw new javax.csapi.cc.jcc.PrivilegeViolationException(
newType,
pve.getMessage());
} catch (javax.telephony.ResourceUnavailableException rue) {
int type = rue.getType();
int newType;
switch (type) {
case javax.telephony.ResourceUnavailableException.NO_DIALTONE :
{
newType =
javax.csapi.cc.jcc.ResourceUnavailableException.NO_DIALTONE;
}
case javax.telephony.ResourceUnavailableException.OBSERVER_LIMIT_EXCEEDED :
{
newType =
javax.csapi.cc.jcc.ResourceUnavailableException
.OBSERVER_LIMIT_EXCEEDED;
}
case javax.telephony.ResourceUnavailableException.ORIGINATOR_UNAVAILABLE :
{
newType =
javax.csapi.cc.jcc.ResourceUnavailableException
.ORIGINATOR_UNAVAILABLE;
}
case javax.telephony.ResourceUnavailableException.OUTSTANDING_METHOD_EXCEEDED :
{
newType =
javax.csapi.cc.jcc.ResourceUnavailableException
.OUTSTANDING_METHOD_EXCEEDED;
}
case javax.telephony.ResourceUnavailableException.TRUNK_LIMIT_EXCEEDED :
{
newType =
javax.csapi.cc.jcc.ResourceUnavailableException.TRUNK_LIMIT_EXCEEDED;
}
case javax.telephony.ResourceUnavailableException.UNSPECIFIED_LIMIT_EXCEEDED :
{
newType =
javax.csapi.cc.jcc.ResourceUnavailableException
.UNSPECIFIED_LIMIT_EXCEEDED;
}
case javax.telephony.ResourceUnavailableException.USER_RESPONSE :
{
newType =
javax.csapi.cc.jcc.ResourceUnavailableException.USER_RESPONSE;
}
default :
{
newType = javax.csapi.cc.jcc.ResourceUnavailableException.UNKNOWN;
}
}
throw new javax.csapi.cc.jcc.ResourceUnavailableException(newType);
} catch (javax.telephony.InvalidArgumentException iae) {
throw new javax.csapi.cc.jcc.InvalidArgumentException(
iae.getMessage());
} catch (javax.telephony.MethodNotSupportedException mnse) {
throw new javax.csapi.cc.jcc.MethodNotSupportedException(
mnse.getMessage());
}
// now see which connection is our new connection
if (!partyFailed)
for (int j = 0; j < conns.length; j++) {
if (conns[j].getAddress().getName().equals(calledAddr))
this.setFrameConn(conns[j]);
}
// see if we failed to route the call
if (partyFailed == true)
throw new javax.csapi.cc.jcc.InvalidPartyException(
javax.csapi.cc.jcc.InvalidPartyException.DESTINATION_PARTY,
"All selected routes failed: " + route);
// now attach the media if necessary
if (attachMedia)
this.attachMedia();
}
/**
* selectRoute method comment.
*/
public void selectRoute(java.lang.String address) throws javax.csapi.cc.jcc.MethodNotSupportedException {
this.setRouteAddress(address);
}
/**
* Set the JcpAddress that I am or will be routed to.
* Creation date: (2000-11-09 15:23:18)
* @param newAddress java.lang.String
*/
private void setAddress(JccAddress newAddress) {
address = newAddress;
}
/**
* Turn blocking on or off.
* Creation date: (2000-11-01 11:27:23)
* @param newBlocked boolean
*/
synchronized void setBlocked(boolean newBlocked) {
blocked = newBlocked;
}
/**
* Insert the method's description here.
* Creation date: (2000-11-09 15:32:29)
* @param newCall jain.application.services.jcc.JccCall
*/
private void setCall(JccCall newCall) {
call = newCall;
}
/**
* Internal setter for the Address that started this call, if one is known.
* Creation date: (2000-11-09 15:23:18)
* @param newCallingAddr java.lang.String
*/
private void setCallingAddr(GenAddress newCallingAddr) {
callingAddr = newCallingAddr;
}
/**
* Insert the method's description here.
* Creation date: (2000-10-10 13:54:27)
* @param newFrameConn javax.telephony.Connection
*/
private void setFrameConn(javax.telephony.Connection newFrameConn) {
frameConn = newFrameConn;
}
/**
* Set the override state for the object.
* Creation date: (2000-11-15 14:32:16)
* @return int
* @param newState int
*/
int setJccState(int newState) {
return this.state = newState;
}
/**
* Insert the method's description here.
* Creation date: (2000-11-09 15:20:26)
* @param newLastAddr javax.csapi.cc.jcc.JccAddress
*/
void setLastAddr(JccAddress newLastAddr) {
lastAddr = newLastAddr;
}
/**
* Insert the method's description here.
* Creation date: (2000-11-09 15:20:26)
* @param newOrigAddr javax.csapi.cc.jcc.JccAddress
*/
void setOrigAddr(JccAddress newOrigAddr) {
origAddr = newOrigAddr;
}
/**
* Insert the method's description here.
* Creation date: (2000-10-30 12:55:56)
* @param newProv com.uforce.jain.generic.Provider
*/
private void setProv(Provider newProv) {
prov = newProv;
}
/**
* Internal setter
* Creation date: (2001-01-24 10:39:17)
* @param newRouteAddress java.lang.String
*/
private void setRouteAddress(java.lang.String newRouteAddress) {
routeAddress = newRouteAddress;
}
/**
* Get the MidCall Data
* Not supported by GJTAPI yet.
* @throws InvalidStateException Some object required by this method is not
* in a valid state as designated by the pre-conditions for this method.
* @throws ResourceUnavailableException An internal resource for completing this
* call is unavailable, e.g. no mid call data is available at this time.
* @throws MethodNotSupportedException The implementation does not support this method.
* @return the mid call data; the service code type and service code value
*/
public MidCallData getMidCallData() throws javax.csapi.cc.jcc.MethodNotSupportedException {
throw new javax.csapi.cc.jcc.MethodNotSupportedException("Not collected by GJTAPI Service Provider");
}
/**
* Description
* @return a string representation of the receiver
*/
public String toString() {
StringBuffer buf = new StringBuffer(this.isBlocked() ? "B" : "Unb");
return buf.append("locked Jain Connection adapter for: ")
.append(this.getFrameConn().toString())
.toString();
}
/**
* Create the TerminalConnections for the Connection.
* These must be tested using equality, since more than one wrapper may
* exist for a TerminalConnection.
* @see javax.jcat.JcatConnection#getTerminalConnections()
*/
public Set getTerminalConnections() {
Set results = new HashSet();
TerminalConnection[] tcs = this.getFrameConn().getTerminalConnections();
// now create the wrappers and add to the set
if (tcs != null) {
int len = tcs.length;
for (int i = 0; i < len; i++) {
results.add(new GenTerminalConnection(this.getProv(), (FreeTerminalConnection)tcs[i]));
}
}
return results;
}
/**
* park is not currently supported by GJTAPI
* @see javax.jcat.JcatConnection#park(java.lang.String)
*/
public JcatConnection park(String destinationAddress)
throws
InvalidPartyException,
InvalidStateException,
MethodNotSupportedException,
PrivilegeViolationException,
ResourceUnavailableException {
// TODO how do we do this?
throw new MethodNotSupportedException("Park not currently supported by GJTAPI");
}
/**
* Not currently supported by GJTAPI
* @see javax.jcat.JcatConnection#reconnect()
*/
public void reconnect()
throws
InvalidArgumentException,
InvalidStateException,
MethodNotSupportedException,
PrivilegeViolationException,
ResourceUnavailableException {
// TODO how do we do this?
throw new MethodNotSupportedException("Connection Suspend/Reconnect not supported by GJTAPI");
}
/**
* Not currently implemented by GJTAPI
* @see javax.jcat.JcatConnection#suspendConnection()
*/
public void suspendConnection()
throws
InvalidStateException,
MethodNotSupportedException,
ResourceUnavailableException {
// TODO Need to add raw support for this
throw new MethodNotSupportedException("Connection Suspend not supported by GJTAPI");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -