Esempio n. 1
0
        internal static ItemRemoveCallbackResponse GetItemRemovedCallbackResponse(EventContext eventContext, short id, string key, UserBinaryObject value, BitSet flag, ItemRemoveReason reason, EventDataFilter dataFilter)
        {
            Alachisoft.NCache.Common.Protobuf.ItemRemoveCallbackResponse itemRemovedCallback = new Alachisoft.NCache.Common.Protobuf.ItemRemoveCallbackResponse();

            itemRemovedCallback.key              = key;
            itemRemovedCallback.callbackId       = id;
            itemRemovedCallback.itemRemoveReason = (int)reason;
            itemRemovedCallback.flag             = flag != null? (int)flag.Data : 0;
            itemRemovedCallback.dataFilter       = (short)dataFilter;
            itemRemovedCallback.eventId          = new Common.Protobuf.EventId();
            UserBinaryObject binaryObject = eventContext.Item != null ?(UserBinaryObject)eventContext.Item.Value : null;

            if (binaryObject != null)
            {
                itemRemovedCallback.value.AddRange(binaryObject.DataList);
            }

            if (eventContext != null)
            {
                itemRemovedCallback.eventId.eventUniqueId    = eventContext.EventID.EventUniqueID;
                itemRemovedCallback.eventId.operationCounter = eventContext.EventID.OperationCounter;
                itemRemovedCallback.eventId.eventCounter     = eventContext.EventID.EventCounter;
                if (eventContext.Item != null)
                {
                    itemRemovedCallback.flag = eventContext.Item.Flags.Data;
                }
                itemRemovedCallback.eventId.item = ConvertToEventItem(eventContext.Item, null);
                if (itemRemovedCallback.eventId.item != null && itemRemovedCallback.eventId.item.value != null)
                {
                    itemRemovedCallback.eventId.item.value.Clear();//data will be travalling in old fashion due to old callbacks
                }
            }

            return(itemRemovedCallback);
        }
Esempio n. 2
0
        internal static ItemRemoveCallbackResponse GetItemRemovedCallbackResponse(EventContext eventContext, short id, string key, UserBinaryObject value, BitSet flag, ItemRemoveReason reason,EventDataFilter dataFilter)
        {
            Alachisoft.NCache.Common.Protobuf.ItemRemoveCallbackResponse itemRemovedCallback = new Alachisoft.NCache.Common.Protobuf.ItemRemoveCallbackResponse();

            itemRemovedCallback.key = key;
            itemRemovedCallback.callbackId = id;
            itemRemovedCallback.itemRemoveReason = (int)reason;
            itemRemovedCallback.flag = flag != null? (int)flag.Data : 0;
            itemRemovedCallback.dataFilter = (short)dataFilter;
            itemRemovedCallback.eventId = new Common.Protobuf.EventId();
            UserBinaryObject binaryObject = eventContext.Item != null ?(UserBinaryObject) eventContext.Item.Value : null;
            if(binaryObject != null) itemRemovedCallback.value.AddRange(binaryObject.DataList);

            if (eventContext != null)
            {
                itemRemovedCallback.eventId.eventUniqueId = eventContext.EventID.EventUniqueID;
                itemRemovedCallback.eventId.operationCounter = eventContext.EventID.OperationCounter;
                itemRemovedCallback.eventId.eventCounter = eventContext.EventID.EventCounter;
                if (eventContext.Item != null)
                    itemRemovedCallback.flag = eventContext.Item.Flags.Data;
                itemRemovedCallback.eventId.item = ConvertToEventItem(eventContext.Item, null);
                if (itemRemovedCallback.eventId.item != null && itemRemovedCallback.eventId.item.value != null)
                {
                    itemRemovedCallback.eventId.item.value.Clear();//data will be travalling in old fashion due to old callbacks
                }
            }

            return itemRemovedCallback;
        }