RandomSec/src/main/java/com/metaweb/gridworks/model/AbstractOperation.java

35 lines
1.1 KiB
Java
Raw Normal View History

package com.metaweb.gridworks.model;
import java.io.Serializable;
import java.util.Properties;
import org.apache.commons.lang.NotImplementedException;
import com.metaweb.gridworks.Jsonizable;
import com.metaweb.gridworks.history.HistoryEntry;
import com.metaweb.gridworks.process.Process;
import com.metaweb.gridworks.process.QuickHistoryEntryProcess;
/*
* An abstract operation can be applied to different but similar
* projects.
*/
abstract public class AbstractOperation implements Serializable, Jsonizable {
public Process createProcess(Project project, Properties options) throws Exception {
return new QuickHistoryEntryProcess(project, getBriefDescription()) {
@Override
protected HistoryEntry createHistoryEntry() throws Exception {
return AbstractOperation.this.createHistoryEntry(_project);
}
};
}
protected HistoryEntry createHistoryEntry(Project project) throws Exception {
throw new NotImplementedException();
}
protected String getBriefDescription() {
throw new NotImplementedException();
}
}