示例#1
0
        public void Update(ContinuousQuery query, string clientId, string clientUniqueId, bool notifyAdd, bool notifyUpdate, bool notifyRemove, QueryDataFilters datafilters)
        {
            lock (this)
            {
                if (clientRefs.ContainsKey(query.UniqueId))
                {
                    HashVector cRefs = (HashVector)clientRefs[query.UniqueId];
                    if (cRefs.ContainsKey(clientId))
                    {
                        ClusteredList <string> refs = (ClusteredList <string>)cRefs[clientId];
                        if (!refs.Contains(clientUniqueId))
                        {
                            refs.Add(clientUniqueId);
                        }
                    }
                    else
                    {
                        ClusteredList <string> clientUniqueIds = new ClusteredList <string>();
                        clientUniqueIds.Add(clientUniqueId);
                        cRefs[clientId] = clientUniqueIds;
                    }

                    UpdateNotifications(notifyAdd, clientId, query.UniqueId, clientUniqueId, addNotifications, datafilters.AddDataFilter, maxAddDFAgainstCID, addDFAgainstCUniqueID);

                    UpdateNotifications(notifyUpdate, clientId, query.UniqueId, clientUniqueId, updateNotifications, datafilters.UpdateDataFilter, maxUpdateDFAgainstCID, updateDFAgainstCUniqueID);

                    UpdateNotifications(notifyRemove, clientId, query.UniqueId, clientUniqueId, removeNotifications, datafilters.RemoveDataFilter, maxRemoveDFAgainstCID, removeDFAgainstCUniqueID);
                }
            }
        }
示例#2
0
        public void Register(ContinuousQuery query, string clientId, string clientUniqueId, bool notifyAdd, bool notifyUpdate, bool notifyRemove, QueryDataFilters datafilters)
        {
            lock (this)
            {
                if (!Exists(query))
                {
                    registeredQueries.Add(query);

                    HashVector             refs            = new HashVector();
                    ClusteredList <string> clientUniqueIds = new ClusteredList <string>();
                    clientUniqueIds.Add(clientUniqueId);
                    refs[clientId] = clientUniqueIds;

                    clientRefs[query.UniqueId] = refs;

                    RegisterNotifications(notifyAdd, clientId, query.UniqueId, clientUniqueId, addNotifications, datafilters.AddDataFilter, maxAddDFAgainstCID, addDFAgainstCUniqueID);

                    RegisterNotifications(notifyUpdate, clientId, query.UniqueId, clientUniqueId, updateNotifications, datafilters.UpdateDataFilter, maxUpdateDFAgainstCID, updateDFAgainstCUniqueID);

                    RegisterNotifications(notifyRemove, clientId, query.UniqueId, clientUniqueId, removeNotifications, datafilters.RemoveDataFilter, maxRemoveDFAgainstCID, removeDFAgainstCUniqueID);
                }
                else
                {
                    Update(query, clientId, clientUniqueId, notifyAdd, notifyUpdate, notifyRemove, datafilters);
                }
            }
        }