blob: efee0eb9938df8af3eb3e224f3dadb1b8ff89cc5 [file] [log] [blame]
Phanendra Manda50753d62015-10-28 17:44:57 +05301/*
2 * Copyright 2015 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 */
16package org.onosproject.vtnrsc.portpairgroup;
17
18import org.onosproject.vtnrsc.PortPairGroup;
19import org.onosproject.vtnrsc.PortPairGroupId;
20
21/**
22 * Service for interacting with the inventory of port pair groups.
23 */
24public interface PortPairGroupService {
25
26 /**
27 * Returns if the port pair group is existed.
28 *
29 * @param portPairGroupId port pair group identifier
30 * @return true or false if one with the given identifier exists.
31 */
32 boolean exists(PortPairGroupId portPairGroupId);
33
34 /**
35 * Returns the number of port pair groups known to the system.
36 *
37 * @return number of port pair groups.
38 */
39 int getPortPairGroupCount();
40
41 /**
42 * Returns an iterable collection of the currently known port pair groups.
43 *
44 * @return collection of port pair groups.
45 */
46 Iterable<PortPairGroup> getPortPairGroups();
47
48 /**
49 * Returns the portPairGroup with the given identifier.
50 *
51 * @param portPairGroupId port pair group identifier
52 * @return PortPairGroup or null if port pair group with the given identifier is not
53 * known.
54 */
55 PortPairGroup getPortPairGroup(PortPairGroupId portPairGroupId);
56
57 /**
58 * Creates a PortPairGroup in the store.
59 *
60 * @param portPairGroup the port pair group to create
61 * @return true if given port pair group is created successfully.
62 */
63 boolean createPortPairGroup(PortPairGroup portPairGroup);
64
65 /**
66 * Updates the portPairGroup in the store.
67 *
68 * @param portPairGroup the port pair group to update
69 * @return true if given port pair group is updated successfully.
70 */
71 boolean updatePortPairGroup(PortPairGroup portPairGroup);
72
73 /**
74 * Deletes portPairGroup by given portPairGroupId.
75 *
76 * @param portPairGroupId id of port pair group to remove
77 * @return true if the give port pair group is deleted successfully.
78 */
79 boolean removePortPairGroup(PortPairGroupId portPairGroupId);
Mahesh Poojary Huawei2e4cd652015-11-29 15:28:20 +053080
81 /**
82 * Adds the specified listener to Port-Pair-Group manager.
83 *
84 * @param listener Port-Pair-Group listener
85 */
86 void addListener(PortPairGroupListener listener);
87
88 /**
89 * Removes the specified listener to Port-Pair-Group manager.
90 *
91 * @param listener Port-Pair-Group listener
92 */
93 void removeListener(PortPairGroupListener listener);
Phanendra Manda50753d62015-10-28 17:44:57 +053094}