@Test public void testAddKey() { DeviceKeyId deviceKeyId = DeviceKeyId.deviceKeyId(deviceKeyIdValue); DeviceKey deviceKey = DeviceKey.createDeviceKeyUsingCommunityName(deviceKeyId, deviceKeyLabel, deviceKeySnmpName); Collection<DeviceKey> deviceKeys = manager.getDeviceKeys(); assertTrue("The device key set should be empty.", deviceKeys.isEmpty()); manager.addKey(deviceKey); deviceKeys = manager.getDeviceKeys(); assertEquals("There should be one device key in the set.", deviceKeys.size(), 1); deviceKey = manager.getDeviceKey(deviceKeyId); assertEquals("There should be one device key in the set.", deviceKeys.size(), 1); validateEvents(DeviceKeyEvent.Type.DEVICE_KEY_ADDED); }
@Override public void addKey(DeviceKey deviceKey) { checkNotNull(deviceKey, "Device key cannot be null"); store.createOrUpdateDeviceKey(deviceKey); }
DeviceKeyManager extends AbstractListenerManager<DeviceKeyEvent, DeviceKeyListener> implements DeviceKeyService, DeviceKeyAdminService { @Override public void addKey(DeviceKey deviceKey) { checkNotNull(deviceKey, "Device key cannot be null"); store.createOrUpdateDeviceKey(deviceKey); } }
DeviceKeyManager extends AbstractListenerManager<DeviceKeyEvent, DeviceKeyListener> implements DeviceKeyService, DeviceKeyAdminService { @Override public void addKey(DeviceKey deviceKey) { checkNotNull(deviceKey, "Device key cannot be null"); store.createOrUpdateDeviceKey(deviceKey); }  }
DeviceKeyManager extends AbstractListenerManager<DeviceKeyEvent, DeviceKeyListener> implements DeviceKeyService, DeviceKeyAdminService { @Override public void addKey(DeviceKey deviceKey) { checkNotNull(deviceKey, "Device key cannot be null"); store.createOrUpdateDeviceKey(deviceKey); }  @Activate void activate(); @Deactivate void deactivate(); @Override void addKey(DeviceKey deviceKey); @Override void removeKey(DeviceKeyId deviceKeyId); @Override Collection<DeviceKey> getDeviceKeys(); @Override DeviceKey getDeviceKey(DeviceKeyId deviceKeyId); }
DeviceKeyManager extends AbstractListenerManager<DeviceKeyEvent, DeviceKeyListener> implements DeviceKeyService, DeviceKeyAdminService { @Override public void addKey(DeviceKey deviceKey) { checkNotNull(deviceKey, "Device key cannot be null"); store.createOrUpdateDeviceKey(deviceKey); }  @Activate void activate(); @Deactivate void deactivate(); @Override void addKey(DeviceKey deviceKey); @Override void removeKey(DeviceKeyId deviceKeyId); @Override Collection<DeviceKey> getDeviceKeys(); @Override DeviceKey getDeviceKey(DeviceKeyId deviceKeyId);  }