All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pro.chenggang.plugin.springcloud.gateway.offline.ServerOfflineStatus Maven / Gradle / Ivy

There is a newer version: 2.1.SR2.2.RELEASE
Show newest version
package pro.chenggang.plugin.springcloud.gateway.offline;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * ServerOfflineStatus
 * @author chenggang
 * @date 2019/04/25
 */
@Getter
@Setter
@ToString
public class ServerOfflineStatus {

    private String name;
    private String ip;
    private Integer port;
    private Long offlineTime;

    /**
     * check the server is temporary offline whether or not
     * @param serverUpTime
     * @return
     */
    public boolean isOffline(long serverUpTime){
        if(this.offlineTime == null){
            return false;
        }
        return offlineTime > serverUpTime;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy