Esempio n. 1
0
        internal static EventCacheItem ConvertToEventEntry(Alachisoft.NCache.Common.Protobuf.EventCacheItem cacheItem)
        {
            Byte[] objectValue = null;

            if (cacheItem == null)
            {
                return(null);
            }

            EventCacheItem item = new EventCacheItem();

            item.CacheItemPriority = (CacheItemPriority)cacheItem.priority;
            item.CacheItemVersion  = new CacheItemVersion(cacheItem.itemVersion);
            item.Group             = String.IsNullOrEmpty(cacheItem.group) ? null : cacheItem.group;
            item.SubGroup          = String.IsNullOrEmpty(cacheItem.subGroup) ? null : cacheItem.subGroup;
            item.Flagmap           = new Common.BitSet((byte)cacheItem.flagMap);
            if (cacheItem.value != null && cacheItem.value.Count > 0)
            {
                UserBinaryObject ubObject = UserBinaryObject.CreateUserBinaryObject(cacheItem.value.ToArray());
                objectValue = ubObject.GetFullObject();
                item.SetValue(objectValue);
            }

            item.EntryType = NCache.Util.MiscUtil.ProtoItemTypeToEntryType(cacheItem.itemType);

            return(item);
        }
Esempio n. 2
0
        internal static EventCacheItem ConvertToEventEntry(Alachisoft.NCache.Common.Protobuf.EventCacheItem cacheItem)
        {
            Byte[] objectValue = null;

            if (cacheItem == null)
            {
                return(null);
            }

            EventCacheItem item = new EventCacheItem();

            item.CacheItemPriority  = (CacheItemPriority)cacheItem.priority;
            item.CacheItemVersion   = new Caching.CacheItemVersion(cacheItem.itemVersion);
            item.Group              = String.IsNullOrEmpty(cacheItem.group) ? null : cacheItem.group;
            item.ResyncExpiredItems = cacheItem.resyncExpiredItems;
            item.ResyncProviderName =
                String.IsNullOrEmpty(cacheItem.resyncProviderName) ? null : cacheItem.resyncProviderName;
            item.SubGroup = String.IsNullOrEmpty(cacheItem.subGroup) ? null : cacheItem.subGroup;
            if (cacheItem.value != null && cacheItem.value.Count > 0)
            {
                UserBinaryObject ubObject = UserBinaryObject.CreateUserBinaryObject(cacheItem.value.ToArray());
                objectValue = ubObject.GetFullObject();
                item.Value  = objectValue;
            }

            return(item);
        }
Esempio n. 3
0
        internal static EventCacheItem ConvertToEventEntry(Alachisoft.NCache.Common.Protobuf.EventCacheItem cacheItem)
        {
            Byte[] objectValue = null;

            if (cacheItem == null)
            {
                return(null);
            }

            EventCacheItem item = new EventCacheItem();

            item.CacheItemPriority = (CacheItemPriority)cacheItem.priority;
            if (cacheItem.value != null && cacheItem.value.Count > 0)
            {
                UserBinaryObject ubObject = UserBinaryObject.CreateUserBinaryObject(cacheItem.value.ToArray());
                objectValue = ubObject.GetFullObject();
                item.Value  = objectValue;
            }

            return(item);
        }