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

Alachisoft.NCache.Common.Monitoring.ConfiguredCacheInfo Maven / Gradle / Ivy

There is a newer version: 5.3.3
Show newest version
package Alachisoft.NCache.Common.Monitoring;


import Alachisoft.NCache.Common.Common;
import Alachisoft.NCache.Common.Enum.CacheTopology;
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 ConfiguredCacheInfo implements InternalCompactSerializable {

    private String _cacheId;
    private CacheTopology _topology = CacheTopology.values()[0];
    private boolean _running;
    private long _dataCapacity;
    private String _cachePropStirng;
    private String _partId;
    private int pid;
    private int managementPort;

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public int getManagementPort() {
        return managementPort;
    }

    public void setManagementPort(int managementPort) {
        this.managementPort = managementPort;
    }

    /**
     * Gets the cache id
     */
    public final String getCacheId() {
        return _cacheId;
    }

    public final void setCacheId(String _cacheId) {
        this._cacheId = _cacheId;
    }

    /**
     * Gets/Sets the topology of the cache.
     */
    public final CacheTopology getTopology() {
        return _topology;
    }

    public final void setTopology(CacheTopology _topology) {
        this._topology = _topology;
    }

    /**
     * Gets/Sets the running status of cache.
     */
    public final boolean getIsRunning() {
        return _running;
    }

    public final void setIsRunning(boolean _running) {
        this._running = _running;
    }

    /**
     * Gets/Sets the data capacity of the cache in MB.
     */
    public final long getDataCapacity() {
        return _dataCapacity;
    }

    public final void setDataCapacity(long _dataCapacity) {
        this._dataCapacity = _dataCapacity;
    }

    public final String getCachePropString() {
        return _cachePropStirng;
    }

    public final void setCachePropString(String _cachePropStirng) {
        this._cachePropStirng = _cachePropStirng;
    }

    public final String getPartId() {
        return this._partId;
    }

    public final void setPartId(String _partId) {
        this._partId = _partId;
    }

    public void Deserialize(CompactReader reader) throws IOException, ClassNotFoundException {
        _cacheId = (String) Common.readAs(reader.ReadObject(), String.class);
        _topology = CacheTopology.forValue(reader.ReadInt32());
        _running = reader.ReadBoolean();
        _dataCapacity = reader.ReadInt64();
        this._cachePropStirng = (String) Common.as(reader.ReadObject(), String.class);
        _partId = (String) Common.readAs(reader.ReadObject(), String.class);
        managementPort = reader.ReadInt32();
        pid = reader.ReadInt32();
    }

    public void Serialize(CompactWriter writer) throws IOException {
        writer.WriteObject(_cacheId);
        writer.Write(_topology.getValue());
        writer.Write(_running);
        writer.Write(_dataCapacity);
        writer.WriteObject(this._cachePropStirng);
        writer.WriteObject(_partId);
        writer.Write(managementPort);
        writer.Write(pid);

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy