@Test(expected = NullPointerException.class) public void testCreateTunnelNullNetworkId() { provider.createTunnel(null, null, null); }
@Override public TunnelId createTunnel(NetworkId networkId, ConnectPoint src, ConnectPoint dst) { checkNotNull(networkId, NETWORK_ID_NULL); checkNotNull(src, CONNECT_POINT_NULL); checkNotNull(dst, CONNECT_POINT_NULL); Key intentKey = encodeKey(networkId, src, dst); List<Constraint> constraints = new ArrayList<>(); constraints.add(new EncapsulationConstraint(EncapsulationType.VLAN)); PointToPointIntent intent = PointToPointIntent.builder() .key(intentKey) .appId(appId) .ingressPoint(src) .egressPoint(dst) .constraints(constraints) .build(); intentService.submit(intent); return TunnelId.valueOf(intentKey.toString()); }
PtToPtIntentVirtualNetworkProvider extends AbstractProvider implements VirtualNetworkProvider { @Override public TunnelId createTunnel(NetworkId networkId, ConnectPoint src, ConnectPoint dst) { checkNotNull(networkId, NETWORK_ID_NULL); checkNotNull(src, CONNECT_POINT_NULL); checkNotNull(dst, CONNECT_POINT_NULL); Key intentKey = encodeKey(networkId, src, dst); List<Constraint> constraints = new ArrayList<>(); constraints.add(new EncapsulationConstraint(EncapsulationType.VLAN)); PointToPointIntent intent = PointToPointIntent.builder() .key(intentKey) .appId(appId) .ingressPoint(src) .egressPoint(dst) .constraints(constraints) .build(); intentService.submit(intent); return TunnelId.valueOf(intentKey.toString()); } }
PtToPtIntentVirtualNetworkProvider extends AbstractProvider implements VirtualNetworkProvider { @Override public TunnelId createTunnel(NetworkId networkId, ConnectPoint src, ConnectPoint dst) { checkNotNull(networkId, NETWORK_ID_NULL); checkNotNull(src, CONNECT_POINT_NULL); checkNotNull(dst, CONNECT_POINT_NULL); Key intentKey = encodeKey(networkId, src, dst); List<Constraint> constraints = new ArrayList<>(); constraints.add(new EncapsulationConstraint(EncapsulationType.VLAN)); PointToPointIntent intent = PointToPointIntent.builder() .key(intentKey) .appId(appId) .ingressPoint(src) .egressPoint(dst) .constraints(constraints) .build(); intentService.submit(intent); return TunnelId.valueOf(intentKey.toString()); } PtToPtIntentVirtualNetworkProvider(); }
PtToPtIntentVirtualNetworkProvider extends AbstractProvider implements VirtualNetworkProvider { @Override public TunnelId createTunnel(NetworkId networkId, ConnectPoint src, ConnectPoint dst) { checkNotNull(networkId, NETWORK_ID_NULL); checkNotNull(src, CONNECT_POINT_NULL); checkNotNull(dst, CONNECT_POINT_NULL); Key intentKey = encodeKey(networkId, src, dst); List<Constraint> constraints = new ArrayList<>(); constraints.add(new EncapsulationConstraint(EncapsulationType.VLAN)); PointToPointIntent intent = PointToPointIntent.builder() .key(intentKey) .appId(appId) .ingressPoint(src) .egressPoint(dst) .constraints(constraints) .build(); intentService.submit(intent); return TunnelId.valueOf(intentKey.toString()); } PtToPtIntentVirtualNetworkProvider(); @Activate void activate(); @Deactivate void deactivate(); @Override TunnelId createTunnel(NetworkId networkId, ConnectPoint src, ConnectPoint dst); @Override void destroyTunnel(NetworkId networkId, TunnelId tunnelId); }
PtToPtIntentVirtualNetworkProvider extends AbstractProvider implements VirtualNetworkProvider { @Override public TunnelId createTunnel(NetworkId networkId, ConnectPoint src, ConnectPoint dst) { checkNotNull(networkId, NETWORK_ID_NULL); checkNotNull(src, CONNECT_POINT_NULL); checkNotNull(dst, CONNECT_POINT_NULL); Key intentKey = encodeKey(networkId, src, dst); List<Constraint> constraints = new ArrayList<>(); constraints.add(new EncapsulationConstraint(EncapsulationType.VLAN)); PointToPointIntent intent = PointToPointIntent.builder() .key(intentKey) .appId(appId) .ingressPoint(src) .egressPoint(dst) .constraints(constraints) .build(); intentService.submit(intent); return TunnelId.valueOf(intentKey.toString()); } PtToPtIntentVirtualNetworkProvider(); @Activate void activate(); @Deactivate void deactivate(); @Override TunnelId createTunnel(NetworkId networkId, ConnectPoint src, ConnectPoint dst); @Override void destroyTunnel(NetworkId networkId, TunnelId tunnelId);  }