com.alachisoft.ncache.common.monitoring.IntervalCounterDataCollection Maven / Gradle / Ivy
package com.alachisoft.ncache.common.monitoring;
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;
import java.util.Iterator;
import java.util.Map;
public class IntervalCounterDataCollection implements InternalCompactSerializable {
private java.util.Map Values;
private java.util.Date Timestamp = new java.util.Date(0);
private boolean FromReplica;
private Publisher PublisherType;
private String InstanceName;
public final java.util.Map getValues()
{
return Values;
}
public final void setValues(java.util.Map value)
{
Values = value;
}
public final java.util.Date getTimestamp()
{
return Timestamp;
}
public final void setTimestamp(java.util.Date value)
{
Timestamp = value;
}
public final boolean getFromReplica()
{
return FromReplica;
}
public final void setFromReplica(boolean value)
{
FromReplica = value;
}
public final Publisher getPublisherType()
{
return PublisherType;
}
public final void setPublisherType(Publisher value)
{
PublisherType = value;
}
public final String getInstanceName()
{
return InstanceName;
}
public final void setInstanceName(String value)
{
InstanceName = value;
}
@Override
public void Deserialize(CompactReader reader) throws IOException, ClassNotFoundException {
}
@Override
public void Serialize(CompactWriter writer) throws IOException {
Map.Entry current = null;
Iterator ite = this.Values.entrySet().iterator();
if (ite == null)
{
writer.Write(false);
return;
}
else
{
writer.Write(true);
writer.Write(Values.size());
while (ite.hasNext()) {
current = (Map.Entry) ite.next();
writer.WriteObject(current.getKey());
writer.WriteObject(current.getValue());
}
}
writer.Write(Timestamp.getTime());
writer.Write(FromReplica);
writer.Write(PublisherType.getValue());
writer.WriteObject(InstanceName);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy