Alachisoft.NCache.Common.Monitoring.CacheNodeStatistics Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nc-common Show documentation
Show all versions of nc-common Show documentation
Internal package of Alachisoft.
package Alachisoft.NCache.Common.Monitoring;
import Alachisoft.NCache.Common.Common;
import com.alachisoft.ncache.serialization.core.io.InternalCompactSerializable;
import com.alachisoft.ncache.serialization.standard.io.CompactReader;
import com.alachisoft.ncache.serialization.standard.io.CompactWriter;
import java.io.IOException;
public class CacheNodeStatistics implements InternalCompactSerializable {
private ServerNode _node;
private long _itemCount;
private long _dataSize;
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: private ushort _clientsConnected;
private short _clientsConnected;
private long _totalCacheSize;
private CacheNodeStatus _nodeStatus = CacheNodeStatus.Stopped;
public CacheNodeStatistics() {
}
public CacheNodeStatistics(ServerNode node) {
_node = node;
}
/**
* Gets/Sets the status of the cache node.
*/
public final CacheNodeStatus getStatus() {
return _nodeStatus;
}
public final void setStatus(CacheNodeStatus value) {
_nodeStatus = value;
}
/**
* Gets/Sets the item count.
*/
public final long getItemCount() {
return _itemCount;
}
public final void setItemCount(long value) {
_itemCount = value;
}
/**
* Gets/Sets the data size on the cache server node.
*/
public final long getDataSize() {
return _dataSize;
}
public final void setDataSize(long value) {
_dataSize = value;
}
/**
* Gets/Sets the total size on the cache server node.
*/
public final long getTotalCacheSize() {
return _totalCacheSize;
}
public final void setTotalCacheSize(long value) {
_totalCacheSize = value;
}
/**
* Gets/Sets the no of clients connected to a serve node.
*/
public final short getClientCount() {
return _clientsConnected;
}
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public void setClientCount(ushort value)
public final void setClientCount(short value) {
_clientsConnected = value;
}
public final ServerNode getNode() {
return _node;
}
public final void setNode(ServerNode value) {
_node = value;
}
//
public void Deserialize(CompactReader reader) throws IOException, ClassNotFoundException {
_node = (ServerNode) Common.readAs(reader.ReadObject(), ServerNode.class);
_itemCount = reader.ReadInt64();
_dataSize = reader.ReadInt64();
_clientsConnected = ((Integer) reader.ReadUInt16()).shortValue();
_totalCacheSize = reader.ReadInt64();
_nodeStatus = CacheNodeStatus.forValue(reader.ReadInt32());
}
public void Serialize(CompactWriter writer) throws IOException {
writer.WriteObject(_node);
writer.Write(_itemCount);
writer.Write(_dataSize);
writer.Write(_clientsConnected);
writer.Write(_totalCacheSize);
writer.Write(_nodeStatus.getValue());
}
//
}