Klasse AbstractPeeringConnectionManagerService
java.lang.Object
org.jupnp.support.connectionmanager.ConnectionManagerService
org.jupnp.support.connectionmanager.AbstractPeeringConnectionManagerService
Support for setup and teardown of an arbitrary number of connections with a manager peer.
- Autor:
- Christian Bauer, Alessio Gaeta, Amit Kumar Mondal - Code Refactoring
-
Feldübersicht
Von Klasse geerbte Felder org.jupnp.support.connectionmanager.ConnectionManagerService
activeConnections, propertyChangeSupport, sinkProtocolInfo, sourceProtocolInfo -
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotectedAbstractPeeringConnectionManagerService(PropertyChangeSupport propertyChangeSupport, ProtocolInfos sourceProtocolInfo, ProtocolInfos sinkProtocolInfo, ConnectionInfo... activeConnections) protectedAbstractPeeringConnectionManagerService(ConnectionInfo... activeConnections) protectedAbstractPeeringConnectionManagerService(ProtocolInfos sourceProtocolInfo, ProtocolInfos sinkProtocolInfo, ConnectionInfo... activeConnections) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected abstract voidcloseConnection(ConnectionInfo connectionInfo) voidcloseConnectionWithPeer(ControlPoint controlPoint, Service<?, ?> peerService, int connectionID) Close the connection with the peer, remove the connection details.voidcloseConnectionWithPeer(ControlPoint controlPoint, Service<?, ?> peerService, ConnectionInfo connectionInfo) Close the connection with the peer, remove the connection details.voidconnectionComplete(int connectionID) protected abstract ConnectionInfocreateConnection(int connectionID, int peerConnectionId, ServiceReference peerConnectionManager, ConnectionInfo.Direction direction, ProtocolInfo protocolInfo) intcreateConnectionWithPeer(ServiceReference localServiceReference, ControlPoint controlPoint, Service<?, ?> peerService, ProtocolInfo protInfo, ConnectionInfo.Direction direction) Generate a new local connection identifier, prepare the peer, store connection details.protected intprotected abstract voidpeerFailure(ActionInvocation<?> invocation, UpnpResponse operation, String defaultFailureMessage) Called when connection creation or closing with a peer failed.prepareForConnection(ProtocolInfo remoteProtocolInfo, ServiceReference peerConnectionManager, int peerConnectionId, String direction) protected voidremoveConnection(int connectionID) protected voidVon Klasse geerbte Methoden org.jupnp.support.connectionmanager.ConnectionManagerService
getCurrentConnectionIDs, getCurrentConnectionInfo, getPropertyChangeSupport, getProtocolInfo, getSinkProtocolInfo, getSourceProtocolInfo
-
Konstruktordetails
-
AbstractPeeringConnectionManagerService
-
AbstractPeeringConnectionManagerService
protected AbstractPeeringConnectionManagerService(ProtocolInfos sourceProtocolInfo, ProtocolInfos sinkProtocolInfo, ConnectionInfo... activeConnections) -
AbstractPeeringConnectionManagerService
protected AbstractPeeringConnectionManagerService(PropertyChangeSupport propertyChangeSupport, ProtocolInfos sourceProtocolInfo, ProtocolInfos sinkProtocolInfo, ConnectionInfo... activeConnections)
-
-
Methodendetails
-
getNewConnectionId
protected int getNewConnectionId() -
storeConnection
-
removeConnection
protected void removeConnection(int connectionID) -
prepareForConnection
public ConnectionInfo prepareForConnection(ProtocolInfo remoteProtocolInfo, ServiceReference peerConnectionManager, int peerConnectionId, String direction) throws ActionException - Löst aus:
ActionException
-
connectionComplete
- Löst aus:
ActionException
-
createConnectionWithPeer
public int createConnectionWithPeer(ServiceReference localServiceReference, ControlPoint controlPoint, Service<?, ?> peerService, ProtocolInfo protInfo, ConnectionInfo.Direction direction) Generate a new local connection identifier, prepare the peer, store connection details.- Gibt zurück:
-1if thepeerFailure(org.jupnp.model.action.ActionInvocation, org.jupnp.model.message.UpnpResponse, String)method had to be called, otherwise the local identifier of the established connection.
-
closeConnectionWithPeer
public void closeConnectionWithPeer(ControlPoint controlPoint, Service<?, ?> peerService, int connectionID) throws ActionExceptionClose the connection with the peer, remove the connection details.- Löst aus:
ActionException
-
closeConnectionWithPeer
public void closeConnectionWithPeer(ControlPoint controlPoint, Service<?, ?> peerService, ConnectionInfo connectionInfo) throws ActionExceptionClose the connection with the peer, remove the connection details.- Löst aus:
ActionException
-
createConnection
protected abstract ConnectionInfo createConnection(int connectionID, int peerConnectionId, ServiceReference peerConnectionManager, ConnectionInfo.Direction direction, ProtocolInfo protocolInfo) throws ActionException - Löst aus:
ActionException
-
closeConnection
-
peerFailure
protected abstract void peerFailure(ActionInvocation<?> invocation, UpnpResponse operation, String defaultFailureMessage) Called when connection creation or closing with a peer failed.This is the failure result of an action invocation on the peer's connection management service. The execution of the
createConnectionWithPeer(org.jupnp.model.ServiceReference, org.jupnp.controlpoint.ControlPoint, org.jupnp.model.meta.Service, org.jupnp.support.model.ProtocolInfo, org.jupnp.support.model.ConnectionInfo.Direction)andcloseConnectionWithPeer(org.jupnp.controlpoint.ControlPoint, org.jupnp.model.meta.Service, org.jupnp.support.model.ConnectionInfo)methods will block until this method completes handling any failure.- Parameter:
invocation- The underlying action invocation of the remote connection manager service.operation- The network message response if there was a response, ornull.defaultFailureMessage- A user-friendly error message generated from the invocation exception and response.
-