@Test public void testHandshake() { Mockito.stub(connectionHandler.getMaxOFSupportedProtocol()).toReturn(EncodeConstants.OF13_VERSION_ID); connectionHandler.handshake(connectionAdapter); HelloInputBuilder builder = new HelloInputBuilder(); builder.setVersion((short) EncodeConstants.OF13_VERSION_ID); builder.setXid(ShimSwitchConnectionHandlerImpl.DEFAULT_XID); List<Elements> elements = new ArrayList<Elements>(); builder.setElements(elements); Mockito.verify(connectionAdapter).hello(builder.build()); }
public void handshake(ConnectionAdapter connectionAdapter) { HelloInputBuilder builder = new HelloInputBuilder(); builder.setVersion((short) getMaxOFSupportedProtocol()); builder.setXid(DEFAULT_XID); List<Elements> elements = new ArrayList<Elements>(); builder.setElements(elements); connectionAdapter.hello(builder.build()); }
ShimSwitchConnectionHandlerImpl implements SwitchConnectionHandler, ICoreListener, IHandshakeListener { public void handshake(ConnectionAdapter connectionAdapter) { HelloInputBuilder builder = new HelloInputBuilder(); builder.setVersion((short) getMaxOFSupportedProtocol()); builder.setXid(DEFAULT_XID); List<Elements> elements = new ArrayList<Elements>(); builder.setElements(elements); connectionAdapter.hello(builder.build()); } }
ShimSwitchConnectionHandlerImpl implements SwitchConnectionHandler, ICoreListener, IHandshakeListener { public void handshake(ConnectionAdapter connectionAdapter) { HelloInputBuilder builder = new HelloInputBuilder(); builder.setVersion((short) getMaxOFSupportedProtocol()); builder.setXid(DEFAULT_XID); List<Elements> elements = new ArrayList<Elements>(); builder.setElements(elements); connectionAdapter.hello(builder.build()); } ShimSwitchConnectionHandlerImpl(ZeroMQBaseConnector connector,
            NotificationPublishService _notificationProviderService); }
ShimSwitchConnectionHandlerImpl implements SwitchConnectionHandler, ICoreListener, IHandshakeListener { public void handshake(ConnectionAdapter connectionAdapter) { HelloInputBuilder builder = new HelloInputBuilder(); builder.setVersion((short) getMaxOFSupportedProtocol()); builder.setXid(DEFAULT_XID); List<Elements> elements = new ArrayList<Elements>(); builder.setElements(elements); connectionAdapter.hello(builder.build()); } ShimSwitchConnectionHandlerImpl(ZeroMQBaseConnector connector,
            NotificationPublishService _notificationProviderService); void setSwitchFeaturesUtil(SwitchFeaturesUtil featureUtil); void init(); ShimRelay createShimRelay(); ConnectionAdaptersRegistry createConnectionAdaptersRegistry(); @Override boolean accept(InetAddress arg0); @Override void onSwitchConnected(ConnectionAdapter connectionAdapter); void handshake(ConnectionAdapter connectionAdapter); @Override void onSwitchHelloMessage(long xid, Short version, ConnectionAdapter connectionAdapter); NodeUpdated nodeAdded(ConnectionAdapter connectionAdapter); static InstanceIdentifier<Node> identifierFromDatapathId(final BigInteger datapathId); static NodeKey nodeKeyFromDatapathId(final BigInteger datapathId); static NodeId nodeIdFromDatapathId(final BigInteger datapathId); byte getMaxOFSupportedProtocol(); List<Byte> getSupportedOFProtocols(); int getNumberOfSwitches(); Pair<Protocol, ProtocolVersions> getSupportedProtocol(); void setSupportedProtocol(byte version); @Override void onOpenFlowCoreMessage(Long datapathId, ByteBuf msg, int moduleId); @Override void onHelloCoreMessage(List<Pair<Protocol, ProtocolVersions>> requestedProtocols, int moduleId); void collectGetFeaturesOuput(Future<RpcResult<GetFeaturesOutput>> switchReply,
            final ConnectionAdapter connectionAdapter); void sendGetFeaturesOuputToCore(final Short proposedVersion, final int moduleId,
            final ConnectionAdapter connectionAdapter); void sendGetFeaturesToSwitch(final Short proposedVersion, final Long xid,
            final ConnectionAdapter connectionAdapter); @Override void onSwitchDisconnected(ConnectionAdapter connectionAdapter); GetFeaturesOutput getFeaturesFromRegistry(ConnectionAdapter conn); }
ShimSwitchConnectionHandlerImpl implements SwitchConnectionHandler, ICoreListener, IHandshakeListener { public void handshake(ConnectionAdapter connectionAdapter) { HelloInputBuilder builder = new HelloInputBuilder(); builder.setVersion((short) getMaxOFSupportedProtocol()); builder.setXid(DEFAULT_XID); List<Elements> elements = new ArrayList<Elements>(); builder.setElements(elements); connectionAdapter.hello(builder.build()); } ShimSwitchConnectionHandlerImpl(ZeroMQBaseConnector connector,
            NotificationPublishService _notificationProviderService); void setSwitchFeaturesUtil(SwitchFeaturesUtil featureUtil); void init(); ShimRelay createShimRelay(); ConnectionAdaptersRegistry createConnectionAdaptersRegistry(); @Override boolean accept(InetAddress arg0); @Override void onSwitchConnected(ConnectionAdapter connectionAdapter); void handshake(ConnectionAdapter connectionAdapter); @Override void onSwitchHelloMessage(long xid, Short version, ConnectionAdapter connectionAdapter); NodeUpdated nodeAdded(ConnectionAdapter connectionAdapter); static InstanceIdentifier<Node> identifierFromDatapathId(final BigInteger datapathId); static NodeKey nodeKeyFromDatapathId(final BigInteger datapathId); static NodeId nodeIdFromDatapathId(final BigInteger datapathId); byte getMaxOFSupportedProtocol(); List<Byte> getSupportedOFProtocols(); int getNumberOfSwitches(); Pair<Protocol, ProtocolVersions> getSupportedProtocol(); void setSupportedProtocol(byte version); @Override void onOpenFlowCoreMessage(Long datapathId, ByteBuf msg, int moduleId); @Override void onHelloCoreMessage(List<Pair<Protocol, ProtocolVersions>> requestedProtocols, int moduleId); void collectGetFeaturesOuput(Future<RpcResult<GetFeaturesOutput>> switchReply,
            final ConnectionAdapter connectionAdapter); void sendGetFeaturesOuputToCore(final Short proposedVersion, final int moduleId,
            final ConnectionAdapter connectionAdapter); void sendGetFeaturesToSwitch(final Short proposedVersion, final Long xid,
            final ConnectionAdapter connectionAdapter); @Override void onSwitchDisconnected(ConnectionAdapter connectionAdapter); GetFeaturesOutput getFeaturesFromRegistry(ConnectionAdapter conn); static final Long DEFAULT_XID; }