blob: d25c28f34318c7557d62f68f07bab22d49b9eccc [file] [log] [blame]
Brian Stankeaa6211a2016-02-04 18:22:54 -05001/*
2 * Copyright 2016 Open Networking Laboratory
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
17package org.onosproject.incubator.net.key;
18
19import com.google.common.annotations.Beta;
20import org.onosproject.store.Store;
21
Brian Stankeca93d9a2016-02-10 09:17:35 -050022import java.util.Collection;
23
Brian Stankeaa6211a2016-02-04 18:22:54 -050024/**
25 * Manages inventory of device keys; not intended for direct use.
26 */
27@Beta
28public interface DeviceKeyStore extends Store<DeviceKeyEvent, DeviceKeyStoreDelegate> {
29 /**
30 * Creates or updates a device key.
31 *
32 * @param deviceKey device key
Brian Stankeaa6211a2016-02-04 18:22:54 -050033 */
Brian Stankeca93d9a2016-02-10 09:17:35 -050034 void createOrUpdateDeviceKey(DeviceKey deviceKey);
Brian Stankeaa6211a2016-02-04 18:22:54 -050035
36 /**
37 * Deletes a device key by a specific device key identifier.
38 *
39 * @param deviceKeyId device key unique identifier
Brian Stankeaa6211a2016-02-04 18:22:54 -050040 */
Brian Stankeca93d9a2016-02-10 09:17:35 -050041 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 Stankeaa6211a2016-02-04 18:22:54 -050057}