blob: 8f97264fbde0de3d51d296c85c86724b2afa752e [file] [log] [blame]
Jonathan Hart9a426f82015-09-03 15:43:13 +02001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Jonathan Hart9a426f82015-09-03 15:43:13 +02003 *
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
17package org.onosproject.routing;
18
Luca Prete2705d662016-04-29 15:30:23 -070019import org.onosproject.core.ApplicationId;
Jonathan Hart9a426f82015-09-03 15:43:13 +020020import 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 */
27public 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 Prete2705d662016-04-29 15:30:23 -070052
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 Hart9a426f82015-09-03 15:43:13 +020060}