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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.intent; |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 18 | import org.onosproject.core.ApplicationId; |
Brian O'Connor | 72a034c | 2014-11-26 18:24:23 -0800 | [diff] [blame] | 19 | |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 20 | import java.util.Set; |
| 21 | |
| 22 | /** |
| 23 | * Service for tracking and delegating batches of intent operations. |
| 24 | */ |
Brian O'Connor | ea4d7d1 | 2015-01-28 16:37:46 -0800 | [diff] [blame] | 25 | @Deprecated |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 26 | public interface IntentBatchService { |
| 27 | |
| 28 | /** |
| 29 | * Submits a batch of intent operations. |
| 30 | * |
| 31 | * @param operations batch of operations |
| 32 | */ |
| 33 | void addIntentOperations(IntentOperations operations); |
| 34 | |
| 35 | /** |
| 36 | * Removes the specified batch of intent operations after completion. |
| 37 | * |
| 38 | * @param operations batch of operations |
| 39 | */ |
| 40 | void removeIntentOperations(IntentOperations operations); |
| 41 | |
| 42 | /** |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame] | 43 | * Returns the set of intent batches that are pending. |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 44 | * @return set of batches |
| 45 | */ |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame] | 46 | Set<IntentOperations> getPendingOperations(); |
| 47 | |
| 48 | /** |
Brian O'Connor | 72a034c | 2014-11-26 18:24:23 -0800 | [diff] [blame] | 49 | * Return true if this instance is the local leader for batch |
| 50 | * processing a given application id. |
| 51 | * |
alshabib | a9819bf | 2014-11-30 18:15:52 -0800 | [diff] [blame] | 52 | * @param applicationId an application id |
| 53 | * @return true if this instance is the local leader for batch |
Brian O'Connor | 72a034c | 2014-11-26 18:24:23 -0800 | [diff] [blame] | 54 | */ |
| 55 | boolean isLocalLeader(ApplicationId applicationId); |
| 56 | |
| 57 | /** |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 58 | * Sets the batch service delegate. |
| 59 | * |
| 60 | * @param delegate delegate to apply |
| 61 | */ |
| 62 | void setDelegate(IntentBatchDelegate delegate); |
| 63 | |
| 64 | /** |
| 65 | * Unsets the batch service delegate. |
| 66 | * |
| 67 | * @param delegate delegate to unset |
| 68 | */ |
| 69 | void unsetDelegate(IntentBatchDelegate delegate); |
| 70 | |
Brian O'Connor | 86f6f7f | 2014-12-01 17:02:45 -0800 | [diff] [blame] | 71 | /** |
| 72 | * Adds the specified listener for intent batch leadership events. |
| 73 | * |
| 74 | * @param listener listener to be added |
| 75 | */ |
| 76 | void addListener(IntentBatchListener listener); |
| 77 | |
| 78 | /** |
| 79 | * Removes the specified listener for intent batch leadership events. |
| 80 | * |
| 81 | * @param listener listener to be removed |
| 82 | */ |
| 83 | void removeListener(IntentBatchListener listener); |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 84 | } |