com.jelastic.api.system.statistic.persistence.CurrentNodeStatistic Maven / Gradle / Ivy
The newest version!
/*Server class MD5: d91bad3ae21f9655132eb4288c8bfba4*/
package com.jelastic.api.system.statistic.persistence;
import com.jelastic.api.development.response.interfaces.ArrayItem;
import com.jelastic.api.core.utils.DateUtils;
import com.jelastic.api.data.po.VType;
import com.jelastic.api.system.persistence.SoftwareNode;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Date;
import java.util.List;
/**
* @author Oleksandr Kotvytskyi
*/
/**
* @name Jelastic API Client
* @version 8.11.2
* @copyright Jelastic, Inc.
*/
public class CurrentNodeStatistic extends ArrayItem {
public static final String NODE_ID = "nodeId";
public static final String REGION_DOMAIN = "regionDomain";
public static final String CTID = "ctid";
public static final String OS_NODE_ID = "osNodeId";
public static final String NODE_NAME = "nodeName";
public static final String HOST_ID = "hostId";
public static final String HOST_NAME = "hostName";
public static final String STATUS = "status";
public static final String UID = "uid";
public static final String ENV_ID = "envId";
public static final String ENV_NAME = "envName";
public static final String NODE_URL = "nodeUrl";
public static final String NODE_TYPE = "nodeType";
public static final String NODE_MISSION = "nodeMission";
public static final String NODE_VERSION = "nodeVersion";
public static final String NODE_GROUP = "nodeGroup";
public static final String NODE_TYPE_ALIAS = "nodeTypeAlias";
public static final String IS_MASTER = "isMaster";
public static final String SSL_STATE = "sslState";
public static final String NODE_CREATION_DATE = "nodeCreationDate";
public static final String REGION_UNIQUE_NAME = "regionUniqueName";
public static final String STATISTICS = "statistics";
public static final String APPID = "appid";
public static final String ENV_ZONE = "zone";
public static final String IS_EXT_IP_PRESENT = "isExtIpPresent";
public static final String TEMPLATE_TYPE = "templateType";
private int id;
private Integer nodeId;
private Integer ctid;
private String nodeName;
private Integer hostId;
private String hostName;
private Integer status;
private Integer uid;
private String envId;
private String envName;
private String nodeUrl;
private String nodeType;
private String nodeMission;
private String nodeVersion;
private String nodeGroup;
private String nodeTypeAlias;
protected boolean isMaster;
private boolean isDeleted;
private boolean sslState;
private Date nodeCreationDate;
private String regionUniqueName;
private String appid;
private VType vType = VType.CT;
private String templateType;
private List statisticInfoList;
private String regionDomain;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Integer getNodeId() {
return nodeId;
}
public void setNodeId(Integer nodeId) {
this.nodeId = nodeId;
}
public Integer getCtid() {
return ctid;
}
public void setCtid(Integer ctid) {
this.ctid = ctid;
}
public String getNodeName() {
return nodeName;
}
public void setNodeName(String nodeName) {
this.nodeName = nodeName;
}
public Integer getHostId() {
return hostId;
}
public void setHostId(Integer hostId) {
this.hostId = hostId;
}
public String getHostName() {
return hostName;
}
public void setHostName(String hostName) {
this.hostName = hostName;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getUid() {
return uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public String getEnvId() {
return envId;
}
public void setEnvId(String envId) {
this.envId = envId;
}
public String getEnvName() {
return envName;
}
public void setEnvName(String envName) {
this.envName = envName;
}
public String getNodeUrl() {
return nodeUrl;
}
public void setNodeUrl(String nodeUrl) {
this.nodeUrl = nodeUrl;
}
public String getNodeType() {
return nodeType;
}
public void setNodeType(String nodeType) {
this.nodeType = nodeType;
}
public String getNodeMission() {
return nodeMission;
}
public void setNodeMission(String nodeMission) {
this.nodeMission = nodeMission;
}
public String getNodeVersion() {
return nodeVersion;
}
public void setNodeVersion(String nodeVersion) {
this.nodeVersion = nodeVersion;
}
public String getNodeGroup() {
return nodeGroup;
}
public void setNodeGroup(String nodeGroup) {
this.nodeGroup = nodeGroup;
}
public String getNodeTypeAlias() {
return nodeTypeAlias;
}
public void setNodeTypeAlias(String nodeTypeAlias) {
this.nodeTypeAlias = nodeTypeAlias;
}
public boolean isMaster() {
return isMaster;
}
public void setMaster(boolean master) {
isMaster = master;
}
public boolean isDeleted() {
return isDeleted;
}
public void setDeleted(boolean deleted) {
isDeleted = deleted;
}
public boolean getSslState() {
return sslState;
}
public void setSslState(boolean sslState) {
this.sslState = sslState;
}
public String getRegionUniqueName() {
return regionUniqueName;
}
public void setRegionUniqueName(String regionUniqueName) {
this.regionUniqueName = regionUniqueName;
}
public Date getNodeCreationDate() {
return nodeCreationDate;
}
public void setNodeCreationDate(Date nodeCreationDate) {
this.nodeCreationDate = nodeCreationDate;
}
public List getStatisticInfoList() {
return statisticInfoList;
}
public void setStatisticInfoList(List statisticInfoList) {
this.statisticInfoList = statisticInfoList;
}
public String getRegionDomain() {
return regionDomain;
}
public void setRegionDomain(String regionDomain) {
this.regionDomain = regionDomain;
}
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public VType getvType() {
return vType;
}
public void setvType(VType vType) {
this.vType = vType;
}
public String getTemplateType() {
return templateType;
}
public void setTemplateType(String templateType) {
this.templateType = templateType;
}
@Override
public JSONObject _toJSON() throws JSONException {
JSONObject json = new JSONObject();
if (nodeId != null) {
json.put(NODE_ID, nodeId);
}
if (ctid != null) {
json.put(CTID, ctid);
}
if (nodeName != null) {
json.put(NODE_NAME, nodeName);
}
if (hostId != null) {
json.put(HOST_ID, hostId);
}
if (hostName != null) {
json.put(HOST_NAME, hostName);
}
if (status != null) {
json.put(STATUS, status);
}
if (uid != null) {
json.put(UID, uid);
}
if (envId != null) {
json.put(ENV_ID, envId);
}
if (envName != null) {
json.put(ENV_NAME, envName);
}
if (nodeUrl != null) {
json.put(NODE_URL, nodeUrl);
}
if (nodeType != null) {
json.put(NODE_TYPE, nodeType);
}
if (nodeMission != null) {
json.put(NODE_MISSION, nodeMission);
}
if (nodeVersion != null) {
json.put(NODE_VERSION, nodeVersion);
}
if (nodeGroup != null) {
json.put(NODE_GROUP, nodeGroup);
}
if (nodeTypeAlias != null) {
json.put(NODE_TYPE_ALIAS, nodeTypeAlias);
}
if (nodeCreationDate != null) {
json.put(NODE_CREATION_DATE, DateUtils.formatSqlDateTime(nodeCreationDate));
}
if (regionUniqueName != null) {
json.put(REGION_UNIQUE_NAME, regionUniqueName);
}
if (appid != null) {
json.put(APPID, appid);
}
if (vType != null) {
json.put(SoftwareNode.VTYPE, vType.toString());
}
json.put(IS_MASTER, isMaster);
json.put(SSL_STATE, sslState);
if (statisticInfoList != null) {
JSONArray statistics = new JSONArray();
for (CurrentNodeStatisticInfo stat : statisticInfoList) {
statistics.put(stat._toJSON());
}
json.put(STATISTICS, statistics);
}
if (templateType != null) {
json.put(TEMPLATE_TYPE, templateType);
}
return json;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy