blob: a584044647e3dc731c500b28fd5f84e39d0eff0d [file] [log] [blame]
Hyunsun Moon44aac662017-02-18 02:07:01 +09001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Hyunsun Moon44aac662017-02-18 02:07:01 +09003 *
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.openstacknetworking.api;
17
18import org.onosproject.store.Store;
19import org.openstack4j.model.network.Network;
20import org.openstack4j.model.network.Port;
21import org.openstack4j.model.network.Subnet;
22
23import java.util.Set;
24
25/**
26 * Manages inventory of OpenStack network states; not intended for direct use.
27 */
28public interface OpenstackNetworkStore
29 extends Store<OpenstackNetworkEvent, OpenstackNetworkStoreDelegate> {
30
31 /**
32 * Creates the new network.
33 *
34 * @param network openstack network
35 */
36 void createNetwork(Network network);
37
38 /**
39 * Updates the network.
40 *
41 * @param network openstack network
42 */
43 void updateNetwork(Network network);
44
45 /**
46 * Removes the network with the given network id.
47 *
48 * @param networkId network id
49 * @return removed openstack network; null if failed
50 */
51 Network removeNetwork(String networkId);
52
53 /**
54 * Returns the network with the given network id.
55 *
56 * @param networkId network id
57 * @return network; null if not found
58 */
59 Network network(String networkId);
60
61 /**
62 * Returns all networks.
63 *
64 * @return set of networks
65 */
66 Set<Network> networks();
67
68 /**
69 * Creates a subnet with the given information.
70 *
71 * @param subnet the new subnet
72 */
73 void createSubnet(Subnet subnet);
74
75 /**
76 * Updates a subnet with the given information.
77 *
78 * @param subnet the updated subnet
79 */
80 void updateSubnet(Subnet subnet);
81
82 /**
83 * Removes the subnet with the given subnet id.
84 *
85 * @param subnetId subnet id
86 * @return removed subnet; null if failed
87 */
88 Subnet removeSubnet(String subnetId);
89
90 /**
91 * Returns the subnet with the supplied subnet ID.
92 *
93 * @param subnetId subnet id
94 * @return subnet
95 */
96 Subnet subnet(String subnetId);
97
98 /**
99 * Returns all subnets registered in the service.
100 *
101 * @return set of subnet
102 */
103 Set<Subnet> subnets();
104
105 /**
106 * Creates the new port.
107 *
108 * @param port the new port
109 */
110 void createPort(Port port);
111
112 /**
113 * Updates the port.
114 *
115 * @param port port
116 */
117 void updatePort(Port port);
118
119 /**
120 * Removes the port.
121 *
122 * @param portId port id
123 * @return removed port; null if failed
124 */
125 Port removePort(String portId);
126
127 /**
128 * Returns the port with the given port id.
129 *
130 * @param portId port id
131 * @return port
132 */
133 Port port(String portId);
134
135 /**
136 * Returns all ports.
137 *
138 * @return set of ports
139 */
140 Set<Port> ports();
Hyunsun Moonc7219222017-03-27 11:05:59 +0900141
142 /**
143 * Removes the existing network and ports.
144 */
145 void clear();
Hyunsun Moon44aac662017-02-18 02:07:01 +0900146}