blob: 4494f26f4dec97470d865efc2266f93a6be53f4f [file] [log] [blame]
Brian O'Connorfa81eae2014-10-30 13:20:05 -07001/*
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'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.intent;
Brian O'Connorfa81eae2014-10-30 13:20:05 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.core.ApplicationId;
Brian O'Connor72a034c2014-11-26 18:24:23 -080019
Brian O'Connorfa81eae2014-10-30 13:20:05 -070020import java.util.Set;
21
22/**
23 * Service for tracking and delegating batches of intent operations.
24 */
Brian O'Connorea4d7d12015-01-28 16:37:46 -080025@Deprecated
Brian O'Connorfa81eae2014-10-30 13:20:05 -070026public 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'Connor427a1762014-11-19 18:40:32 -080043 * Returns the set of intent batches that are pending.
Brian O'Connorfa81eae2014-10-30 13:20:05 -070044 * @return set of batches
45 */
Brian O'Connor427a1762014-11-19 18:40:32 -080046 Set<IntentOperations> getPendingOperations();
47
48 /**
Brian O'Connor72a034c2014-11-26 18:24:23 -080049 * Return true if this instance is the local leader for batch
50 * processing a given application id.
51 *
alshabiba9819bf2014-11-30 18:15:52 -080052 * @param applicationId an application id
53 * @return true if this instance is the local leader for batch
Brian O'Connor72a034c2014-11-26 18:24:23 -080054 */
55 boolean isLocalLeader(ApplicationId applicationId);
56
57 /**
Brian O'Connorfa81eae2014-10-30 13:20:05 -070058 * 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'Connor86f6f7f2014-12-01 17:02:45 -080071 /**
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'Connorfa81eae2014-10-30 13:20:05 -070084}