Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 1 | /* |
Jonathan Hart | 470ed4f | 2017-01-31 16:52:28 -0800 | [diff] [blame] | 2 | * Copyright 2017-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 | |
Jonathan Hart | 470ed4f | 2017-01-31 16:52:28 -0800 | [diff] [blame] | 17 | package org.onosproject.intentsync; |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 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. |
Jonathan Hart | 470ed4f | 2017-01-31 16:52:28 -0800 | [diff] [blame] | 26 | * <p> |
| 27 | * This is a sample utility and not part of the core ONOS API. This means it is |
| 28 | * subject to change or to be removed. It is recommended to consider using one |
| 29 | * of the built-in ONOS distributed primitives such as the |
| 30 | * {@link org.onosproject.store.service.WorkQueue} instead of using this. |
| 31 | * </p> |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 32 | */ |
| 33 | public interface IntentSynchronizationService { |
| 34 | |
| 35 | /** |
| 36 | * Submits and intent to the synchronizer. |
| 37 | * <p> |
| 38 | * The intent will be submitted directly to the IntentService if this node |
| 39 | * is the leader, otherwise it will be stored in the synchronizer for |
| 40 | * synchronization if this node becomes the leader. |
| 41 | * </p> |
| 42 | * |
| 43 | * @param intent intent to submit |
| 44 | */ |
| 45 | void submit(Intent intent); |
| 46 | |
| 47 | /** |
| 48 | * Withdraws an intent from the synchronizer. |
| 49 | * <p> |
| 50 | * The intent will be withdrawn directly from the IntentService if this node |
| 51 | * is the leader. The intent will be removed from the synchronizer's |
| 52 | * in-memory storage. |
| 53 | * </p> |
| 54 | * |
| 55 | * @param intent intent to withdraw |
| 56 | */ |
| 57 | void withdraw(Intent intent); |
Luca Prete | 2705d66 | 2016-04-29 15:30:23 -0700 | [diff] [blame] | 58 | |
| 59 | /** |
| 60 | * Withdraws intents by app Id. |
| 61 | * |
| 62 | * @param applicationId the Id of the application that created the intents |
| 63 | * to be removed |
| 64 | */ |
| 65 | void removeIntentsByAppId(ApplicationId applicationId); |
Jonathan Hart | 9a426f8 | 2015-09-03 15:43:13 +0200 | [diff] [blame] | 66 | } |