
com.abiquo.tarantino.model.transport.DatacenterTasks Maven / Gradle / Ivy
/**
* Copyright (C) 2008 - Abiquo Holdings S.L. All rights reserved.
*
* Please see /opt/abiquo/tomcat/webapps/legal/ on Abiquo server
* or contact [email protected] for licensing information.
*/
package com.abiquo.tarantino.model.transport;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
/**
* Dependent or independent BaseJob collection
*/
@JsonTypeInfo(use = Id.CLASS, include = As.PROPERTY, property = "@class")
public class DatacenterTasks extends BaseJob implements Serializable
{
private static final long serialVersionUID = -5323122742406815007L;
private List jobs;
protected String hypervisorType;
public DatacenterTasks()
{
}
public String getHypervisorType()
{
return hypervisorType;
}
public void setHypervisorType(String hypervisorType)
{
this.hypervisorType = hypervisorType;
}
public List getJobs()
{
if (jobs == null)
{
jobs = new ArrayList();
}
return jobs;
}
/**
* Adds a job and assigns a random id
*
* @param job the job to add
*/
public void addDatacenterJob(final DatacenterJob job)
{
addDatacenterJob(job, getId().concat(".").concat(UUID.randomUUID().toString()));
}
/**
* Adds a job and assigns the given id
*
* @param job the job to add
* @param id the id to assign
*/
public void addDatacenterJob(final DatacenterJob job, final String id)
{
job.setId(id);
getJobs().add(job);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy