smart-executor/src/main/java/org/gcube/vremanagement/executor/scheduler/JobCompletedNotification.java

44 lines
1.2 KiB
Java

/**
*
*/
package org.gcube.vremanagement.executor.scheduler;
import java.util.HashMap;
import java.util.Map;
import org.gcube.vremanagement.executor.plugin.PluginState;
import org.gcube.vremanagement.executor.plugin.PluginStateEvolution;
import org.gcube.vremanagement.executor.plugin.PluginStateNotification;
/**
* This class is useless is just used to simulate and indicate the code
* insertion point the possibility to add multiple notification of an event
* in the running plugin evolution.
* Future use of this are:
* - send an email to the job owner;
* - notify a registered process;
* - send a tweet;
* - etc
* @author Luca Frosini (ISTI - CNR)
*/
@Deprecated
public class JobCompletedNotification extends PluginStateNotification {
/**
* Maintain the Execution State
* Iteration - State
*/
protected final Map<Integer, PluginState> executionsState;
public JobCompletedNotification(Map<Integer, PluginState> executionsState){
super(new HashMap<String, String>());
this.executionsState = executionsState;
}
@Override
public void pluginStateEvolution(PluginStateEvolution pluginStateEvolution, Exception e) throws Exception {
executionsState.put(pluginStateEvolution.getIteration(), pluginStateEvolution.getPluginState());
}
}