@Test public void sync_noEpNodeId() throws Exception { initDataStoreMocks(); EndpointBuilder endpointBuilder = new EndpointBuilder(); Endpoint endpoint = endpointBuilder.build(); when(ctx.getEndpointManager()).thenReturn(endpointManager); groupTable.sync(endpoint, ofWriter); verifyZeroInteractions(ofWriter); }
@Override public void sync(Endpoint endpoint, OfWriter ofWriter) throws Exception { NodeId endpointNodeId = ctx.getEndpointManager().getEndpointNodeId(endpoint); if (endpointNodeId == null) { LOG.warn("Endpoint {} has no location specified, skipped", endpoint); return; } FlowCapableNode fcn = getFCNodeFromDatastore(endpointNodeId); if (fcn == null) return; EndpointFwdCtxOrdinals ordinals = OrdinalFactory.getEndpointFwdCtxOrdinals(ctx, endpoint); if (ordinals == null) { LOG.info("getEndpointFwdCtxOrdinals is null for EP {}", endpoint); return; } GroupId groupId = new GroupId(Long.valueOf(ordinals.getFdId())); if (!ofWriter.groupExists(endpointNodeId, groupId.getValue())) { LOG.info("createGroup {} {}", endpointNodeId, groupId); ofWriter.writeGroup(endpointNodeId, groupId); } syncGroups(endpointNodeId, ordinals, endpoint, groupId, ofWriter); }
GroupTable extends OfTable { @Override public void sync(Endpoint endpoint, OfWriter ofWriter) throws Exception { NodeId endpointNodeId = ctx.getEndpointManager().getEndpointNodeId(endpoint); if (endpointNodeId == null) { LOG.warn("Endpoint {} has no location specified, skipped", endpoint); return; } FlowCapableNode fcn = getFCNodeFromDatastore(endpointNodeId); if (fcn == null) return; EndpointFwdCtxOrdinals ordinals = OrdinalFactory.getEndpointFwdCtxOrdinals(ctx, endpoint); if (ordinals == null) { LOG.info("getEndpointFwdCtxOrdinals is null for EP {}", endpoint); return; } GroupId groupId = new GroupId(Long.valueOf(ordinals.getFdId())); if (!ofWriter.groupExists(endpointNodeId, groupId.getValue())) { LOG.info("createGroup {} {}", endpointNodeId, groupId); ofWriter.writeGroup(endpointNodeId, groupId); } syncGroups(endpointNodeId, ordinals, endpoint, groupId, ofWriter); } }
GroupTable extends OfTable { @Override public void sync(Endpoint endpoint, OfWriter ofWriter) throws Exception { NodeId endpointNodeId = ctx.getEndpointManager().getEndpointNodeId(endpoint); if (endpointNodeId == null) { LOG.warn("Endpoint {} has no location specified, skipped", endpoint); return; } FlowCapableNode fcn = getFCNodeFromDatastore(endpointNodeId); if (fcn == null) return; EndpointFwdCtxOrdinals ordinals = OrdinalFactory.getEndpointFwdCtxOrdinals(ctx, endpoint); if (ordinals == null) { LOG.info("getEndpointFwdCtxOrdinals is null for EP {}", endpoint); return; } GroupId groupId = new GroupId(Long.valueOf(ordinals.getFdId())); if (!ofWriter.groupExists(endpointNodeId, groupId.getValue())) { LOG.info("createGroup {} {}", endpointNodeId, groupId); ofWriter.writeGroup(endpointNodeId, groupId); } syncGroups(endpointNodeId, ordinals, endpoint, groupId, ofWriter); } GroupTable(OfContext ctx); }
GroupTable extends OfTable { @Override public void sync(Endpoint endpoint, OfWriter ofWriter) throws Exception { NodeId endpointNodeId = ctx.getEndpointManager().getEndpointNodeId(endpoint); if (endpointNodeId == null) { LOG.warn("Endpoint {} has no location specified, skipped", endpoint); return; } FlowCapableNode fcn = getFCNodeFromDatastore(endpointNodeId); if (fcn == null) return; EndpointFwdCtxOrdinals ordinals = OrdinalFactory.getEndpointFwdCtxOrdinals(ctx, endpoint); if (ordinals == null) { LOG.info("getEndpointFwdCtxOrdinals is null for EP {}", endpoint); return; } GroupId groupId = new GroupId(Long.valueOf(ordinals.getFdId())); if (!ofWriter.groupExists(endpointNodeId, groupId.getValue())) { LOG.info("createGroup {} {}", endpointNodeId, groupId); ofWriter.writeGroup(endpointNodeId, groupId); } syncGroups(endpointNodeId, ordinals, endpoint, groupId, ofWriter); } GroupTable(OfContext ctx); @Override void sync(Endpoint endpoint, OfWriter ofWriter); }
GroupTable extends OfTable { @Override public void sync(Endpoint endpoint, OfWriter ofWriter) throws Exception { NodeId endpointNodeId = ctx.getEndpointManager().getEndpointNodeId(endpoint); if (endpointNodeId == null) { LOG.warn("Endpoint {} has no location specified, skipped", endpoint); return; } FlowCapableNode fcn = getFCNodeFromDatastore(endpointNodeId); if (fcn == null) return; EndpointFwdCtxOrdinals ordinals = OrdinalFactory.getEndpointFwdCtxOrdinals(ctx, endpoint); if (ordinals == null) { LOG.info("getEndpointFwdCtxOrdinals is null for EP {}", endpoint); return; } GroupId groupId = new GroupId(Long.valueOf(ordinals.getFdId())); if (!ofWriter.groupExists(endpointNodeId, groupId.getValue())) { LOG.info("createGroup {} {}", endpointNodeId, groupId); ofWriter.writeGroup(endpointNodeId, groupId); } syncGroups(endpointNodeId, ordinals, endpoint, groupId, ofWriter); } GroupTable(OfContext ctx); @Override void sync(Endpoint endpoint, OfWriter ofWriter);  }