blob: 3b8727ca37c6ce498b255d4936bf2d9a39e0c507 [file] [log] [blame]
Phaneendra Manda8ec66762015-10-28 18:27:40 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Phaneendra Manda8ec66762015-10-28 18:27:40 +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.portchain;
17
Mahesh Poojary Scc11f722015-11-29 16:09:56 +053018import org.onosproject.event.ListenerService;
Phaneendra Manda8ec66762015-10-28 18:27:40 +053019import org.onosproject.vtnrsc.PortChain;
20import org.onosproject.vtnrsc.PortChainId;
21
22/**
23 * Service for interacting with the inventory of port chains.
24 */
Mahesh Poojary Scc11f722015-11-29 16:09:56 +053025public interface PortChainService extends ListenerService<PortChainEvent, PortChainListener> {
Phaneendra Manda8ec66762015-10-28 18:27:40 +053026
27 /**
28 * Returns if the port chain is existed.
29 *
30 * @param portChainId port chain identifier
31 * @return true or false if one with the given identifier exists.
32 */
33 boolean exists(PortChainId portChainId);
34
35 /**
36 * Returns the number of port chains known to the system.
37 *
38 * @return number of port chains.
39 */
40 int getPortChainCount();
41
42 /**
43 * Returns an iterable collection of the currently known port chains.
44 *
45 * @return collection of port chains.
46 */
47 Iterable<PortChain> getPortChains();
48
49 /**
50 * Returns the portChain with the given identifier.
51 *
52 * @param portChainId port chain identifier
53 * @return PortChain or null if port chain with the given identifier is not
54 * known.
55 */
56 PortChain getPortChain(PortChainId portChainId);
57
58 /**
59 * Creates a PortChain in the store.
60 *
61 * @param portChain the port chain to create
62 * @return true if given port chain is created successfully.
63 */
64 boolean createPortChain(PortChain portChain);
65
66 /**
67 * Updates the portChain in the store.
68 *
69 * @param portChain the port chain to update
70 * @return true if given port chain is updated successfully.
71 */
72 boolean updatePortChain(PortChain portChain);
73
74 /**
75 * Deletes portChain by given portChainId.
76 *
77 * @param portChainId id of port chain to remove
78 * @return true if the give port chain is deleted successfully.
79 */
80 boolean removePortChain(PortChainId portChainId);
81}