@Test public void testDeviceClassIndex() throws Exception { EnumSet<IDeviceService.DeviceField> indexFields = EnumSet.noneOf(IDeviceService.DeviceField.class); indexFields.add(IDeviceService.DeviceField.IPv4); indexFields.add(IDeviceService.DeviceField.VLAN); deviceManager.addIndex(true, indexFields); ITopologyService mockTopology = createMock(ITopologyService.class); deviceManager.topology = mockTopology; expect(mockTopology.isAttachmentPointPort(DatapathId.of(anyLong()), OFPort.of(anyShort()))). andReturn(true).anyTimes(); expect(mockTopology.getOpenflowDomainId(DatapathId.of(EasyMock.anyLong()))).andReturn(DatapathId.of(1L)).anyTimes(); replay(mockTopology); doTestDeviceClassQuery(); }
@Override public void addIndex(boolean perClass, EnumSet<DeviceField> keyFields) { if (perClass) { perClassIndices.add(keyFields); } else { secondaryIndexMap.put(keyFields, new DeviceMultiIndex(keyFields)); } }
DeviceManagerImpl implements IDeviceService, IOFMessageListener, ITopologyListener, IFloodlightModule, IEntityClassListener, IInfoProvider { @Override public void addIndex(boolean perClass, EnumSet<DeviceField> keyFields) { if (perClass) { perClassIndices.add(keyFields); } else { secondaryIndexMap.put(keyFields, new DeviceMultiIndex(keyFields)); } } }
DeviceManagerImpl implements IDeviceService, IOFMessageListener, ITopologyListener, IFloodlightModule, IEntityClassListener, IInfoProvider { @Override public void addIndex(boolean perClass, EnumSet<DeviceField> keyFields) { if (perClass) { perClassIndices.add(keyFields); } else { secondaryIndexMap.put(keyFields, new DeviceMultiIndex(keyFields)); } }  }
DeviceManagerImpl implements IDeviceService, IOFMessageListener, ITopologyListener, IFloodlightModule, IEntityClassListener, IInfoProvider { @Override public void addIndex(boolean perClass, EnumSet<DeviceField> keyFields) { if (perClass) { perClassIndices.add(keyFields); } else { secondaryIndexMap.put(keyFields, new DeviceMultiIndex(keyFields)); } }  @Override IDevice getDevice(Long deviceKey); @Override IDevice findDevice(@Nonnull MacAddress macAddress, VlanVid vlan,
			@Nonnull IPv4Address ipv4Address, @Nonnull IPv6Address ipv6Address,
			@Nonnull DatapathId switchDPID, @Nonnull OFPort switchPort); @Override IDevice findClassDevice(@Nonnull IEntityClass entityClass, @Nonnull MacAddress macAddress,
			@Nonnull VlanVid vlan, @Nonnull IPv4Address ipv4Address, @Nonnull IPv6Address ipv6Address); @Override Collection<? extends IDevice> getAllDevices(); @Override void addIndex(boolean perClass,
			EnumSet<DeviceField> keyFields); @Override Iterator<? extends IDevice> queryDevices(@Nonnull MacAddress macAddress,
			VlanVid vlan,
			@Nonnull IPv4Address ipv4Address,
			@Nonnull IPv6Address ipv6Address,
			@Nonnull DatapathId switchDPID,
			@Nonnull OFPort switchPort); @Override Iterator<? extends IDevice> queryClassDevices(@Nonnull IEntityClass entityClass,
			@Nonnull MacAddress macAddress,
			@Nonnull VlanVid vlan,
			@Nonnull IPv4Address ipv4Address,
			@Nonnull IPv6Address ipv6Address,
			@Nonnull DatapathId switchDPID,
			@Nonnull OFPort switchPort); @Override void addListener(IDeviceListener listener); @Override void addSuppressAPs(DatapathId swId, OFPort port); @Override void removeSuppressAPs(DatapathId swId, OFPort port); @Override Set<SwitchPort> getSuppressAPs(); @Override Map<String, Object> getInfo(String type); @Override String getName(); @Override boolean isCallbackOrderingPrereq(OFType type, String name); @Override boolean isCallbackOrderingPostreq(OFType type, String name); @Override Command receive(IOFSwitch sw, OFMessage msg,
			FloodlightContext cntx); @Override Collection<Class<? extends IFloodlightService>> getModuleServices(); @Override Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls(); @Override Collection<Class<? extends IFloodlightService>> getModuleDependencies(); @Override void init(FloodlightModuleContext fmc); @Override void startUp(FloodlightModuleContext fmc); boolean isValidAttachmentPoint(DatapathId switchDPID,
			OFPort switchPort); @Override void topologyChanged(List<LDUpdate> updateList); @Override void entityClassChanged(Set<String> entityClassNames); }
