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;

@Table("probe")
public class Probe extends GenericEntity {

    @PK(value = PKStrategy.AUTO)
    private Long id; // ID
    @Column("uuid")
    private String uuid;
    @Column("slb_id")
    private Long slbId;
    @Column("protocol")
    private String protocol;// 协议
    @Column("port")
    private Integer port;// 端口
    @Column("interval_in_seconds")
    private Integer intervalInSeconds;// 间隔
    @Column("number_of_probes")
    private Integer numberOfProbes;// 不正常阈值
    @Column("request_path")
    private String requestPath;// 路径
    @Column("vendor_id")
    private Long vendorId;

    @IgnoreAll
    private String slbUuid;

    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 String getSlbUuid() {
        return slbUuid;
    }

    public void setSlbUuid(String slbUuid) {
        this.slbUuid = slbUuid;
    }

    public Long getSlbId() {
        return slbId;
    }

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

    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public Integer getIntervalInSeconds() {
        return intervalInSeconds;
    }

    public void setIntervalInSeconds(Integer intervalInSeconds) {
        this.intervalInSeconds = intervalInSeconds;
    }

    public Integer getNumberOfProbes() {
        return numberOfProbes;
    }

    public void setNumberOfProbes(Integer numberOfProbes) {
        this.numberOfProbes = numberOfProbes;
    }

    public String getRequestPath() {
        return requestPath;
    }

    public void setRequestPath(String requestPath) {
        this.requestPath = requestPath;
    }

    public Long getVendorId() {
        return vendorId;
    }

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

    public Probe() {
        super();
    }

    public Probe(Long creatorId, Long ownerId, Long menderId) {
        super(creatorId, ownerId, menderId);
    }

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

}
