Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 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.onlab.onos.net.intent; |
| 17 | |
| 18 | import java.util.Set; |
| 19 | |
| 20 | /** |
| 21 | * Service for tracking and delegating batches of intent operations. |
| 22 | */ |
| 23 | public interface IntentBatchService { |
| 24 | |
| 25 | /** |
| 26 | * Submits a batch of intent operations. |
| 27 | * |
| 28 | * @param operations batch of operations |
| 29 | */ |
| 30 | void addIntentOperations(IntentOperations operations); |
| 31 | |
| 32 | /** |
| 33 | * Removes the specified batch of intent operations after completion. |
| 34 | * |
| 35 | * @param operations batch of operations |
| 36 | */ |
| 37 | void removeIntentOperations(IntentOperations operations); |
| 38 | |
| 39 | /** |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame] | 40 | * Returns the set of intent batches that are pending. |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 41 | * @return set of batches |
| 42 | */ |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame] | 43 | Set<IntentOperations> getPendingOperations(); |
| 44 | |
| 45 | /** |
| 46 | * Returns the set of intent batches currently being processed. |
| 47 | * @return set of batches |
| 48 | */ |
| 49 | Set<IntentOperations> getCurrentOperations(); |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * Sets the batch service delegate. |
| 53 | * |
| 54 | * @param delegate delegate to apply |
| 55 | */ |
| 56 | void setDelegate(IntentBatchDelegate delegate); |
| 57 | |
| 58 | /** |
| 59 | * Unsets the batch service delegate. |
| 60 | * |
| 61 | * @param delegate delegate to unset |
| 62 | */ |
| 63 | void unsetDelegate(IntentBatchDelegate delegate); |
| 64 | |
| 65 | } |