Marc De Leenheer | 1afa2a0 | 2015-05-13 09:18:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Marc De Leenheer | 1afa2a0 | 2015-05-13 09:18:07 -0700 | [diff] [blame] | 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 | */ |
Sho SHIMIZU | 739873b | 2016-02-23 17:02:12 -0800 | [diff] [blame] | 16 | package org.onosproject.net.intent; |
Marc De Leenheer | 1afa2a0 | 2015-05-13 09:18:07 -0700 | [diff] [blame] | 17 | |
Sho SHIMIZU | cfe707a | 2015-10-12 17:45:42 -0700 | [diff] [blame] | 18 | import com.google.common.annotations.Beta; |
Marc De Leenheer | 1afa2a0 | 2015-05-13 09:18:07 -0700 | [diff] [blame] | 19 | |
| 20 | import java.util.Set; |
| 21 | |
Sho SHIMIZU | cfe707a | 2015-10-12 17:45:42 -0700 | [diff] [blame] | 22 | @Beta |
Sho SHIMIZU | 7d20af1 | 2015-10-01 16:03:51 -0700 | [diff] [blame] | 23 | public interface IntentSetMultimap { |
Marc De Leenheer | 8c2caac | 2015-05-28 16:37:33 -0700 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Allocates the mapping between the given intents. |
| 27 | * |
| 28 | * @param keyIntentId key intent ID |
| 29 | * @param valIntentId value intent ID |
| 30 | * @return true if mapping was successful, false otherwise |
| 31 | */ |
| 32 | boolean allocateMapping(IntentId keyIntentId, IntentId valIntentId); |
| 33 | |
| 34 | /** |
| 35 | * Returns the set of intents mapped to a lower intent. |
| 36 | * |
| 37 | * @param intentId intent ID |
| 38 | * @return set of intent IDs |
| 39 | */ |
| 40 | Set<IntentId> getMapping(IntentId intentId); |
| 41 | |
| 42 | /** |
Marc De Leenheer | 9f7d189 | 2015-05-30 13:22:24 -0700 | [diff] [blame] | 43 | * Releases the mapping of the given intent. |
Marc De Leenheer | 8c2caac | 2015-05-28 16:37:33 -0700 | [diff] [blame] | 44 | * |
Marc De Leenheer | 9f7d189 | 2015-05-30 13:22:24 -0700 | [diff] [blame] | 45 | * @param intentId intent ID |
Marc De Leenheer | 8c2caac | 2015-05-28 16:37:33 -0700 | [diff] [blame] | 46 | */ |
Marc De Leenheer | 9f7d189 | 2015-05-30 13:22:24 -0700 | [diff] [blame] | 47 | void releaseMapping(IntentId intentId); |
Marc De Leenheer | 1afa2a0 | 2015-05-13 09:18:07 -0700 | [diff] [blame] | 48 | } |