package org.project.neutrino.nfvo.catalogue.nfvo;

import org.project.neutrino.nfvo.catalogue.util.IdGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by lto on 11/05/15.
 */
@Entity
public class NFVImage implements Serializable {
    @Id
    private String id = IdGenerator.createUUID();
    @Version
    private int version = 0;

    private String extId;
    private String name;
    private long minRam;
    private long minDiskSpace;
    private String minCPU;

    private boolean isPublic;
    private String diskFormat;

    @Temporal(TemporalType.DATE)
    private Date created;

    @Temporal(TemporalType.DATE)
    private Date updated;

    public NFVImage() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getExtId() {
        return extId;
    }

    public void setExtId(String extId) {
        this.extId = extId;
    }

    public long getMinRam() {
        return minRam;
    }

    public void setMinRam(long minRam) {
        this.minRam = minRam;
    }

    public long getMinDiskSpace() {
        return minDiskSpace;
    }

    public void setMinDiskSpace(long minDiskSpace) {
        this.minDiskSpace = minDiskSpace;
    }

    public String getMinCPU() {
        return minCPU;
    }

    public void setMinCPU(String minCPU) {
        this.minCPU = minCPU;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getCreated() {
        return created;
    }

    public Date getUpdated() { return updated; }

    public void setUpdated(Date updated) { this.updated = updated; }

    public boolean isPublic() { return isPublic; }

    public void setIsPublic(boolean isPublic) {
        this.isPublic = isPublic;
    }

    public String getDiskFormat() {
        return diskFormat;
    }

    public void setDiskFormat(String diskFormat) {
        this.diskFormat = diskFormat;
    }

    @Override
    public String toString() {
        return "Image{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", version=" + version +
                ", extId='" + extId + '\'' +
                ", minRam='" + minRam + '\'' +
                ", minDiskSpace='" + minDiskSpace + '\'' +
                ", minCPU='" + minCPU + '\'' +
                ", public='" + isPublic + '\'' +
                ", created='" + created + '\'' +
                ", updated='" + updated + '\'' +
                '}';
    }
}

@@ -454,24 +454,32 @@
 long minRam;
+ //in MB
 %0A    private
@@ -493,24 +493,32 @@
 inDiskSpace;
+ //in GB
 %0A    private
@@ -560,24 +560,24 @@
 n isPublic;%0A
-
     private 
@@ -594,16 +594,52 @@
 kFormat;
+%0A    private String containerFormat;
 %0A%0A    @T
@@ -2330,24 +2330,220 @@
 mat;%0A    %7D%0A%0A
+    public String getContainerFormat() %7B%0A        return containerFormat;%0A    %7D%0A%0A    public void setContainerFormat(String containerFormat) %7B%0A        this.containerFormat = containerFormat;%0A    %7D%0A%0A
     @Overrid

add value: containerFormat