예제 #1
0
        public void get_object_info(Hashtable query_json, string callbackid)
        {
            ArrayList _list = _mongodbproxy.find(0, 0, 0, query_json, null);

            hubproxy _hubproxy = _hubmanager.get_hub(juggle.Imodule.current_ch);

            if (_hubproxy == null)
            {
                return;
            }

            int       count     = 0;
            ArrayList _datalist = new ArrayList();

            foreach (var data in _list)
            {
                _datalist.Add(data);

                count++;

                if (count >= 100)
                {
                    _hubproxy.ack_get_object_info(callbackid, _datalist);

                    count     = 0;
                    _datalist = new ArrayList();
                }
            }
            if (count > 0 && count < 100)
            {
                _hubproxy.ack_get_object_info(callbackid, _datalist);
            }

            _hubproxy.ack_get_object_info_end(callbackid);
        }
예제 #2
0
        public void reg_hub(string uuid)
        {
            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "hub {0} connected", uuid);

            hubproxy _hubproxy = _hubmanager.reg_hub(juggle.Imodule.current_ch, uuid);

            _hubproxy.reg_hub_sucess();
        }
예제 #3
0
        public void reg_hub(string uuid)
        {
            System.Console.WriteLine("hub " + uuid + " connected");

            hubproxy _hubproxy = _hubmanager.reg_hub(juggle.Imodule.current_ch, uuid);

            _hubproxy.reg_hub_sucess();
        }
예제 #4
0
 public count_event(hubproxy _hubproxy_, string _db, string _collection, Hashtable _query_json, string _callbackid)
 {
     _hubproxy  = _hubproxy_;
     db         = _db;
     collection = _collection;
     query_json = _query_json;
     callbackid = _callbackid;
 }
예제 #5
0
 public create_event(hubproxy _hubproxy_, string _db, string _collection, Hashtable _object_info, string _callbackid)
 {
     _hubproxy   = _hubproxy_;
     db          = _db;
     collection  = _collection;
     object_info = _object_info;
     callbackid  = _callbackid;
 }
예제 #6
0
        public hubproxy reg_hub(juggle.Ichannel ch, String uuid)
        {
            hubproxy _hubproxy = new hubproxy(ch);

            hubproxys_uuid.Add(uuid, _hubproxy);
            hubproxys.Add(ch, _hubproxy);

            return(_hubproxy);
        }
예제 #7
0
        public void updata_persisted_object(string db, string collection, Hashtable query_json, Hashtable object_info, string callbackid)
        {
            _mongodbproxy.update(db, collection, query_json, object_info);

            hubproxy _hubproxy = _hubmanager.get_hub(juggle.Imodule.current_ch);

            if (_hubproxy != null)
            {
                _hubproxy.ack_updata_persisted_object(callbackid);
            }
        }
예제 #8
0
        public void create_persisted_object(Hashtable object_info, string callbackid)
        {
            _mongodbproxy.save(object_info);

            hubproxy _hubproxy = _hubmanager.get_hub(juggle.Imodule.current_ch);

            if (_hubproxy != null)
            {
                _hubproxy.ack_create_persisted_object(callbackid);
            }
        }
예제 #9
0
        public void remove_object(string db, string collection, Hashtable query_json, string callbackid)
        {
            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "remove_object");

            _mongodbproxy.remove(db, collection, query_json);
            hubproxy _hubproxy = _hubmanager.get_hub(juggle.Imodule.current_ch);

            if (_hubproxy != null)
            {
                _hubproxy.ack_remove_object(callbackid);
            }
        }
예제 #10
0
        public void get_object_count(string db, string collection, Hashtable query_json, string callbackid)
        {
            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "get_object_info");

            ArrayList _list = _mongodbproxy.find(db, collection, 0, 0, 0, query_json, null);

            hubproxy _hubproxy = _hubmanager.get_hub(juggle.Imodule.current_ch);

            if (_hubproxy == null)
            {
                log.log.error(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "get_object_info hubproxy is null");
                return;
            }

            _hubproxy.ack_get_object_count(callbackid, _list.Count);
        }
예제 #11
0
        public void get_object_info(string db, string collection, Hashtable query_json, string callbackid)
        {
            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "begin get_object_info");

            hubproxy _hubproxy = dbproxy._hubmanager.get_hub(juggle.Imodule.current_ch);

            if (_hubproxy == null)
            {
                log.log.error(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "hubproxy is null");
                return;
            }

            dbproxy._dbevent.push_find_event(new find_event(_hubproxy, db, collection, query_json, callbackid));

            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "end get_object_info");
        }
예제 #12
0
        public void create_persisted_object(string db, string collection, Hashtable object_info, string callbackid)
        {
            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "begin create_persisted_object");

            hubproxy _hubproxy = dbproxy._hubmanager.get_hub(juggle.Imodule.current_ch);

            if (_hubproxy == null)
            {
                log.log.error(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "hubproxy is null");
                return;
            }

            dbproxy._dbevent.push_create_event(new create_event(_hubproxy, db, collection, object_info, callbackid));

            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "end create_persisted_object");
        }
예제 #13
0
        public void get_object_info(string db, string collection, Hashtable query_json, string callbackid)
        {
            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "get_object_info");

            ArrayList _list = _mongodbproxy.find(db, collection, 0, 0, 0, query_json, null);

            hubproxy _hubproxy = _hubmanager.get_hub(juggle.Imodule.current_ch);

            if (_hubproxy == null)
            {
                log.log.error(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "get_object_info hubproxy is null");
                return;
            }

            int       count     = 0;
            ArrayList _datalist = new ArrayList();

            if (_list.Count == 0)
            {
                _hubproxy.ack_get_object_info(callbackid, _datalist);
            }
            else
            {
                foreach (var data in _list)
                {
                    _datalist.Add(data);

                    count++;

                    if (count >= 100)
                    {
                        _hubproxy.ack_get_object_info(callbackid, _datalist);

                        count     = 0;
                        _datalist = new ArrayList();
                    }
                }
                if (count > 0 && count < 100)
                {
                    _hubproxy.ack_get_object_info(callbackid, _datalist);
                }
            }

            _hubproxy.ack_get_object_info_end(callbackid);
        }