Committed by
Gerrit Code Review
Remove default methods from IntentService interface.
Change-Id: Ie0ef999d7237a8e150e770a912c0fcbcd0c56adc
Showing
3 changed files
with
30 additions
and
8 deletions
... | @@ -16,7 +16,6 @@ | ... | @@ -16,7 +16,6 @@ |
16 | package org.onosproject.net.intent; | 16 | package org.onosproject.net.intent; |
17 | 17 | ||
18 | 18 | ||
19 | -import java.util.Collections; | ||
20 | import java.util.List; | 19 | import java.util.List; |
21 | 20 | ||
22 | /** | 21 | /** |
... | @@ -83,19 +82,22 @@ public interface IntentService { | ... | @@ -83,19 +82,22 @@ public interface IntentService { |
83 | */ | 82 | */ |
84 | List<Intent> getInstallableIntents(Key intentKey); | 83 | List<Intent> getInstallableIntents(Key intentKey); |
85 | 84 | ||
86 | - // TODO remove defaults | 85 | + /** |
87 | - default boolean isLocal(Key intentKey) { | 86 | + * Signifies whether the local node is responsible for processing the given |
88 | - return true; | 87 | + * intent key. |
89 | - } | 88 | + * |
89 | + * @param intentKey intent key to check | ||
90 | + * @return true if the local node is responsible for the intent key, | ||
91 | + * otherwise false | ||
92 | + */ | ||
93 | + boolean isLocal(Key intentKey); | ||
90 | 94 | ||
91 | /** | 95 | /** |
92 | * Returns the list of intent requests pending processing. | 96 | * Returns the list of intent requests pending processing. |
93 | * | 97 | * |
94 | * @return intents pending processing | 98 | * @return intents pending processing |
95 | */ | 99 | */ |
96 | - default Iterable<Intent> getPending() { | 100 | + Iterable<Intent> getPending(); |
97 | - return Collections.emptyList(); | ||
98 | - } | ||
99 | 101 | ||
100 | /** | 102 | /** |
101 | * Adds the specified listener for intent events. | 103 | * Adds the specified listener for intent events. | ... | ... |
... | @@ -211,6 +211,16 @@ public class FakeIntentManager implements TestableIntentService { | ... | @@ -211,6 +211,16 @@ public class FakeIntentManager implements TestableIntentService { |
211 | } | 211 | } |
212 | 212 | ||
213 | @Override | 213 | @Override |
214 | + public boolean isLocal(Key intentKey) { | ||
215 | + return true; | ||
216 | + } | ||
217 | + | ||
218 | + @Override | ||
219 | + public Iterable<Intent> getPending() { | ||
220 | + return Collections.emptyList(); | ||
221 | + } | ||
222 | + | ||
223 | + @Override | ||
214 | public void addListener(IntentListener listener) { | 224 | public void addListener(IntentListener listener) { |
215 | listeners.add(listener); | 225 | listeners.add(listener); |
216 | } | 226 | } | ... | ... |
... | @@ -58,6 +58,16 @@ public class IntentServiceAdapter implements IntentService { | ... | @@ -58,6 +58,16 @@ public class IntentServiceAdapter implements IntentService { |
58 | } | 58 | } |
59 | 59 | ||
60 | @Override | 60 | @Override |
61 | + public boolean isLocal(Key intentKey) { | ||
62 | + return false; | ||
63 | + } | ||
64 | + | ||
65 | + @Override | ||
66 | + public Iterable<Intent> getPending() { | ||
67 | + return null; | ||
68 | + } | ||
69 | + | ||
70 | + @Override | ||
61 | public void addListener(IntentListener listener) { | 71 | public void addListener(IntentListener listener) { |
62 | 72 | ||
63 | } | 73 | } | ... | ... |
-
Please register or login to post a comment