public IEntryView <K, V> GetEntryView(K key)
        {
            var keyData       = ToData(key);
            var request       = MapGetEntryViewCodec.EncodeRequest(GetName(), keyData, ThreadUtil.GetThreadId());
            var response      = Invoke(request, keyData);
            var parameters    = MapGetEntryViewCodec.DecodeResponse(response);
            var entryView     = new SimpleEntryView <K, V>();
            var dataEntryView = parameters.dataEntryView;

            if (dataEntryView == null)
            {
                return(null);
            }
            entryView.SetKey(ToObject <K>(dataEntryView.GetKey()));
            entryView.SetValue(ToObject <V>(dataEntryView.GetValue()));
            entryView.SetCost(dataEntryView.GetCost());
            entryView.SetCreationTime(dataEntryView.GetCreationTime());
            entryView.SetExpirationTime(dataEntryView.GetExpirationTime());
            entryView.SetHits(dataEntryView.GetHits());
            entryView.SetLastAccessTime(dataEntryView.GetLastAccessTime());
            entryView.SetLastStoredTime(dataEntryView.GetLastStoredTime());
            entryView.SetLastUpdateTime(dataEntryView.GetLastUpdateTime());
            entryView.SetVersion(dataEntryView.GetVersion());
            entryView.SetEvictionCriteriaNumber(dataEntryView.GetEvictionCriteriaNumber());
            entryView.SetTtl(dataEntryView.GetTtl());
            //TODO putCache
            return(entryView);
        }
 public static SimpleEntryView<IData, IData> Decode(IClientMessage clientMessage)
 {
     var dataEntryView = new SimpleEntryView<IData, IData>();
     dataEntryView.SetKey(clientMessage.GetData());
     dataEntryView.SetValue(clientMessage.GetData());
     dataEntryView.SetCost(clientMessage.GetLong());
     dataEntryView.SetCreationTime(clientMessage.GetLong());
     dataEntryView.SetExpirationTime(clientMessage.GetLong());
     dataEntryView.SetHits(clientMessage.GetLong());
     dataEntryView.SetLastAccessTime(clientMessage.GetLong());
     dataEntryView.SetLastStoredTime(clientMessage.GetLong());
     dataEntryView.SetLastUpdateTime(clientMessage.GetLong());
     dataEntryView.SetVersion(clientMessage.GetLong());
     dataEntryView.SetEvictionCriteriaNumber(clientMessage.GetLong());
     dataEntryView.SetTtl(clientMessage.GetLong());
     return dataEntryView;
 }
Пример #3
0
        public static SimpleEntryView <IData, IData> Decode(IClientMessage clientMessage)
        {
            var dataEntryView = new SimpleEntryView <IData, IData>();

            dataEntryView.SetKey(clientMessage.GetData());
            dataEntryView.SetValue(clientMessage.GetData());
            dataEntryView.SetCost(clientMessage.GetLong());
            dataEntryView.SetCreationTime(clientMessage.GetLong());
            dataEntryView.SetExpirationTime(clientMessage.GetLong());
            dataEntryView.SetHits(clientMessage.GetLong());
            dataEntryView.SetLastAccessTime(clientMessage.GetLong());
            dataEntryView.SetLastStoredTime(clientMessage.GetLong());
            dataEntryView.SetLastUpdateTime(clientMessage.GetLong());
            dataEntryView.SetVersion(clientMessage.GetLong());
            dataEntryView.SetEvictionCriteriaNumber(clientMessage.GetLong());
            dataEntryView.SetTtl(clientMessage.GetLong());
            return(dataEntryView);
        }