blob: 2b4fb59cd994f9fea591513eaa659b51a5f9f2ef [file] [log] [blame]
Brian O'Connorb876bf12014-10-02 14:59:37 -07001package org.onlab.onos.net.intent;
2
3import java.util.Set;
4
5/**
6 * Service for application submitting or withdrawing their intents.
7 */
8public interface IntentService {
9 /**
10 * Submits an intent into the system.
11 *
12 * This is an asynchronous request meaning that any compiling
13 * or installation activities may be done at later time.
14 *
15 * @param intent intent to be submitted
16 */
17 void submit(Intent intent);
18
19 /**
20 * Withdraws an intent from the system.
21 *
22 * This is an asynchronous request meaning that the environment
23 * may be affected at later time.
24 *
25 * @param intent intent to be withdrawn
26 */
27 void withdraw(Intent intent);
28
29 /**
30 * Submits a batch of submit & withdraw operations. Such a batch is
31 * assumed to be processed together.
32 *
33 * This is an asynchronous request meaning that the environment
34 * may be affected at later time.
35 *
36 * @param operations batch of intent operations
37 */
38 void execute(IntentOperations operations);
39
40 /**
41 * Returns immutable set of intents currently in the system.
42 *
43 * @return set of intents
44 */
45 Set<Intent> getIntents();
46
47 /**
48 * Retrieves the intent specified by its identifier.
49 *
50 * @param id intent identifier
51 * @return the intent or null if one with the given identifier is not found
52 */
53 Intent getIntent(IntentId id);
54
55 /**
56 * Retrieves the state of an intent by its identifier.
57 *
58 * @param id intent identifier
59 * @return the intent state or null if one with the given identifier is not found
60 */
61 IntentState getIntentState(IntentId id);
62
63 /**
64 * Adds the specified listener for intent events.
65 *
66 * @param listener listener to be added
67 */
68 void addListener(IntentEventListener listener);
69
70 /**
71 * Removes the specified listener for intent events.
72 *
73 * @param listener listener to be removed
74 */
75 void removeListener(IntentEventListener listener);
76}