blob: add238f3a70dea907f0eb5deafcd6ac5e3345b6b [file] [log] [blame]
Phaneendra Mandabfce51d2015-10-28 17:11:08 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Phaneendra Mandabfce51d2015-10-28 17:11:08 +05303 *
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 */
16package org.onosproject.vtnrsc.portpair;
17
Mahesh Poojary S28bfba72015-12-05 14:14:37 +053018import org.onosproject.event.ListenerService;
Phaneendra Mandabfce51d2015-10-28 17:11:08 +053019import org.onosproject.vtnrsc.PortPair;
20import org.onosproject.vtnrsc.PortPairId;
Phaneendra Mandabfce51d2015-10-28 17:11:08 +053021/**
22 * Service for interacting with the inventory of port pairs.
23 */
Mahesh Poojary S28bfba72015-12-05 14:14:37 +053024public interface PortPairService extends ListenerService<PortPairEvent, PortPairListener> {
Phaneendra Mandabfce51d2015-10-28 17:11:08 +053025
26 /**
27 * Returns if the port pair is existed.
28 *
29 * @param portPairId port pair identifier
30 * @return true or false if one with the given identifier exists.
31 */
32 boolean exists(PortPairId portPairId);
33
34 /**
35 * Returns the number of port pairs known to the system.
36 *
37 * @return number of port pairs.
38 */
39 int getPortPairCount();
40
41 /**
42 * Returns an iterable collection of the currently known port pairs.
43 *
44 * @return collection of port pairs.
45 */
46 Iterable<PortPair> getPortPairs();
47
48 /**
49 * Returns the portPair with the given identifier.
50 *
51 * @param portPairId port pair identifier
52 * @return PortPair or null if port pair with the given identifier is not
53 * known.
54 */
55 PortPair getPortPair(PortPairId portPairId);
56
57 /**
58 * Creates a PortPair in the store.
59 *
60 * @param portPair the port pair to create
61 * @return true if given port pair is created successfully.
62 */
63 boolean createPortPair(PortPair portPair);
64
65 /**
66 * Updates the portPair in the store.
67 *
68 * @param portPair the port pair to update
69 * @return true if given port pair is updated successfully.
70 */
71 boolean updatePortPair(PortPair portPair);
72
73 /**
74 * Deletes portPair by given portPairId.
75 *
76 * @param portPairId id of port pair to remove
77 * @return true if the give port pair is deleted successfully.
78 */
79 boolean removePortPair(PortPairId portPairId);
Phaneendra Mandabfce51d2015-10-28 17:11:08 +053080}