public static ResponseParameters DecodeResponse(IClientMessage clientMessage)
        {
            ResponseParameters parameters = new ResponseParameters();

            Hazelcast.Map.SimpleEntryView <IData, IData> dataEntryView = null;
            bool dataEntryView_isNull = clientMessage.GetBoolean();

            if (!dataEntryView_isNull)
            {
                dataEntryView            = EntryViewCodec.Decode(clientMessage);
                parameters.dataEntryView = dataEntryView;
            }
            return(parameters);
        }
Ejemplo n.º 2
0
        public static void Encode(ClientMessage clientMessage, Hazelcast.Map.SimpleEntryView <IData, IData> simpleEntryView)
        {
            clientMessage.Add(BeginFrame.Copy());

            var initialFrame = new Frame(new byte[InitialFrameSize]);

            EncodeLong(initialFrame.Content, CostFieldOffset, simpleEntryView.Cost);
            EncodeLong(initialFrame.Content, CreationTimeFieldOffset, simpleEntryView.CreationTime);
            EncodeLong(initialFrame.Content, ExpirationTimeFieldOffset, simpleEntryView.ExpirationTime);
            EncodeLong(initialFrame.Content, HitsFieldOffset, simpleEntryView.Hits);
            EncodeLong(initialFrame.Content, LastAccessTimeFieldOffset, simpleEntryView.LastAccessTime);
            EncodeLong(initialFrame.Content, LastStoredTimeFieldOffset, simpleEntryView.LastStoredTime);
            EncodeLong(initialFrame.Content, LastUpdateTimeFieldOffset, simpleEntryView.LastUpdateTime);
            EncodeLong(initialFrame.Content, VersionFieldOffset, simpleEntryView.Version);
            EncodeLong(initialFrame.Content, TtlFieldOffset, simpleEntryView.Ttl);
            EncodeLong(initialFrame.Content, MaxIdleFieldOffset, simpleEntryView.MaxIdle);
            clientMessage.Add(initialFrame);

            DataCodec.Encode(clientMessage, simpleEntryView.Key);
            DataCodec.Encode(clientMessage, simpleEntryView.Value);

            clientMessage.Add(EndFrame.Copy());
        }