com.alachisoft.ncache.client.internal.communication.ModuleOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ncache-professional-client Show documentation
Show all versions of ncache-professional-client Show documentation
NCache Professional client for java.
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));
}
}
}