1 package org.onap.vid.job;
8 * A callable instance, with serializable characteristics.
9 * Represents a step in a chain of steps, which eventualy
10 * resides into a packing Job.
12 public interface JobCommand {
15 * Initialize the command state
16 * @param jobUuid Parent job's uuid
17 * @param data An input to be set into the command. Each implementation may expect different keys in the map.
18 * @return Returns itself
20 default JobCommand init(UUID jobUuid, Map<String, Object> data) {
25 * @return Returns the inner state of the command. This state, once passed into init(), should
26 * bring the command back to it's state.
28 Map<String, Object> getData();
31 * Execute the command represented by this instance. Assumes the instance is already init().
32 * @return A NextCommand containing the next command in chain of commands, or null if chain
33 * should be terminated. Might return itself (packed in a NextCommand).
37 default JobType getType() {
38 return JobType.jobTypeOf(this.getClass());