1 package org.onap.vid.job;
3 import org.onap.vid.job.impl.JobSharedData;
9 * A callable instance, with serializable characteristics.
10 * Represents a step in a chain of steps, which eventualy
11 * resides into a packing Job.
13 public interface JobCommand {
16 * Initialize the command state
17 * @param sharedData shared data cross all job commands
18 * @param commandData An input to be set into the command. Each implementation may expect different keys in the map.
19 * @return Returns itself
21 default JobCommand init(JobSharedData sharedData, Map<String, Object> commandData) {
26 * @return Returns the inner state of the command. This state, once passed into init(), should
27 * bring the command back to it's state.
29 Map<String, Object> getData();
32 * Execute the command represented by this instance. Assumes the instance is already init().
33 * @return A NextCommand containing the next command in chain of commands, or null if chain
34 * should be terminated. Might return itself (packed in a NextCommand).
38 default JobType getType() {
39 return JobType.jobTypeOf(this.getClass());