package org.project.openbaton.catalogue.mano.common;

import org.project.openbaton.catalogue.util.IdGenerator;

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

/**
 * Created by lto on 06/02/15.
 *
 *
 * Based on ETSI GS NFV-MAN 001 V1.1.1 (2014-12)
 */
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class ConnectionPoint implements Serializable{

    /*ID of the Connection Point.*/
	@Id
    protected String id;
	@Version
	protected int version = 0;

    protected String name;

    protected String extId;

    /**
     *
     * This may be for example a virtual port, a virtual NIC address, a physical port, a physical NIC address or the
     * endpoint of an IP VPN enabling network connectivity.
     * TODO think about what type must be
     *
     * */
    protected String type;

    public ConnectionPoint() {
    }

    @PrePersist
    public void ensureId(){
        id=IdGenerator.createUUID();
    }
    public String getType() {

        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

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

    public String getExtId() {
        return extId;
    }

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

    @Override
    public String toString() {
        return "ConnectionPoint{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", version='" + version +
                ", type='" + type + '\'' +
                ", extId='" + extId + '\'' +
                '}';
    }

}

@@ -486,65 +486,8 @@
 0;%0A%0A
-    protected String name;%0A%0A    protected String extId;%0A%0A
     
@@ -1139,274 +1139,8 @@
  %7D%0A%0A
-    public String getName() %7B%0A        return name;%0A    %7D%0A%0A    public void setName(String name) %7B%0A        this.name = name;%0A    %7D%0A%0A    public String getExtId() %7B%0A        return extId;%0A    %7D%0A%0A    public void setExtId(String extId) %7B%0A        this.extId = extId;%0A    %7D%0A%0A
     
@@ -1257,51 +1257,8 @@
 ' +%0A
-                %22, name='%22 + name + '%5C'' +%0A
     
@@ -1342,53 +1342,8 @@
 ' +%0A
-                %22, extId='%22 + extId + '%5C'' +%0A
     

remove name, extID