Committed by
Gerrit Code Review
[ONOS-3116] Port Chain service
Change-Id: I6f846c5f8c14b74275f003cde88d8112d86d8c29
Showing
2 changed files
with
100 additions
and
0 deletions
| 1 | +/* | ||
| 2 | + * Copyright 2015 Open Networking 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 | + */ | ||
| 16 | +package org.onosproject.vtnrsc.portchain; | ||
| 17 | + | ||
| 18 | +import org.onosproject.vtnrsc.PortChain; | ||
| 19 | +import org.onosproject.vtnrsc.PortChainId; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * Service for interacting with the inventory of port chains. | ||
| 23 | + */ | ||
| 24 | +public interface PortChainService { | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * Returns if the port chain is existed. | ||
| 28 | + * | ||
| 29 | + * @param portChainId port chain identifier | ||
| 30 | + * @return true or false if one with the given identifier exists. | ||
| 31 | + */ | ||
| 32 | + boolean exists(PortChainId portChainId); | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * Returns the number of port chains known to the system. | ||
| 36 | + * | ||
| 37 | + * @return number of port chains. | ||
| 38 | + */ | ||
| 39 | + int getPortChainCount(); | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * Returns an iterable collection of the currently known port chains. | ||
| 43 | + * | ||
| 44 | + * @return collection of port chains. | ||
| 45 | + */ | ||
| 46 | + Iterable<PortChain> getPortChains(); | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * Returns the portChain with the given identifier. | ||
| 50 | + * | ||
| 51 | + * @param portChainId port chain identifier | ||
| 52 | + * @return PortChain or null if port chain with the given identifier is not | ||
| 53 | + * known. | ||
| 54 | + */ | ||
| 55 | + PortChain getPortChain(PortChainId portChainId); | ||
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * Creates a PortChain in the store. | ||
| 59 | + * | ||
| 60 | + * @param portChain the port chain to create | ||
| 61 | + * @return true if given port chain is created successfully. | ||
| 62 | + */ | ||
| 63 | + boolean createPortChain(PortChain portChain); | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * Updates the portChain in the store. | ||
| 67 | + * | ||
| 68 | + * @param portChain the port chain to update | ||
| 69 | + * @return true if given port chain is updated successfully. | ||
| 70 | + */ | ||
| 71 | + boolean updatePortChain(PortChain portChain); | ||
| 72 | + | ||
| 73 | + /** | ||
| 74 | + * Deletes portChain by given portChainId. | ||
| 75 | + * | ||
| 76 | + * @param portChainId id of port chain to remove | ||
| 77 | + * @return true if the give port chain is deleted successfully. | ||
| 78 | + */ | ||
| 79 | + boolean removePortChain(PortChainId portChainId); | ||
| 80 | +} |
| 1 | +/* | ||
| 2 | + * Copyright 2015 Open Networking 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 | + */ | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * Service for interacting with the inventory of port chains. | ||
| 19 | + */ | ||
| 20 | +package org.onosproject.vtnrsc.portchain; |
-
Please register or login to post a comment