@UpnpAction(out = { @UpnpOutputArgument(name = "ConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID", getterName = "getConnectionID"), @UpnpOutputArgument(name = "AVTransportID", stateVariable = "A_ARG_TYPE_AVTransportID", getterName = "getAvTransportID"), @UpnpOutputArgument(name = "RcsID", stateVariable = "A_ARG_TYPE_RcsID", getterName = "getRcsID") }) synchronized public ConnectionInfo prepareForConnection( @UpnpInputArgument(name = "RemoteProtocolInfo", stateVariable = "A_ARG_TYPE_ProtocolInfo") ProtocolInfo remoteProtocolInfo, @UpnpInputArgument(name = "PeerConnectionManager", stateVariable = "A_ARG_TYPE_ConnectionManager") ServiceReference peerConnectionManager, @UpnpInputArgument(name = "PeerConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID") int peerConnectionId, @UpnpInputArgument(name = "Direction", stateVariable = "A_ARG_TYPE_Direction") String direction) throws ActionException { int connectionId = getNewConnectionId(); ConnectionInfo.Direction dir; try { dir = ConnectionInfo.Direction.valueOf(direction); } catch (Exception ex) { throw new ConnectionManagerException(ErrorCode.ARGUMENT_VALUE_INVALID, "Unsupported direction: " + direction); } log.fine("Preparing for connection with local new ID " + connectionId + " and peer connection ID: " + peerConnectionId); ConnectionInfo newConnectionInfo = createConnection( connectionId, peerConnectionId, peerConnectionManager, dir, remoteProtocolInfo ); storeConnection(newConnectionInfo); return newConnectionInfo; }
@UpnpAction(out = { @UpnpOutputArgument(name = "ConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID", getterName = "getConnectionID"), @UpnpOutputArgument(name = "AVTransportID", stateVariable = "A_ARG_TYPE_AVTransportID", getterName = "getAvTransportID"), @UpnpOutputArgument(name = "RcsID", stateVariable = "A_ARG_TYPE_RcsID", getterName = "getRcsID") }) synchronized public ConnectionInfo prepareForConnection( @UpnpInputArgument(name = "RemoteProtocolInfo", stateVariable = "A_ARG_TYPE_ProtocolInfo") ProtocolInfo remoteProtocolInfo, @UpnpInputArgument(name = "PeerConnectionManager", stateVariable = "A_ARG_TYPE_ConnectionManager") ServiceReference peerConnectionManager, @UpnpInputArgument(name = "PeerConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID") int peerConnectionId, @UpnpInputArgument(name = "Direction", stateVariable = "A_ARG_TYPE_Direction") String direction) throws ActionException { int connectionId = getNewConnectionId(); ConnectionInfo.Direction dir; try { dir = ConnectionInfo.Direction.valueOf(direction); } catch (Exception ex) { throw new ConnectionManagerException(ErrorCode.ARGUMENT_VALUE_INVALID, "Unsupported direction: " + direction); } log.fine("Preparing for connection with local new ID " + connectionId + " and peer connection ID: " + peerConnectionId); ConnectionInfo newConnectionInfo = createConnection( connectionId, peerConnectionId, peerConnectionManager, dir, remoteProtocolInfo ); storeConnection(newConnectionInfo); return newConnectionInfo; }
@UpnpAction(out = { @UpnpOutputArgument(name = "ConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID", getterName = "getConnectionID"), @UpnpOutputArgument(name = "AVTransportID", stateVariable = "A_ARG_TYPE_AVTransportID", getterName = "getAvTransportID"), @UpnpOutputArgument(name = "RcsID", stateVariable = "A_ARG_TYPE_RcsID", getterName = "getRcsID") }) synchronized public ConnectionInfo prepareForConnection( @UpnpInputArgument(name = "RemoteProtocolInfo", stateVariable = "A_ARG_TYPE_ProtocolInfo") ProtocolInfo remoteProtocolInfo, @UpnpInputArgument(name = "PeerConnectionManager", stateVariable = "A_ARG_TYPE_ConnectionManager") ServiceReference peerConnectionManager, @UpnpInputArgument(name = "PeerConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID") int peerConnectionId, @UpnpInputArgument(name = "Direction", stateVariable = "A_ARG_TYPE_Direction") String direction) throws ActionException { int connectionId = getNewConnectionId(); ConnectionInfo.Direction dir; try { dir = ConnectionInfo.Direction.valueOf(direction); } catch (Exception ex) { throw new ConnectionManagerException(ErrorCode.ARGUMENT_VALUE_INVALID, "Unsupported direction: " + direction); } log.fine("Preparing for connection with local new ID " + connectionId + " and peer connection ID: " + peerConnectionId); ConnectionInfo newConnectionInfo = createConnection( connectionId, peerConnectionId, peerConnectionManager, dir, remoteProtocolInfo ); storeConnection(newConnectionInfo); return newConnectionInfo; }
@Override public void success(ActionInvocation invocation) { try { ConnectionInfo info = new ConnectionInfo( (Integer)invocation.getInput("ConnectionID").getValue(), (Integer)invocation.getOutput("RcsID").getValue(), (Integer)invocation.getOutput("AVTransportID").getValue(), new ProtocolInfo(invocation.getOutput("ProtocolInfo").toString()), new ServiceReference(invocation.getOutput("PeerConnectionManager").toString()), (Integer)invocation.getOutput("PeerConnectionID").getValue(), ConnectionInfo.Direction.valueOf(invocation.getOutput("Direction").toString()), ConnectionInfo.Status.valueOf(invocation.getOutput("Status").toString()) ); received(invocation, info); } catch (Exception ex) { invocation.setFailure( new ActionException(ErrorCode.ACTION_FAILED, "Can't parse ConnectionInfo response: " + ex, ex) ); failure(invocation, null); } }
@Override public void success(ActionInvocation invocation) { try { ConnectionInfo info = new ConnectionInfo( (Integer)invocation.getInput("ConnectionID").getValue(), (Integer)invocation.getOutput("RcsID").getValue(), (Integer)invocation.getOutput("AVTransportID").getValue(), new ProtocolInfo(invocation.getOutput("ProtocolInfo").toString()), new ServiceReference(invocation.getOutput("PeerConnectionManager").toString()), (Integer)invocation.getOutput("PeerConnectionID").getValue(), ConnectionInfo.Direction.valueOf(invocation.getOutput("Direction").toString()), ConnectionInfo.Status.valueOf(invocation.getOutput("Status").toString()) ); received(invocation, info); } catch (Exception ex) { invocation.setFailure( new ActionException(ErrorCode.ACTION_FAILED, "Can't parse ConnectionInfo response: " + ex, ex) ); failure(invocation, null); } }
@Override public void success(ActionInvocation invocation) { try { ConnectionInfo info = new ConnectionInfo( (Integer)invocation.getInput("ConnectionID").getValue(), (Integer)invocation.getOutput("RcsID").getValue(), (Integer)invocation.getOutput("AVTransportID").getValue(), new ProtocolInfo(invocation.getOutput("ProtocolInfo").toString()), new ServiceReference(invocation.getOutput("PeerConnectionManager").toString()), (Integer)invocation.getOutput("PeerConnectionID").getValue(), ConnectionInfo.Direction.valueOf(invocation.getOutput("Direction").toString()), ConnectionInfo.Status.valueOf(invocation.getOutput("Status").toString()) ); received(invocation, info); } catch (Exception ex) { invocation.setFailure( new ActionException(ErrorCode.ACTION_FAILED, "Can't parse ConnectionInfo response: " + ex, ex) ); failure(invocation, null); } }