commit | 4a141850324b8b979307faf6ed2ec89b032a4efa | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Thu Jan 14 18:55:40 2016 -0800 |
committer | Gerrit Code Review <gerrit@onlab.us> | Fri Jan 22 00:49:53 2016 +0000 |
tree | 92a9bf35825d41159adddc709f189ce0ed18468e | |
parent | a54de5ae1e53b6d5bafce9f19dd33769af82d6e0 [diff] [blame] |
Move method to IntentProcessPhase Change-Id: Id9e898d983f3b041dbb376070ef31e36318b40c3
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/phase/IntentProcessPhase.java b/core/net/src/main/java/org/onosproject/net/intent/impl/phase/IntentProcessPhase.java index bef28ac..d2f9f36 100644 --- a/core/net/src/main/java/org/onosproject/net/intent/impl/phase/IntentProcessPhase.java +++ b/core/net/src/main/java/org/onosproject/net/intent/impl/phase/IntentProcessPhase.java
@@ -58,6 +58,17 @@ } } + static FinalIntentProcessPhase process(IntentProcessPhase initial) { + Optional<IntentProcessPhase> currentPhase = Optional.of(initial); + IntentProcessPhase previousPhase = initial; + + while (currentPhase.isPresent()) { + previousPhase = currentPhase.get(); + currentPhase = previousPhase.execute(); + } + return (FinalIntentProcessPhase) previousPhase; + } + static void transferErrorCount(IntentData data, Optional<IntentData> stored) { stored.ifPresent(storedData -> { if (Objects.equals(data.intent(), storedData.intent()) &&