org.jumpmind.symmetric.model.NodeHost Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of symmetric-ds Show documentation
Show all versions of symmetric-ds Show documentation
SymmetricDS is an open source database synchronization solution. It is platform-independent,
web-enabled, and database-agnostic. SymmetricDS was first built to replicate changes between 'retail store'
databases and ad centralized 'corporate' database.
The newest version!
/*
* Licensed to JumpMind Inc under one or more contributor
* license agreements. See the NOTICE file distributed
* with this work for additional information regarding
* copyright ownership. JumpMind Inc licenses this file
* to you under the GNU Lesser General Public License (the
* "License"); you may not use this file except in compliance
* with the License.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see
* .
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jumpmind.symmetric.model;
import java.util.Date;
import org.jumpmind.symmetric.Version;
import org.jumpmind.symmetric.util.AppUtils;
/**
*
*/
public class NodeHost {
private String nodeId;
private String hostName;
private String ipAddress;
private String osUser;
private String osName;
private String osArch;
private String osVersion;
private int availableProcessors;
private long freeMemoryBytes;
private long totalMemoryBytes;
private long maxMemoryBytes;
private String javaVersion;
private String javaVendor;
private String symmetricVersion;
private String timezoneOffset;
private Date heartbeatTime;
private Date lastRestartTime;
private Date createTime;
public NodeHost() {
}
public NodeHost(String nodeId) {
this.nodeId = nodeId;
this.refresh();
this.lastRestartTime = new Date();
this.createTime = new Date();
}
public void refresh() {
this.hostName = AppUtils.getHostName();
this.ipAddress = AppUtils.getIpAddress();
this.osUser = System.getProperty("user.name");
this.osName = System.getProperty("os.name");
this.osArch = System.getProperty("os.arch");
this.osVersion = System.getProperty("os.version");
this.availableProcessors = Runtime.getRuntime().availableProcessors();
this.freeMemoryBytes = Runtime.getRuntime().freeMemory();
this.totalMemoryBytes = Runtime.getRuntime().totalMemory();
this.maxMemoryBytes = Runtime.getRuntime().maxMemory();
this.javaVersion = System.getProperty("java.version");
this.javaVendor = System.getProperty("java.vendor");
this.symmetricVersion = Version.version();
this.timezoneOffset = AppUtils.getTimezoneOffset();
this.heartbeatTime = new Date();
}
public String getNodeId() {
return nodeId;
}
public void setNodeId(String nodeId) {
this.nodeId = nodeId;
}
public String getHostName() {
return hostName;
}
public void setHostName(String hostName) {
this.hostName = hostName;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public String getOsUser() {
return osUser;
}
public void setOsUser(String osUser) {
this.osUser = osUser;
}
public String getOsName() {
return osName;
}
public void setOsName(String osName) {
this.osName = osName;
}
public String getOsArch() {
return osArch;
}
public void setOsArch(String osArch) {
this.osArch = osArch;
}
public String getOsVersion() {
return osVersion;
}
public void setOsVersion(String osVersion) {
this.osVersion = osVersion;
}
public int getAvailableProcessors() {
return availableProcessors;
}
public void setAvailableProcessors(int availableProcessors) {
this.availableProcessors = availableProcessors;
}
public long getFreeMemoryBytes() {
return freeMemoryBytes;
}
public void setFreeMemoryBytes(long freeMemoryBytes) {
this.freeMemoryBytes = freeMemoryBytes;
}
public long getTotalMemoryBytes() {
return totalMemoryBytes;
}
public void setTotalMemoryBytes(long totalMemoryBytes) {
this.totalMemoryBytes = totalMemoryBytes;
}
public long getMaxMemoryBytes() {
return maxMemoryBytes;
}
public void setMaxMemoryBytes(long maxMemoryBytes) {
this.maxMemoryBytes = maxMemoryBytes;
}
public String getJavaVersion() {
return javaVersion;
}
public void setJavaVersion(String javaVersion) {
this.javaVersion = javaVersion;
}
public String getJavaVendor() {
return javaVendor;
}
public void setJavaVendor(String javaVendor) {
this.javaVendor = javaVendor;
}
public String getSymmetricVersion() {
return symmetricVersion;
}
public void setSymmetricVersion(String symmetricVersion) {
this.symmetricVersion = symmetricVersion;
}
public String getTimezoneOffset() {
return timezoneOffset;
}
public void setTimezoneOffset(String timezoneOffset) {
this.timezoneOffset = timezoneOffset;
}
public Date getHeartbeatTime() {
return heartbeatTime;
}
public void setHeartbeatTime(Date heartbeatTime) {
this.heartbeatTime = heartbeatTime;
}
public Date getLastRestartTime() {
return lastRestartTime;
}
public void setLastRestartTime(Date lastRestartTime) {
this.lastRestartTime = lastRestartTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}