blob: c7bce1b77d30a6ea37659aa711177d57671a639f [file] [log] [blame]
Mohammad Shahid4c30ea32017-08-09 18:02:10 +05301/*
2 * Copyright 2017-present Open Networking Foundation
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.evpnopenflow.rsc.vpnport;
18
19import com.fasterxml.jackson.databind.JsonNode;
20import org.onosproject.evpnopenflow.rsc.VpnPort;
21import org.onosproject.evpnopenflow.rsc.VpnPortId;
22
23import java.util.Collection;
24
25
26/**
27 * Service for interacting with the inventory of VPN port.
28 */
29public interface VpnPortService {
30 /**
31 * Returns if the vpnPort is existed.
32 *
33 * @param vpnPortId vpnPort identifier
34 * @return true or false if one with the given identifier is not existed.
35 */
36 boolean exists(VpnPortId vpnPortId);
37
38 /**
39 * Returns the vpnPort with the identifier.
40 *
41 * @param vpnPortId vpnPort ID
42 * @return VpnPort or null if one with the given ID is not know.
43 */
44 VpnPort getPort(VpnPortId vpnPortId);
45
46 /**
47 * Returns the collection of the currently known vpnPort.
48 *
49 * @return collection of VpnPort.
50 */
51 Collection<VpnPort> getPorts();
52
53 /**
54 * Creates vpnPorts by vpnPorts.
55 *
56 * @param vpnPorts the iterable collection of vpnPorts
57 * @return true if all given identifiers created successfully.
58 */
59 boolean createPorts(Iterable<VpnPort> vpnPorts);
60
61 /**
62 * Updates vpnPorts by vpnPorts.
63 *
64 * @param vpnPorts the iterable collection of vpnPorts
65 * @return true if all given identifiers updated successfully.
66 */
67 boolean updatePorts(Iterable<VpnPort> vpnPorts);
68
69 /**
70 * Deletes vpnPortIds by vpnPortIds.
71 *
72 * @param vpnPortIds the iterable collection of vpnPort identifiers
73 * @return true or false if one with the given identifier to delete is
74 * successfully.
75 */
76 boolean removePorts(Iterable<VpnPortId> vpnPortIds);
77
78 /**
79 * process gluon config for vpn port information.
80 *
81 * @param action can be either update or delete
82 * @param key can contain the id and also target information
83 * @param value content of the vpn port configuration
84 */
85 void processGluonConfig(String action, String key, JsonNode value);
86
87 /**
88 * Adds the specified listener to Vpn Port manager.
89 *
90 * @param listener Vpn Port listener
91 */
92 void addListener(VpnPortListener listener);
93
94 /**
95 * Removes the specified listener to Vpn Port manager.
96 *
97 * @param listener Vpn Port listener
98 */
99 void removeListener(VpnPortListener listener);
100}