package id.iptek.utms.agent.model;

import id.iptek.utms.agent.model.enumeration.DownloadTimeType;
import id.iptek.utms.agent.model.enumeration.InstallationNotificationType;
import id.iptek.utms.agent.model.enumeration.InstallationTimeType;
import id.iptek.utms.agent.model.enumeration.PublishTimeType;
import id.iptek.utms.agent.model.enumeration.TaskStatus;
import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author Jaka
 */
public class DownloadTask implements Serializable {

    private String id;
    private String name;
    private PublishTimeType publishTimeType;
    private Date publishTime;
    private DownloadTimeType downloadTimeType;
    private Date downloadTime;
    private InstallationTimeType installationTimeType;
    private Date installationTime;
    private InstallationNotificationType installationNotification;
    private TaskStatus status;

    public DownloadTask() {
    }

    /**
     * @return the id
     */
    public String getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the publishTimeType
     */
    public PublishTimeType getPublishTimeType() {
        return publishTimeType;
    }

    /**
     * @param publishTimeType the publishTimeType to set
     */
    public void setPublishTimeType(int publishTimeType) {
        this.publishTimeType = PublishTimeType.fromValue(publishTimeType);
    }

    /**
     * @return the publishTime
     */
    public Date getPublishTime() {
        return publishTime;
    }

    /**
     * @param publishTime the publishTime to set
     */
    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    /**
     * @return the downloadTimeType
     */
    public DownloadTimeType getDownloadTimeType() {
        return downloadTimeType;
    }

    /**
     * @param downloadTimeType the downloadTimeType to set
     */
    public void setDownloadTimeType(int downloadTimeType) {
        this.downloadTimeType = DownloadTimeType.fromValue(downloadTimeType);
    }

    /**
     * @return the downloadTime
     */
    public Date getDownloadTime() {
        return downloadTime;
    }

    /**
     * @param downloadTime the downloadTime to set
     */
    public void setDownloadTime(Date downloadTime) {
        this.downloadTime = downloadTime;
    }

    /**
     * @return the installationTimeType
     */
    public InstallationTimeType getInstallationTimeType() {
        return installationTimeType;
    }

    /**
     * @param installationTimeType the installationTimeType to set
     */
    public void setInstallationTimeType(int installationTimeType) {
        this.installationTimeType = InstallationTimeType.fromValue(installationTimeType);
    }

    /**
     * @return the installationTime
     */
    public Date getInstallationTime() {
        return installationTime;
    }

    /**
     * @param installationTime the installationTime to set
     */
    public void setInstallationTime(Date installationTime) {
        this.installationTime = installationTime;
    }

    /**
     * @return the installationNotification
     */
    public InstallationNotificationType getInstallationNotification() {
        return installationNotification;
    }

    /**
     * @param installationNotification the installationNotification to set
     */
    public void setInstallationNotification(int installationNotification) {
        this.installationNotification = InstallationNotificationType.fromValue(installationNotification);
    }

    /**
     * @return the status
     */
    public TaskStatus getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(int status) {
        this.status = TaskStatus.fromValue(status);
    }

    @Override
    public String toString() {
        return "DownloadTask{" + "id=" + id + ", name=" + name + ", publishTimeType=" + publishTimeType + ", publishTime=" + publishTime + ", downloadTimeType=" + downloadTimeType + ", downloadTime=" + downloadTime + ", installationTimeType=" + installationTimeType + ", installationTime=" + installationTime + ", installationNotification=" + installationNotification + ", status=" + status + '}';
    }

}
