blob: 71b15605ae2bd5faec12b3c20c4a78bc6205f086 [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.
xuzhang585f9052015-07-22 11:20:13 +080048 */
49 Collection<VirtualPort> getPorts();
50
51 /**
52 * Returns the collection of the virtualPorts associated with the networkId.
53 *
xuzhangfda00932015-08-11 11:33:45 +080054 * @param networkId the network identifer
55 * @return collection of virtualPort.
xuzhang585f9052015-07-22 11:20:13 +080056 */
57 Collection<VirtualPort> getPorts(TenantNetworkId networkId);
58
59 /**
60 * Returns the collection of the virtualPorts associated with the tenantId.
61 *
xuzhangfda00932015-08-11 11:33:45 +080062 * @param tenantId the tenant identifier
63 * @return collection of virtualPorts.
xuzhang585f9052015-07-22 11:20:13 +080064 */
65 Collection<VirtualPort> getPorts(TenantId tenantId);
66
67 /**
68 * Returns the collection of the virtualPorts associated with the deviceId.
69 *
xuzhangfda00932015-08-11 11:33:45 +080070 * @param deviceId the device identifier
71 * @return collection of virtualPort.
xuzhang585f9052015-07-22 11:20:13 +080072 */
73 Collection<VirtualPort> getPorts(DeviceId deviceId);
74
75 /**
76 * Creates virtualPorts by virtualPorts.
77 *
78 * @param virtualPorts the iterable collection of virtualPorts
79 * @return true if all given identifiers created successfully.
80 */
81 boolean createPorts(Iterable<VirtualPort> virtualPorts);
82
83 /**
84 * Updates virtualPorts by virtualPorts.
85 *
86 * @param virtualPorts the iterable collection of virtualPorts
xuzhangfda00932015-08-11 11:33:45 +080087 * @return true if all given identifiers updated successfully.
xuzhang585f9052015-07-22 11:20:13 +080088 */
89 boolean updatePorts(Iterable<VirtualPort> virtualPorts);
90
91 /**
92 * Deletes virtualPortIds by virtualPortIds.
93 *
94 * @param virtualPortIds the iterable collection of virtualPort identifiers
95 * @return true or false if one with the given identifier to delete is
xuzhangfda00932015-08-11 11:33:45 +080096 * successfully.
xuzhang585f9052015-07-22 11:20:13 +080097 */
98 boolean removePorts(Iterable<VirtualPortId> virtualPortIds);
99}