Added toString() method
This commit is contained in:
parent
da27da1de7
commit
8b5c94a652
|
@ -6,47 +6,59 @@ package org.gcube.vremanagement.executor.plugin;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.vremanagement.executor.json.SEMapper;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
class PluginDeclarationImpl implements PluginDeclaration {
|
||||
|
||||
|
||||
protected String name;
|
||||
protected String description;
|
||||
protected String version;
|
||||
protected Map<String, String> supportedCapabilities;
|
||||
protected Map<String,String> supportedCapabilities;
|
||||
|
||||
protected PluginDeclarationImpl(){
|
||||
supportedCapabilities = new HashMap<String, String>();
|
||||
protected PluginDeclarationImpl() {
|
||||
supportedCapabilities = new HashMap<String,String>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, String> getSupportedCapabilities() {
|
||||
public Map<String,String> getSupportedCapabilities() {
|
||||
return supportedCapabilities;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Class<? extends Plugin<? extends PluginDeclaration>> getPluginImplementation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
try {
|
||||
return SEMapper.getInstance().marshal(this);
|
||||
} catch(Exception e) {
|
||||
return "PluginDeclarationImpl [name=" + name + ", description=" + description + ", version=" + version
|
||||
+ ", supportedCapabilities=" + supportedCapabilities + "]";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,21 +14,22 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
|||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property=SEMapper.CLASS_PROPERTY)
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = SEMapper.CLASS_PROPERTY)
|
||||
public class ScheduledTask {
|
||||
|
||||
public static final String LAUNCH_PARAMETER = "launchParameter";
|
||||
|
||||
protected UUID uuid;
|
||||
|
||||
@JsonProperty(value=LAUNCH_PARAMETER)
|
||||
@JsonProperty(value = LAUNCH_PARAMETER)
|
||||
protected LaunchParameter launchParameter;
|
||||
|
||||
protected RunOn runOn;
|
||||
|
||||
public ScheduledTask(){}
|
||||
|
||||
public ScheduledTask(UUID uuid, RunOn runOn, LaunchParameter launchParameter){
|
||||
public ScheduledTask() {
|
||||
}
|
||||
|
||||
public ScheduledTask(UUID uuid, RunOn runOn, LaunchParameter launchParameter) {
|
||||
this.uuid = uuid;
|
||||
this.runOn = runOn;
|
||||
this.launchParameter = launchParameter;
|
||||
|
@ -40,7 +41,7 @@ public class ScheduledTask {
|
|||
public UUID getUUID() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the runOn
|
||||
*/
|
||||
|
@ -51,8 +52,17 @@ public class ScheduledTask {
|
|||
/**
|
||||
* @return the launchParameter
|
||||
*/
|
||||
public LaunchParameter getLaunchParameter(){
|
||||
public LaunchParameter getLaunchParameter() {
|
||||
return launchParameter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
try {
|
||||
return SEMapper.getInstance().marshal(this);
|
||||
} catch(Exception e) {
|
||||
return "ScheduledTask [uuid=" + uuid + ", launchParameter=" + launchParameter + ", runOn=" + runOn + "]";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue