blob: a2ed4d954d9adfe40d2ec3d05209858389c6ebe7 [file] [log] [blame]
Sho SHIMIZUbdc17e72015-01-27 17:46:41 -08001/*
2 * Copyright 2015 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 */
16package org.onosproject.net.intent.impl;
17
18import org.onosproject.net.flow.FlowRuleBatchOperation;
19import org.onosproject.net.intent.BatchWrite;
20import org.onosproject.net.intent.Intent;
21
22import java.util.Collections;
23import java.util.List;
24
25/**
26 * Represents a completed phase of processing an intent.
27 */
28interface CompletedIntentUpdate extends IntentUpdate {
29
30 /**
31 * Write data to the specified BatchWrite after execution() is called.
32 *
33 * @param batchWrite batchWrite
34 */
35 default void writeAfterExecution(BatchWrite batchWrite) {}
36
37 /**
38 * Moves forward with the contained current batch.
39 * This method is invoked when the batch is successfully completed.
40 */
41 default void batchSuccess() {}
42
43 /**
44 * Reverts the contained batches.
45 * This method is invoked when the batch results in failure.
46 */
47 default void batchFailed() {}
48
49 /**
50 * Returns the current FlowRuleBatchOperation.
51 *
52 * @return current FlowRuleBatchOperation
53 */
54 default FlowRuleBatchOperation currentBatch() {
55 return null;
56 }
57
58 /**
59 * Returns all of installable intents this instance holds.
60 *
61 * @return all of installable intents
62 */
63 default List<Intent> allInstallables() {
64 return Collections.emptyList();
65 }
66}