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

Alachisoft.NCache.Common.DataStructures.BridgeOperationData Maven / Gradle / Ivy

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

import com.alachisoft.ncache.serialization.core.io.ICompactSerializable;
import com.alachisoft.ncache.serialization.core.io.NCacheObjectInput;
import com.alachisoft.ncache.serialization.core.io.NCacheObjectOutput;

import java.io.IOException;


/**
 * Contains bridge operation along with the source cache id from which operation was sent to bridge.
 */
public class BridgeOperationData implements ICompactSerializable {

    private BridgeOperation _operation;
    private String _srcCacheUniqueID;

    public BridgeOperationData() {
    }

    public BridgeOperationData(BridgeOperation operation, String srcCacheUniqueID) {
        _operation = operation;
        _srcCacheUniqueID = srcCacheUniqueID;
    }

    public final BridgeOperation getOperation() {
        return _operation;
    }

    public final String getSrcCacheUniqueID() {
        return _srcCacheUniqueID;
    }

//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
    ///#region ICompactSerializable Members

    public final void Deserialize(com.alachisoft.ncache.serialization.standard.io.CompactReader reader) throws IOException, ClassNotFoundException {
        _operation = (BridgeOperation) reader.ReadObject();
        _srcCacheUniqueID = reader.ReadString();
    }

    public final void Serialize(com.alachisoft.ncache.serialization.standard.io.CompactWriter writer) throws IOException, ClassNotFoundException {
        writer.WriteObject(_operation);
        writer.Write(_srcCacheUniqueID);
    }

//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
    ///#endregion

    @Override
    public void serialize(NCacheObjectOutput out) throws IOException {
        out.writeObject(_operation);
        out.writeObject(_srcCacheUniqueID);
    }

    @Override
    public void deserialize(NCacheObjectInput in) throws IOException, ClassNotFoundException {
        _operation = (BridgeOperation) in.readObject();
        _srcCacheUniqueID = (String) in.readObject();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy