@Test public void testDeviceIndex() throws Exception { EnumSet<IDeviceService.DeviceField> indexFields = EnumSet.noneOf(IDeviceService.DeviceField.class); indexFields.add(IDeviceService.DeviceField.IPV4); indexFields.add(IDeviceService.DeviceField.VLAN); deviceManager.addIndex(false, indexFields); indexFields = EnumSet.noneOf(IDeviceService.DeviceField.class); deviceManager.addIndex(false, indexFields); ITopologyService mockTopology = createMock(ITopologyService.class); deviceManager.topology = mockTopology; expect(mockTopology.isAttachmentPointPort(anyLong(), anyShort())). andReturn(true).anyTimes(); expect(mockTopology.getL2DomainId(EasyMock.anyLong())).andReturn(1L).anyTimes(); replay(mockTopology); doTestDeviceQuery(); }
@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,
IFlowReconcileListener, 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,
IFlowReconcileListener, 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,
IFlowReconcileListener, 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(long macAddress, Short vlan,
                              Integer ipv4Address, Long switchDPID,
                              Integer switchPort); @Override IDevice findClassDevice(IEntityClass entityClass, long macAddress,
                                  Short vlan, Integer ipv4Address); @Override Collection<? extends IDevice> getAllDevices(); @Override void addIndex(boolean perClass,
                         EnumSet<DeviceField> keyFields); @Override Iterator<? extends IDevice> queryDevices(Long macAddress,
                                                    Short vlan,
                                                    Integer ipv4Address,
                                                    Long switchDPID,
                                                    Integer switchPort); @Override Iterator<? extends IDevice> queryClassDevices(IEntityClass entityClass,
                                                         Long macAddress,
                                                         Short vlan,
                                                         Integer ipv4Address,
                                                         Long switchDPID,
                                                         Integer switchPort); @Override void addListener(IDeviceListener listener); @Override void addSuppressAPs(long swId, short port); @Override void removeSuppressAPs(long swId, short 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 Command reconcileFlows(ArrayList<OFMatchReconcile> ofmRcList); @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(long switchDPID,
                                             int switchPort); @Override void topologyChanged(List<LDUpdate> updateList); @Override void entityClassChanged(Set<String> entityClassNames); }
DeviceManagerImpl implements
IDeviceService, IOFMessageListener, ITopologyListener,
IFloodlightModule, IEntityClassListener,
IFlowReconcileListener, 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(long macAddress, Short vlan,
                              Integer ipv4Address, Long switchDPID,
                              Integer switchPort); @Override IDevice findClassDevice(IEntityClass entityClass, long macAddress,
                                  Short vlan, Integer ipv4Address); @Override Collection<? extends IDevice> getAllDevices(); @Override void addIndex(boolean perClass,
                         EnumSet<DeviceField> keyFields); @Override Iterator<? extends IDevice> queryDevices(Long macAddress,
                                                    Short vlan,
                                                    Integer ipv4Address,
                                                    Long switchDPID,
                                                    Integer switchPort); @Override Iterator<? extends IDevice> queryClassDevices(IEntityClass entityClass,
                                                         Long macAddress,
                                                         Short vlan,
                                                         Integer ipv4Address,
                                                         Long switchDPID,
                                                         Integer switchPort); @Override void addListener(IDeviceListener listener); @Override void addSuppressAPs(long swId, short port); @Override void removeSuppressAPs(long swId, short 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 Command reconcileFlows(ArrayList<OFMatchReconcile> ofmRcList); @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(long switchDPID,
                                             int 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; }