@Test(expected = NullPointerException.class) public void onWriteTestNull() { resolvedPolicyListener.processResolvedPolicyNotification(null); }
@VisibleForTesting void processResolvedPolicyNotification(ResolvedPolicy resolvedPolicy) { checkNotNull(resolvedPolicy); Set<IovisorModuleInstanceId> ioms = new HashSet<>(); List<IovisorModuleInstanceId> tempIoms = new ArrayList<>(); tempIoms = iovisorModuleManager.getIovisorModulesByTenantByEpg(resolvedPolicy.getProviderTenantId(), resolvedPolicy.getProviderEpgId()); if (tempIoms == null || tempIoms.isEmpty()) { LOG.info("No IovisorModule found for Tenant: {} EndpointGroup: {}. Therefore no endpoints to process.", resolvedPolicy.getProviderTenantId().getValue(), resolvedPolicy.getProviderEpgId().getValue()); return; } ioms.addAll(tempIoms); tempIoms = iovisorModuleManager.getIovisorModulesByTenantByEpg(resolvedPolicy.getConsumerTenantId(), resolvedPolicy.getConsumerEpgId()); if (tempIoms == null || tempIoms.isEmpty()) { LOG.info("No IovisorModule found for Tenant: {} EndpointGroup: {}. Therefore no endpoints to process.", resolvedPolicy.getConsumerTenantId().getValue(), resolvedPolicy.getConsumerEpgId().getValue()); return; } ioms.addAll(tempIoms); for (IovisorModuleInstanceId iom : ioms) { IovisorModuleInstance iomInstance = iovisorModuleManager.getActiveIovisorModule(iom.getId()); RestClient restClient = new RestClient("http: restClient.post(IovisorRenderer.IOVISOR_MODULE_LISTENER_BASE_URL, buildPolicyUris(resolvedPolicy)); } }
ResolvedPolicyListener extends DataTreeChangeHandler<ResolvedPolicy> { @VisibleForTesting void processResolvedPolicyNotification(ResolvedPolicy resolvedPolicy) { checkNotNull(resolvedPolicy); Set<IovisorModuleInstanceId> ioms = new HashSet<>(); List<IovisorModuleInstanceId> tempIoms = new ArrayList<>(); tempIoms = iovisorModuleManager.getIovisorModulesByTenantByEpg(resolvedPolicy.getProviderTenantId(), resolvedPolicy.getProviderEpgId()); if (tempIoms == null || tempIoms.isEmpty()) { LOG.info("No IovisorModule found for Tenant: {} EndpointGroup: {}. Therefore no endpoints to process.", resolvedPolicy.getProviderTenantId().getValue(), resolvedPolicy.getProviderEpgId().getValue()); return; } ioms.addAll(tempIoms); tempIoms = iovisorModuleManager.getIovisorModulesByTenantByEpg(resolvedPolicy.getConsumerTenantId(), resolvedPolicy.getConsumerEpgId()); if (tempIoms == null || tempIoms.isEmpty()) { LOG.info("No IovisorModule found for Tenant: {} EndpointGroup: {}. Therefore no endpoints to process.", resolvedPolicy.getConsumerTenantId().getValue(), resolvedPolicy.getConsumerEpgId().getValue()); return; } ioms.addAll(tempIoms); for (IovisorModuleInstanceId iom : ioms) { IovisorModuleInstance iomInstance = iovisorModuleManager.getActiveIovisorModule(iom.getId()); RestClient restClient = new RestClient("http: restClient.post(IovisorRenderer.IOVISOR_MODULE_LISTENER_BASE_URL, buildPolicyUris(resolvedPolicy)); } } }
ResolvedPolicyListener extends DataTreeChangeHandler<ResolvedPolicy> { @VisibleForTesting void processResolvedPolicyNotification(ResolvedPolicy resolvedPolicy) { checkNotNull(resolvedPolicy); Set<IovisorModuleInstanceId> ioms = new HashSet<>(); List<IovisorModuleInstanceId> tempIoms = new ArrayList<>(); tempIoms = iovisorModuleManager.getIovisorModulesByTenantByEpg(resolvedPolicy.getProviderTenantId(), resolvedPolicy.getProviderEpgId()); if (tempIoms == null || tempIoms.isEmpty()) { LOG.info("No IovisorModule found for Tenant: {} EndpointGroup: {}. Therefore no endpoints to process.", resolvedPolicy.getProviderTenantId().getValue(), resolvedPolicy.getProviderEpgId().getValue()); return; } ioms.addAll(tempIoms); tempIoms = iovisorModuleManager.getIovisorModulesByTenantByEpg(resolvedPolicy.getConsumerTenantId(), resolvedPolicy.getConsumerEpgId()); if (tempIoms == null || tempIoms.isEmpty()) { LOG.info("No IovisorModule found for Tenant: {} EndpointGroup: {}. Therefore no endpoints to process.", resolvedPolicy.getConsumerTenantId().getValue(), resolvedPolicy.getConsumerEpgId().getValue()); return; } ioms.addAll(tempIoms); for (IovisorModuleInstanceId iom : ioms) { IovisorModuleInstance iomInstance = iovisorModuleManager.getActiveIovisorModule(iom.getId()); RestClient restClient = new RestClient("http: restClient.post(IovisorRenderer.IOVISOR_MODULE_LISTENER_BASE_URL, buildPolicyUris(resolvedPolicy)); } } ResolvedPolicyListener(DataBroker dataBroker, IovisorModuleManager iovisorModuleManager); }
ResolvedPolicyListener extends DataTreeChangeHandler<ResolvedPolicy> { @VisibleForTesting void processResolvedPolicyNotification(ResolvedPolicy resolvedPolicy) { checkNotNull(resolvedPolicy); Set<IovisorModuleInstanceId> ioms = new HashSet<>(); List<IovisorModuleInstanceId> tempIoms = new ArrayList<>(); tempIoms = iovisorModuleManager.getIovisorModulesByTenantByEpg(resolvedPolicy.getProviderTenantId(), resolvedPolicy.getProviderEpgId()); if (tempIoms == null || tempIoms.isEmpty()) { LOG.info("No IovisorModule found for Tenant: {} EndpointGroup: {}. Therefore no endpoints to process.", resolvedPolicy.getProviderTenantId().getValue(), resolvedPolicy.getProviderEpgId().getValue()); return; } ioms.addAll(tempIoms); tempIoms = iovisorModuleManager.getIovisorModulesByTenantByEpg(resolvedPolicy.getConsumerTenantId(), resolvedPolicy.getConsumerEpgId()); if (tempIoms == null || tempIoms.isEmpty()) { LOG.info("No IovisorModule found for Tenant: {} EndpointGroup: {}. Therefore no endpoints to process.", resolvedPolicy.getConsumerTenantId().getValue(), resolvedPolicy.getConsumerEpgId().getValue()); return; } ioms.addAll(tempIoms); for (IovisorModuleInstanceId iom : ioms) { IovisorModuleInstance iomInstance = iovisorModuleManager.getActiveIovisorModule(iom.getId()); RestClient restClient = new RestClient("http: restClient.post(IovisorRenderer.IOVISOR_MODULE_LISTENER_BASE_URL, buildPolicyUris(resolvedPolicy)); } } ResolvedPolicyListener(DataBroker dataBroker, IovisorModuleManager iovisorModuleManager);  }
ResolvedPolicyListener extends DataTreeChangeHandler<ResolvedPolicy> { @VisibleForTesting void processResolvedPolicyNotification(ResolvedPolicy resolvedPolicy) { checkNotNull(resolvedPolicy); Set<IovisorModuleInstanceId> ioms = new HashSet<>(); List<IovisorModuleInstanceId> tempIoms = new ArrayList<>(); tempIoms = iovisorModuleManager.getIovisorModulesByTenantByEpg(resolvedPolicy.getProviderTenantId(), resolvedPolicy.getProviderEpgId()); if (tempIoms == null || tempIoms.isEmpty()) { LOG.info("No IovisorModule found for Tenant: {} EndpointGroup: {}. Therefore no endpoints to process.", resolvedPolicy.getProviderTenantId().getValue(), resolvedPolicy.getProviderEpgId().getValue()); return; } ioms.addAll(tempIoms); tempIoms = iovisorModuleManager.getIovisorModulesByTenantByEpg(resolvedPolicy.getConsumerTenantId(), resolvedPolicy.getConsumerEpgId()); if (tempIoms == null || tempIoms.isEmpty()) { LOG.info("No IovisorModule found for Tenant: {} EndpointGroup: {}. Therefore no endpoints to process.", resolvedPolicy.getConsumerTenantId().getValue(), resolvedPolicy.getConsumerEpgId().getValue()); return; } ioms.addAll(tempIoms); for (IovisorModuleInstanceId iom : ioms) { IovisorModuleInstance iomInstance = iovisorModuleManager.getActiveIovisorModule(iom.getId()); RestClient restClient = new RestClient("http: restClient.post(IovisorRenderer.IOVISOR_MODULE_LISTENER_BASE_URL, buildPolicyUris(resolvedPolicy)); } } ResolvedPolicyListener(DataBroker dataBroker, IovisorModuleManager iovisorModuleManager);   }