Brian Stanke | aa6211a | 2016-02-04 18:22:54 -0500 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Brian Stanke | aa6211a | 2016-02-04 18:22:54 -0500 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Claudine Chiu | 31ad527 | 2016-02-17 20:56:24 +0000 | [diff] [blame] | 17 | package org.onosproject.net.key; |
Brian Stanke | aa6211a | 2016-02-04 18:22:54 -0500 | [diff] [blame] | 18 | |
| 19 | import com.google.common.annotations.Beta; |
| 20 | import org.onosproject.store.Store; |
| 21 | |
Brian Stanke | ca93d9a | 2016-02-10 09:17:35 -0500 | [diff] [blame] | 22 | import java.util.Collection; |
| 23 | |
Brian Stanke | aa6211a | 2016-02-04 18:22:54 -0500 | [diff] [blame] | 24 | /** |
| 25 | * Manages inventory of device keys; not intended for direct use. |
| 26 | */ |
| 27 | @Beta |
| 28 | public interface DeviceKeyStore extends Store<DeviceKeyEvent, DeviceKeyStoreDelegate> { |
| 29 | /** |
| 30 | * Creates or updates a device key. |
| 31 | * |
| 32 | * @param deviceKey device key |
Brian Stanke | aa6211a | 2016-02-04 18:22:54 -0500 | [diff] [blame] | 33 | */ |
Brian Stanke | ca93d9a | 2016-02-10 09:17:35 -0500 | [diff] [blame] | 34 | void createOrUpdateDeviceKey(DeviceKey deviceKey); |
Brian Stanke | aa6211a | 2016-02-04 18:22:54 -0500 | [diff] [blame] | 35 | |
| 36 | /** |
| 37 | * Deletes a device key by a specific device key identifier. |
| 38 | * |
| 39 | * @param deviceKeyId device key unique identifier |
Brian Stanke | aa6211a | 2016-02-04 18:22:54 -0500 | [diff] [blame] | 40 | */ |
Brian Stanke | ca93d9a | 2016-02-10 09:17:35 -0500 | [diff] [blame] | 41 | void deleteDeviceKey(DeviceKeyId deviceKeyId); |
| 42 | |
| 43 | /** |
| 44 | * Returns all device keys. |
| 45 | * |
| 46 | * @return set of device keys |
| 47 | */ |
| 48 | Collection<DeviceKey> getDeviceKeys(); |
| 49 | |
| 50 | /** |
| 51 | * Returns the device key matching a device key identifier. |
| 52 | * |
| 53 | * @param deviceKeyId device key unique identifier |
| 54 | * @return device key |
| 55 | */ |
| 56 | DeviceKey getDeviceKey(DeviceKeyId deviceKeyId); |
Brian Stanke | aa6211a | 2016-02-04 18:22:54 -0500 | [diff] [blame] | 57 | } |