24ddb9f16e8815e20d18a7bdc60196f099f2a958
[onosfw.git] /
1 /*\r
2  * Copyright 2015 Open Porting Laboratory\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 package org.onosproject.vtnrsc.virtualport;\r
17 \r
18 import java.util.Collection;\r
19 \r
20 import org.onosproject.net.DeviceId;\r
21 import org.onosproject.vtnrsc.TenantId;\r
22 import org.onosproject.vtnrsc.TenantNetworkId;\r
23 import org.onosproject.vtnrsc.VirtualPort;\r
24 import org.onosproject.vtnrsc.VirtualPortId;\r
25 \r
26 /**\r
27  * Service for interacting with the inventory of virtualPort.\r
28  */\r
29 public interface VirtualPortService {\r
30     /**\r
31      * Returns if the virtualPort is existed.\r
32      *\r
33      * @param virtualPortId virtualPort identifier\r
34      * @return true or false if one with the given identifier is not existed.\r
35      */\r
36     boolean exists(VirtualPortId virtualPortId);\r
37 \r
38     /**\r
39      * Returns the virtualPort with the identifier.\r
40      *\r
41      * @param virtualPortId virtualPort ID\r
42      * @return VirtualPort or null if one with the given ID is not know.\r
43      */\r
44     VirtualPort getPort(VirtualPortId virtualPortId);\r
45 \r
46     /**\r
47      * Returns the collection of the currently known virtualPort.\r
48      * @return collection of VirtualPort.\r
49      */\r
50     Collection<VirtualPort> getPorts();\r
51 \r
52     /**\r
53      * Returns the collection of the virtualPorts associated with the networkId.\r
54      *\r
55      * @param networkId  the network identifer\r
56      * @return collection of virtualPort.\r
57      */\r
58     Collection<VirtualPort> getPorts(TenantNetworkId networkId);\r
59 \r
60     /**\r
61      * Returns the collection of the virtualPorts associated with the tenantId.\r
62      *\r
63      * @param tenantId   the tenant identifier\r
64      * @return collection of virtualPorts.\r
65      */\r
66     Collection<VirtualPort> getPorts(TenantId tenantId);\r
67 \r
68     /**\r
69      * Returns the collection of the virtualPorts associated with the deviceId.\r
70      *\r
71      * @param deviceId   the device identifier\r
72      * @return collection of virtualPort.\r
73      */\r
74     Collection<VirtualPort> getPorts(DeviceId deviceId);\r
75 \r
76     /**\r
77      * Creates virtualPorts by virtualPorts.\r
78      *\r
79      * @param virtualPorts the iterable collection of virtualPorts\r
80      * @return true if all given identifiers created successfully.\r
81      */\r
82     boolean createPorts(Iterable<VirtualPort> virtualPorts);\r
83 \r
84     /**\r
85      * Updates virtualPorts by virtualPorts.\r
86      *\r
87      * @param virtualPorts the iterable  collection of virtualPorts\r
88      * @return true if all given identifiers updated successfully.\r
89      */\r
90     boolean updatePorts(Iterable<VirtualPort> virtualPorts);\r
91 \r
92     /**\r
93      * Deletes virtualPortIds by virtualPortIds.\r
94      *\r
95      * @param virtualPortIds the iterable collection of virtualPort identifiers\r
96      * @return true or false if one with the given identifier to delete is\r
97      *         successfully.\r
98      */\r
99     boolean removePorts(Iterable<VirtualPortId> virtualPortIds);\r
100 }\r