Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [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 | */ |
| 16 | |
| 17 | package org.onosproject.routing; |
| 18 | |
Luca Prete | 2705d66 | 2016-04-29 15:30:23 -0700 | [diff] [blame] | 19 | import org.onosproject.core.ApplicationId; |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 20 | import org.onosproject.net.intent.Intent; |
| 21 | |
| 22 | /** |
| 23 | * Submits and withdraws intents to the IntentService from a single point in |
| 24 | * the cluster at any one time. The provided intents will be synchronized with |
| 25 | * the IntentService on leadership change. |
| 26 | */ |
| 27 | public interface IntentSynchronizationService { |
| 28 | |
| 29 | /** |
| 30 | * Submits and intent to the synchronizer. |
| 31 | * <p> |
| 32 | * The intent will be submitted directly to the IntentService if this node |
| 33 | * is the leader, otherwise it will be stored in the synchronizer for |
| 34 | * synchronization if this node becomes the leader. |
| 35 | * </p> |
| 36 | * |
| 37 | * @param intent intent to submit |
| 38 | */ |
| 39 | void submit(Intent intent); |
| 40 | |
| 41 | /** |
| 42 | * Withdraws an intent from the synchronizer. |
| 43 | * <p> |
| 44 | * The intent will be withdrawn directly from the IntentService if this node |
| 45 | * is the leader. The intent will be removed from the synchronizer's |
| 46 | * in-memory storage. |
| 47 | * </p> |
| 48 | * |
| 49 | * @param intent intent to withdraw |
| 50 | */ |
| 51 | void withdraw(Intent intent); |
Luca Prete | 2705d66 | 2016-04-29 15:30:23 -0700 | [diff] [blame] | 52 | |
| 53 | /** |
| 54 | * Withdraws intents by app Id. |
| 55 | * |
| 56 | * @param applicationId the Id of the application that created the intents |
| 57 | * to be removed |
| 58 | */ |
| 59 | void removeIntentsByAppId(ApplicationId applicationId); |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 60 | } |