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

com.alachisoft.ncache.client.internal.communication.ModuleOperation Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
package com.alachisoft.ncache.client.internal.communication;

import Alachisoft.NCache.Common.Extensibility.Client.RPC.Partition;

import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Map;

public class ModuleOperation {


    private String module;
    private String version;
    private boolean isUnicastOperation;
    private ArrayList> _payloads = new ArrayList>();
    private ArrayList> _resultPayloads = new ArrayList>();
    private ArrayList> _failures;

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public boolean isUnicastOperation() {
        return isUnicastOperation;
    }

    public void setUnicastOperation(boolean unicastOperation) {
        isUnicastOperation = unicastOperation;
    }

    public final ArrayList> GetPayloads() {
        return _payloads;
    }

    public final ArrayList> GetResults() {
        return _resultPayloads;
    }

    public final ArrayList> GetFailures() {
        return _failures;
    }

    public final void AddPayload(Partition partition, byte[] payload) {
        synchronized (this) {
            _payloads.add(new AbstractMap.SimpleEntry<>(partition, payload));
        }
    }

    public final void AddResult(Partition partition, byte[] result) {
        synchronized (this) {
            _resultPayloads.add(new AbstractMap.SimpleEntry<>(partition, result));
        }
    }

    public final void AddFailure(Partition partition, Exception error) {
        synchronized (this) {
            if (_failures == null) {
                _failures = new ArrayList<>();
            }

            _failures.add(new AbstractMap.SimpleEntry<>(partition, error));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy