blob: f9cf7f9bf5817f2fad6f1e1517b5a463bd38bc16 [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
19import org.onosproject.net.intent.Intent;
20
21/**
22 * Submits and withdraws intents to the IntentService from a single point in
23 * the cluster at any one time. The provided intents will be synchronized with
24 * the IntentService on leadership change.
25 */
26public interface IntentSynchronizationService {
27
28 /**
29 * Submits and intent to the synchronizer.
30 * <p>
31 * The intent will be submitted directly to the IntentService if this node
32 * is the leader, otherwise it will be stored in the synchronizer for
33 * synchronization if this node becomes the leader.
34 * </p>
35 *
36 * @param intent intent to submit
37 */
38 void submit(Intent intent);
39
40 /**
41 * Withdraws an intent from the synchronizer.
42 * <p>
43 * The intent will be withdrawn directly from the IntentService if this node
44 * is the leader. The intent will be removed from the synchronizer's
45 * in-memory storage.
46 * </p>
47 *
48 * @param intent intent to withdraw
49 */
50 void withdraw(Intent intent);
51}