blob: ea60d7c67b49bf8052c2103f9ad2925246fcec0c [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska83e090e2014-10-22 14:25:35 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * 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
Thomas Vachuska83e090e2014-10-22 14:25:35 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * 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.
Thomas Vachuska83e090e2014-10-22 14:25:35 -070015 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.intent;
Brian O'Connor66630c82014-10-02 21:08:19 -070017
Sho SHIMIZU64ae11c2014-12-03 15:17:47 -080018import org.onosproject.net.intent.BatchWrite.Operation;
Brian O'Connorabafb502014-12-02 22:26:20 -080019import org.onosproject.store.Store;
Brian O'Connor66630c82014-10-02 21:08:19 -070020
toma1d16b62014-10-02 23:45:11 -070021import java.util.List;
22
Brian O'Connor66630c82014-10-02 21:08:19 -070023/**
24 * Manages inventory of end-station intents; not intended for direct use.
25 */
26public interface IntentStore extends Store<IntentEvent, IntentStoreDelegate> {
27
28 /**
Brian O'Connor66630c82014-10-02 21:08:19 -070029 * Returns the number of intents in the store.
Toshio Koided32809b2014-10-09 10:58:54 -070030 *
31 * @return the number of intents in the store
Brian O'Connor66630c82014-10-02 21:08:19 -070032 */
33 long getIntentCount();
34
35 /**
36 * Returns a collection of all intents in the store.
37 *
38 * @return iterable collection of all intents
39 */
40 Iterable<Intent> getIntents();
41
42 /**
Toshio Koided32809b2014-10-09 10:58:54 -070043 * Returns the intent with the specified identifier.
Brian O'Connor66630c82014-10-02 21:08:19 -070044 *
45 * @param intentId intent identification
46 * @return intent or null if not found
47 */
48 Intent getIntent(IntentId intentId);
49
toma1d16b62014-10-02 23:45:11 -070050 /**
51 * Returns the state of the specified intent.
52 *
53 * @param intentId intent identification
54 * @return current intent state
55 */
56 IntentState getIntentState(IntentId intentId);
Brian O'Connor66630c82014-10-02 21:08:19 -070057
58 /**
toma1d16b62014-10-02 23:45:11 -070059 * Returns the list of the installable events associated with the specified
60 * original intent.
61 *
62 * @param intentId original intent identifier
63 * @return compiled installable intents
64 */
Thomas Vachuskac96058a2014-10-20 23:00:16 -070065 List<Intent> getInstallableIntents(IntentId intentId);
Brian O'Connor66630c82014-10-02 21:08:19 -070066
toma1d16b62014-10-02 23:45:11 -070067 /**
Yuta HIGUCHIa94c6e82014-11-28 18:49:54 -080068 * Execute writes in a batch.
Sho SHIMIZU2bb988b2015-01-20 13:45:35 -080069 * If the specified BatchWrite is empty, write will not be executed.
Yuta HIGUCHIa94c6e82014-11-28 18:49:54 -080070 *
71 * @param batch BatchWrite to execute
72 * @return failed operations
73 */
Sho SHIMIZU4c464fb2014-12-03 15:12:21 -080074 List<Operation> batchWrite(BatchWrite batch);
Yuta HIGUCHIa94c6e82014-11-28 18:49:54 -080075
Brian O'Connor66630c82014-10-02 21:08:19 -070076}