@Test public void updateEndpointL3TestNewL3EpValidInternal() throws Exception { when(newL3Ep.getTenant()).thenReturn(mock(TenantId.class)); when(newL3Ep.getEndpointGroup()).thenReturn(mock(EndpointGroupId.class)); when(newL3Ep.getL3Context()).thenReturn(mock(L3ContextId.class)); when(newL3Ep.getIpAddress()).thenReturn(mock(IpAddress.class)); OfOverlayL3Context ofOverlayL3Context = mock(OfOverlayL3Context.class); when(newL3Ep.getAugmentation(OfOverlayL3Context.class)).thenReturn(ofOverlayL3Context); when(newL3Ep.getNetworkContainment()).thenReturn(null); when(newL3Ep.getL2Context()).thenReturn(mock(L2BridgeDomainId.class)); when(newL3Ep.getMacAddress()).thenReturn(mock(MacAddress.class)); when(newL3Ep.getIpAddress()).thenReturn(new IpAddress(new Ipv4Address("1.1.1.1"))); manager.processL3Endpoint(null, newL3Ep); verify(endpointListener).endpointUpdated(any(EpKey.class)); }
protected synchronized void processL3Endpoint(EndpointL3 oldL3Ep, EndpointL3 newL3Ep) { if (oldL3Ep == null && newL3Ep != null) { createL3Endpoint(newL3Ep); OFStatisticsManager.addL3Endpoint(newL3Ep); } if (oldL3Ep != null && newL3Ep != null) { updateL3Endpoint(newL3Ep); } if (oldL3Ep != null && newL3Ep == null) { OFStatisticsManager.removeL3Endpoint(oldL3Ep); removeL3Endpoint(oldL3Ep); } }
EndpointManager implements AutoCloseable { protected synchronized void processL3Endpoint(EndpointL3 oldL3Ep, EndpointL3 newL3Ep) { if (oldL3Ep == null && newL3Ep != null) { createL3Endpoint(newL3Ep); OFStatisticsManager.addL3Endpoint(newL3Ep); } if (oldL3Ep != null && newL3Ep != null) { updateL3Endpoint(newL3Ep); } if (oldL3Ep != null && newL3Ep == null) { OFStatisticsManager.removeL3Endpoint(oldL3Ep); removeL3Endpoint(oldL3Ep); } } }
EndpointManager implements AutoCloseable { protected synchronized void processL3Endpoint(EndpointL3 oldL3Ep, EndpointL3 newL3Ep) { if (oldL3Ep == null && newL3Ep != null) { createL3Endpoint(newL3Ep); OFStatisticsManager.addL3Endpoint(newL3Ep); } if (oldL3Ep != null && newL3Ep != null) { updateL3Endpoint(newL3Ep); } if (oldL3Ep != null && newL3Ep == null) { OFStatisticsManager.removeL3Endpoint(oldL3Ep); removeL3Endpoint(oldL3Ep); } } EndpointManager(DataBroker dataProvider,PacketProcessingService packetProcessingService,
            SalFlowService flowService, NotificationService notificationService,
            ScheduledExecutorService executor, SwitchManager switchManager); }
