@Test public void getRole() { connectDevice(DID1, SW1); assertEquals("incorrect role", MastershipRole.MASTER, service.getRole(DID1)); }
@Override public MastershipRole getRole(DeviceId deviceId) { checkPermission(DEVICE_READ); checkNotNull(deviceId, DEVICE_ID_NULL); return mastershipService.getLocalRole(deviceId); }
DeviceManager extends AbstractListenerProviderRegistry<DeviceEvent, DeviceListener, DeviceProvider, DeviceProviderService> implements DeviceService, DeviceAdminService, DeviceProviderRegistry { @Override public MastershipRole getRole(DeviceId deviceId) { checkPermission(DEVICE_READ); checkNotNull(deviceId, DEVICE_ID_NULL); return mastershipService.getLocalRole(deviceId); } }
DeviceManager extends AbstractListenerProviderRegistry<DeviceEvent, DeviceListener, DeviceProvider, DeviceProviderService> implements DeviceService, DeviceAdminService, DeviceProviderRegistry { @Override public MastershipRole getRole(DeviceId deviceId) { checkPermission(DEVICE_READ); checkNotNull(deviceId, DEVICE_ID_NULL); return mastershipService.getLocalRole(deviceId); }  }
DeviceManager extends AbstractListenerProviderRegistry<DeviceEvent, DeviceListener, DeviceProvider, DeviceProviderService> implements DeviceService, DeviceAdminService, DeviceProviderRegistry { @Override public MastershipRole getRole(DeviceId deviceId) { checkPermission(DEVICE_READ); checkNotNull(deviceId, DEVICE_ID_NULL); return mastershipService.getLocalRole(deviceId); }  @Activate void activate(); @Deactivate void deactivate(); @Override int getDeviceCount(); @Override Iterable<Device> getDevices(); @Override Iterable<Device> getAvailableDevices(); @Override Device getDevice(DeviceId deviceId); @Override MastershipRole getRole(DeviceId deviceId); @Override List<Port> getPorts(DeviceId deviceId); @Override List<PortStatistics> getPortStatistics(DeviceId deviceId); @Override List<PortStatistics> getPortDeltaStatistics(DeviceId deviceId); @Override Port getPort(DeviceId deviceId, PortNumber portNumber); @Override boolean isAvailable(DeviceId deviceId); @Override void removeDevice(DeviceId deviceId); @Override void changePortState(DeviceId deviceId, PortNumber portNumber,
                                boolean enable); @Override Iterable<Device> getDevices(Type type); @Override Iterable<Device> getAvailableDevices(Type type); }
DeviceManager extends AbstractListenerProviderRegistry<DeviceEvent, DeviceListener, DeviceProvider, DeviceProviderService> implements DeviceService, DeviceAdminService, DeviceProviderRegistry { @Override public MastershipRole getRole(DeviceId deviceId) { checkPermission(DEVICE_READ); checkNotNull(deviceId, DEVICE_ID_NULL); return mastershipService.getLocalRole(deviceId); }  @Activate void activate(); @Deactivate void deactivate(); @Override int getDeviceCount(); @Override Iterable<Device> getDevices(); @Override Iterable<Device> getAvailableDevices(); @Override Device getDevice(DeviceId deviceId); @Override MastershipRole getRole(DeviceId deviceId); @Override List<Port> getPorts(DeviceId deviceId); @Override List<PortStatistics> getPortStatistics(DeviceId deviceId); @Override List<PortStatistics> getPortDeltaStatistics(DeviceId deviceId); @Override Port getPort(DeviceId deviceId, PortNumber portNumber); @Override boolean isAvailable(DeviceId deviceId); @Override void removeDevice(DeviceId deviceId); @Override void changePortState(DeviceId deviceId, PortNumber portNumber,
                                boolean enable); @Override Iterable<Device> getDevices(Type type); @Override Iterable<Device> getAvailableDevices(Type type);  }