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

com.alachisoft.ncache.common.monitoring.CounterDataCollection 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;

public class CounterDataCollection implements InternalCompactSerializable
{
    private Publisher Category;
    public final Publisher getCategory()
    {
        return Category;
    }
    public final void setCategory(Publisher value)
    {
        Category = value;
    }

    private String Version;
    public final String getVersion()
    {
        return Version;
    }
    public final void setVersion(String value)
    {
        Version = value;
    }

    private String InstanceName;
    public final String getInstanceName()
    {
        return InstanceName;
    }
    public final void setInstanceName(String value)
    {
        InstanceName = value;
    }

    private boolean FromReplica;
    public final boolean getFromReplica()
    {
        return FromReplica;
    }
    public final void setFromReplica(boolean value)
    {
        FromReplica = value;
    }
    /**
     This is to be used for bridge caches. UniqueCacheId consists of cache name + alias (Cache complete name)
     */
    private String CacheUniqueID;
    public final String getCacheUniqueID()
    {
        return CacheUniqueID;
    }
    public final void setCacheUniqueID(String value)
    {
        CacheUniqueID = value;
    }

    private java.util.ArrayList Values;
    public final java.util.ArrayList getValues()
    {
        return Values;
    }
    public final void setValues(java.util.ArrayList value)
    {
        Values = value;
    }

    private IntervalCounterDataCollection SystemMetricValues;
    public final IntervalCounterDataCollection getSystemMetricValues()
    {
        return SystemMetricValues;
    }
    public final void setSystemMetricValues(IntervalCounterDataCollection value)
    {
        SystemMetricValues = value;
    }

    public final void AddCounterData(IntervalCounterDataCollection counterData)
    {

    }

    public final void Merge(CounterDataCollection other)
    {

    }

    @Override
    public final void Deserialize(CompactReader reader) throws IOException {
//        Category = (Publisher)reader.ReadInt32();
//        Object tempVar = reader.ReadObject();
//        Version = (String)((tempVar instanceof String) ? tempVar : null);
//        Values = SerializationUtility.DeserializeList(reader);
//        Object tempVar2 = reader.ReadObject();
//        SystemMetricValues = (IntervalCounterDataCollection)((tempVar2 instanceof IntervalCounterDataCollection) ? tempVar2 : null);
//        Object tempVar3 = reader.ReadObject();
//        CacheUniqueID = (String)((tempVar3 instanceof String) ? tempVar3 : null);
//        Object tempVar4 = reader.ReadObject();
//        InstanceName = (String)((tempVar4 instanceof String) ? tempVar4 : null);
//        FromReplica = reader.ReadBoolean();
    }

    @Override
    public final void Serialize(CompactWriter writer) throws IOException {
        writer.Write(Category.getValue());
        writer.WriteObject(Version);
        if (Values == null)
        {
            writer.Write(false);
            return;
        }
        else
        {
            writer.Write(true);
            writer.Write(Values.size());
            for (int i = 0; i < Values.size(); i++)
            {
                writer.WriteObject(Values.get(i));

            }
        }
        writer.WriteObject(SystemMetricValues);
        writer.WriteObject(CacheUniqueID);
        writer.WriteObject(InstanceName);
        writer.Write(FromReplica);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy