blob: 9b6c7d2c2309cf0c8776d30bd40e50c5ec56904e [file] [log] [blame]
xuzhang585f9052015-07-22 11:20:13 +08001/*
2 * Copyright 2015 Open Porting 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.app.vtnrsc.virtualport;
17
18import java.util.Collection;
19
20import org.onosproject.app.vtnrsc.TenantNetworkId;
21import org.onosproject.app.vtnrsc.TenantId;
22import org.onosproject.app.vtnrsc.VirtualPort;
23import org.onosproject.app.vtnrsc.VirtualPortId;
24import org.onosproject.net.DeviceId;
25
26/**
27 * Service for interacting with the inventory of virtualPort.
28 */
29public interface VirtualPortService {
30 /**
31 * Returns if the virtualPort is existed.
32 *
33 * @param virtualPortId virtualPort identifier
34 * @return true or false if one with the given identifier is not existed.
35 */
36 boolean exists(VirtualPortId virtualPortId);
37
38 /**
39 * Returns the virtualPort with the identifier.
40 *
41 * @param virtualPortId virtualPort ID
42 * @return VirtualPort or null if one with the given ID is not know.
43 */
44 VirtualPort getPort(VirtualPortId virtualPortId);
45
46 /**
47 * Returns the collection of the currently known virtualPort.
48 *
49 * @return virtualPort.
50 */
51 Collection<VirtualPort> getPorts();
52
53 /**
54 * Returns the collection of the virtualPorts associated with the networkId.
55 *
Thomas Vachuskad894b5d2015-07-30 11:59:07 -070056 * @param networkId network identifier
57 * @return collection of virtualPort
xuzhang585f9052015-07-22 11:20:13 +080058 */
59 Collection<VirtualPort> getPorts(TenantNetworkId networkId);
60
61 /**
62 * Returns the collection of the virtualPorts associated with the tenantId.
63 *
Thomas Vachuskad894b5d2015-07-30 11:59:07 -070064 * @param tenantId tenant identifier
65 * @return collection of virtualPort
xuzhang585f9052015-07-22 11:20:13 +080066 */
67 Collection<VirtualPort> getPorts(TenantId tenantId);
68
69 /**
70 * Returns the collection of the virtualPorts associated with the deviceId.
71 *
Thomas Vachuskad894b5d2015-07-30 11:59:07 -070072 * @param deviceId device identifier
73 * @return collection of virtualPort
xuzhang585f9052015-07-22 11:20:13 +080074 */
75 Collection<VirtualPort> getPorts(DeviceId deviceId);
76
77 /**
78 * Creates virtualPorts by virtualPorts.
79 *
80 * @param virtualPorts the iterable collection of virtualPorts
81 * @return true if all given identifiers created successfully.
82 */
83 boolean createPorts(Iterable<VirtualPort> virtualPorts);
84
85 /**
86 * Updates virtualPorts by virtualPorts.
87 *
88 * @param virtualPorts the iterable collection of virtualPorts
Thomas Vachuskad894b5d2015-07-30 11:59:07 -070089 * @return true if all given identifiers updated successfully
xuzhang585f9052015-07-22 11:20:13 +080090 */
91 boolean updatePorts(Iterable<VirtualPort> virtualPorts);
92
93 /**
94 * Deletes virtualPortIds by virtualPortIds.
95 *
96 * @param virtualPortIds the iterable collection of virtualPort identifiers
97 * @return true or false if one with the given identifier to delete is
Thomas Vachuskad894b5d2015-07-30 11:59:07 -070098 * successfully
xuzhang585f9052015-07-22 11:20:13 +080099 */
100 boolean removePorts(Iterable<VirtualPortId> virtualPortIds);
101}