package com.bocloud.ims.entity.resource.azure.slb;

import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;
import com.bocloud.ims.entity.resource.CloudServer;
import com.bocloud.ims.entity.resource.NetworkInterface;

import java.util.List;

@Table("back_end")
public class BackEnd extends GenericEntity {

    @PK(value = PKStrategy.AUTO)
    private Long id; // ID
    @Column("uuid")
    private String uuid;
    @Column("slb_id")
    private Long slbId;
    @Column("vendor_id")
    private Long vendorId;
    @IgnoreAll
    private List<Long> virtualMachineIds;
    @IgnoreAll
    private List<CloudServer> servers;
    @IgnoreAll
    private List<NetworkInterface> networkInterfaces;

    public List<NetworkInterface> getNetworkInterfaces() {
        return networkInterfaces;
    }

    public void setNetworkInterfaces(List<NetworkInterface> networkInterfaces) {
        this.networkInterfaces = networkInterfaces;
    }

    public Long getId() {
        return id;
    }

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

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public Long getSlbId() {
        return slbId;
    }

    public void setSlbId(Long slbId) {
        this.slbId = slbId;
    }

    public Long getVendorId() {
        return vendorId;
    }

    public void setVendorId(Long vendorId) {
        this.vendorId = vendorId;
    }

    public BackEnd() {
        super();
    }

    public List<Long> getVirtualMachineIds() {
        return virtualMachineIds;
    }

    public void setVirtualMachineIds(List<Long> virtualMachineIds) {
        this.virtualMachineIds = virtualMachineIds;
    }

    public List<CloudServer> getServers() {
        return servers;
    }

    public void setServers(List<CloudServer> servers) {
        this.servers = servers;
    }

    public void preSave(Long creatorId, Long menderId, Long vendorId) {
        this.setCreatorId(creatorId);
        this.setMenderId(menderId);
        this.setVendorId(vendorId);
    }

}
