summaryrefslogtreecommitdiffstats
path: root/appc-lifecycle-management/state-machine-lib
diff options
context:
space:
mode:
Diffstat (limited to 'appc-lifecycle-management/state-machine-lib')
-rw-r--r--appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/StateMachine.java11
-rw-r--r--appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/impl/StateMachineImpl.java4
2 files changed, 13 insertions, 2 deletions
diff --git a/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/StateMachine.java b/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/StateMachine.java
index bf08680f1..de22e21a6 100644
--- a/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/StateMachine.java
+++ b/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/StateMachine.java
@@ -29,6 +29,17 @@ import org.openecomp.appc.statemachine.objects.Event;
import org.openecomp.appc.statemachine.objects.State;
import org.openecomp.appc.statemachine.objects.StateMachineResponse;
+/**
+ * Interface of the StateMachine
+ */
public interface StateMachine {
+ /**
+ * Handle event
+ * @param currentState the current State which the event should be handled from
+ * @param event the Event that needs to be handled
+ * @return StateMachineResponse
+ * @throws InvalidInputException
+ * when the passed in currentState and event are not predefined or no relevant transition
+ */
StateMachineResponse handleEvent(State currentState, Event event) throws InvalidInputException;
}
diff --git a/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/impl/StateMachineImpl.java b/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/impl/StateMachineImpl.java
index f0cb4919b..4e21c13f4 100644
--- a/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/impl/StateMachineImpl.java
+++ b/appc-lifecycle-management/state-machine-lib/src/main/java/org/openecomp/appc/statemachine/impl/StateMachineImpl.java
@@ -40,8 +40,8 @@ import org.openecomp.appc.statemachine.objects.Transition;
* Implementation of StateMachine
*/
public class StateMachineImpl implements StateMachine {
- private final String invalidInputFormat = "VNF State or incoming event is invalid. State = %s event = %s";
- final String toStringFormat = "StateMachineImpl{states=%s, events=%s}";
+ private static final String invalidInputFormat = "VNF State or incoming event is invalid. State = %s event = %s";
+ static final String toStringFormat = "StateMachineImpl{states=%s, events=%s}";
private final Set<State> states;
private final Set<Event> events;