EndpointManager implements AutoCloseable { protected synchronized void processL3Endpoint(EndpointL3 oldL3Ep, EndpointL3 newL3Ep) { if (oldL3Ep == null && newL3Ep != null) { createL3Endpoint(newL3Ep); OFStatisticsManager.addL3Endpoint(newL3Ep); } if (oldL3Ep != null && newL3Ep != null) { updateL3Endpoint(newL3Ep); } if (oldL3Ep != null && newL3Ep == null) { OFStatisticsManager.removeL3Endpoint(oldL3Ep); removeL3Endpoint(oldL3Ep); } } EndpointManager(DataBroker dataProvider,PacketProcessingService packetProcessingService,
            SalFlowService flowService, NotificationService notificationService,
            ScheduledExecutorService executor, SwitchManager switchManager); void registerListener(EndpointListener listener); synchronized Set<EgKey> getGroupsForNode(NodeId nodeId); synchronized Set<NodeId> getNodesForGroup(final EgKey egKey); synchronized Collection<Endpoint> getEndpointsForNode(NodeId nodeId, EgKey eg); synchronized Collection<Endpoint> getEndpointsForNode(final NodeId nodeId); Endpoint getEndpoint(EpKey epKey); HashSet<Endpoint> getEndpoints(); synchronized Collection<Endpoint> getEndpointsForGroup(EgKey eg); synchronized Collection<Endpoint> getExtEpsNoLocForGroup(final EgKey eg); @Override void close(); static boolean isExternal(Endpoint ep, @Nullable Collection<ExternalImplicitGroup> eigs); static boolean isInternal(Endpoint ep, @Nullable Collection<ExternalImplicitGroup> eigs); Endpoint getL2EndpointFromL3(EndpointL3 endpointL3); EndpointL3 getL3Endpoint(L3ContextId l3c, IpAddress ipAddress, @Nullable TenantId tenantId); Collection<EndpointL3Prefix> getEndpointsL3PrefixForTenant(final TenantId tenantId); @Nonnull Collection<EndpointL3> getL3EndpointsWithNat(); @SuppressWarnings({"UnusedParameters", "EmptyMethod"}) void setLearningMode(OfOverlayConfig.LearningMode learningMode); List<ConditionName> getConditionsForEndpoint(Endpoint endpoint); NodeId getEndpointNodeId(Endpoint endpoint); NodeConnectorId getEndpointNodeConnectorId(Endpoint endpoint); Set<EgKey> getEgKeysForEndpoint(Endpoint ep); EgKey getEgKey(Endpoint endpoint); }
EndpointManager implements AutoCloseable { protected synchronized void processL3Endpoint(EndpointL3 oldL3Ep, EndpointL3 newL3Ep) { if (oldL3Ep == null && newL3Ep != null) { createL3Endpoint(newL3Ep); OFStatisticsManager.addL3Endpoint(newL3Ep); } if (oldL3Ep != null && newL3Ep != null) { updateL3Endpoint(newL3Ep); } if (oldL3Ep != null && newL3Ep == null) { OFStatisticsManager.removeL3Endpoint(oldL3Ep); removeL3Endpoint(oldL3Ep); } } EndpointManager(DataBroker dataProvider,PacketProcessingService packetProcessingService,
            SalFlowService flowService, NotificationService notificationService,
            ScheduledExecutorService executor, SwitchManager switchManager); void registerListener(EndpointListener listener); synchronized Set<EgKey> getGroupsForNode(NodeId nodeId); synchronized Set<NodeId> getNodesForGroup(final EgKey egKey); synchronized Collection<Endpoint> getEndpointsForNode(NodeId nodeId, EgKey eg); synchronized Collection<Endpoint> getEndpointsForNode(final NodeId nodeId); Endpoint getEndpoint(EpKey epKey); HashSet<Endpoint> getEndpoints(); synchronized Collection<Endpoint> getEndpointsForGroup(EgKey eg); synchronized Collection<Endpoint> getExtEpsNoLocForGroup(final EgKey eg); @Override void close(); static boolean isExternal(Endpoint ep, @Nullable Collection<ExternalImplicitGroup> eigs); static boolean isInternal(Endpoint ep, @Nullable Collection<ExternalImplicitGroup> eigs); Endpoint getL2EndpointFromL3(EndpointL3 endpointL3); EndpointL3 getL3Endpoint(L3ContextId l3c, IpAddress ipAddress, @Nullable TenantId tenantId); Collection<EndpointL3Prefix> getEndpointsL3PrefixForTenant(final TenantId tenantId); @Nonnull Collection<EndpointL3> getL3EndpointsWithNat(); @SuppressWarnings({"UnusedParameters", "EmptyMethod"}) void setLearningMode(OfOverlayConfig.LearningMode learningMode); List<ConditionName> getConditionsForEndpoint(Endpoint endpoint); NodeId getEndpointNodeId(Endpoint endpoint); NodeConnectorId getEndpointNodeConnectorId(Endpoint endpoint); Set<EgKey> getEgKeysForEndpoint(Endpoint ep); EgKey getEgKey(Endpoint endpoint);  }