DeviceManagerImpl implements IDeviceService, IOFMessageListener, ITopologyListener, IFloodlightModule, IEntityClassListener, IInfoProvider { @Override public void addIndex(boolean perClass, EnumSet<DeviceField> keyFields) { if (perClass) { perClassIndices.add(keyFields); } else { secondaryIndexMap.put(keyFields, new DeviceMultiIndex(keyFields)); } }  @Override IDevice getDevice(Long deviceKey); @Override IDevice findDevice(@Nonnull MacAddress macAddress, VlanVid vlan,
			@Nonnull IPv4Address ipv4Address, @Nonnull IPv6Address ipv6Address,
			@Nonnull DatapathId switchDPID, @Nonnull OFPort switchPort); @Override IDevice findClassDevice(@Nonnull IEntityClass entityClass, @Nonnull MacAddress macAddress,
			@Nonnull VlanVid vlan, @Nonnull IPv4Address ipv4Address, @Nonnull IPv6Address ipv6Address); @Override Collection<? extends IDevice> getAllDevices(); @Override void addIndex(boolean perClass,
			EnumSet<DeviceField> keyFields); @Override Iterator<? extends IDevice> queryDevices(@Nonnull MacAddress macAddress,
			VlanVid vlan,
			@Nonnull IPv4Address ipv4Address,
			@Nonnull IPv6Address ipv6Address,
			@Nonnull DatapathId switchDPID,
			@Nonnull OFPort switchPort); @Override Iterator<? extends IDevice> queryClassDevices(@Nonnull IEntityClass entityClass,
			@Nonnull MacAddress macAddress,
			@Nonnull VlanVid vlan,
			@Nonnull IPv4Address ipv4Address,
			@Nonnull IPv6Address ipv6Address,
			@Nonnull DatapathId switchDPID,
			@Nonnull OFPort switchPort); @Override void addListener(IDeviceListener listener); @Override void addSuppressAPs(DatapathId swId, OFPort port); @Override void removeSuppressAPs(DatapathId swId, OFPort port); @Override Set<SwitchPort> getSuppressAPs(); @Override Map<String, Object> getInfo(String type); @Override String getName(); @Override boolean isCallbackOrderingPrereq(OFType type, String name); @Override boolean isCallbackOrderingPostreq(OFType type, String name); @Override Command receive(IOFSwitch sw, OFMessage msg,
			FloodlightContext cntx); @Override Collection<Class<? extends IFloodlightService>> getModuleServices(); @Override Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls(); @Override Collection<Class<? extends IFloodlightService>> getModuleDependencies(); @Override void init(FloodlightModuleContext fmc); @Override void startUp(FloodlightModuleContext fmc); boolean isValidAttachmentPoint(DatapathId switchDPID,
			OFPort switchPort); @Override void topologyChanged(List<LDUpdate> updateList); @Override void entityClassChanged(Set<String> entityClassNames); static final String MODULE_NAME; static final String PACKAGE; public IDebugCounter cntIncoming; public IDebugCounter cntReconcileRequest; public IDebugCounter cntReconcileNoSource; public IDebugCounter cntReconcileNoDest; public IDebugCounter cntInvalidSource; public IDebugCounter cntInvalidDest; public IDebugCounter cntNoSource; public IDebugCounter cntNoDest; public IDebugCounter cntDhcpClientNameSnooped; public IDebugCounter cntDeviceOnInternalPortNotLearned; public IDebugCounter cntPacketNotAllowed; public IDebugCounter cntNewDevice; public IDebugCounter cntPacketOnInternalPortForKnownDevice; public IDebugCounter cntNewEntity; public IDebugCounter cntDeviceChanged; public IDebugCounter cntDeviceMoved; public IDebugCounter cntCleanupEntitiesRuns; public IDebugCounter cntEntityRemovedTimeout; public IDebugCounter cntDeviceDeleted; public IDebugCounter cntDeviceReclassifyDelete; public IDebugCounter cntDeviceStrored; public IDebugCounter cntDeviceStoreThrottled; public IDebugCounter cntDeviceRemovedFromStore; public IDebugCounter cntSyncException; public IDebugCounter cntDevicesFromStore; public IDebugCounter cntConsolidateStoreRuns; public IDebugCounter cntConsolidateStoreDevicesRemoved; public IDebugCounter cntTransitionToMaster; public AttachmentPointComparator apComparator; public SingletonTask entityCleanupTask; }