Exemplo n.º 1
0
        static public superq Create(dynamic obj, string name, string host, string keyCol = "")
        {
            superq sq = new superq(obj, name, "", keyCol, false);

            SuperQNetworkClientMgr.superq_create(sq);

            return(sq);
        }
        public static void superq_delete(string name, string host)
        {
            // build request object
            SuperQNodeRequest request = new SuperQNodeRequest();

            request.cmd  = "superq_delete";
            request.args = name;

            SuperQNetworkClientMgr mgr = new SuperQNetworkClientMgr();

            mgr.send_msg(host, request.ToString());
        }
        public static void superqelem_delete(superq sq, string name)
        {
            // build request object
            SuperQNodeRequest request = new SuperQNodeRequest();

            request.cmd  = "superqelem_delete";
            request.args = sq.publicName;
            request.body = name;

            SuperQNetworkClientMgr mgr = new SuperQNetworkClientMgr();

            mgr.send_msg(sq.host, request.ToString());
        }
        public static void superqelem_create(superq sq, superqelem sqe, int idx = -1)
        {
            // build request object
            SuperQNodeRequest request = new SuperQNodeRequest();

            request.cmd  = "superqelem_create";
            request.args = sq.publicName + "," + idx.ToString();
            request.body = sqe.ToString();

            SuperQNetworkClientMgr mgr = new SuperQNetworkClientMgr();

            mgr.send_msg(sq.host, request.ToString());
        }
        public static void superq_create(superq sq)
        {
            // build request object from string
            SuperQNodeRequest request = new SuperQNodeRequest();

            request.cmd  = "superq_create";
            request.args = sq.publicName;
            request.body = sq.ToString();

            SuperQNetworkClientMgr mgr = new SuperQNetworkClientMgr();

            mgr.send_msg(sq.host, request.ToString());
        }
        public static bool superq_exists(string name, string host)
        {
            // build request object from string
            SuperQNodeRequest request = new SuperQNodeRequest();

            request.cmd  = "superq_exists";
            request.args = name;

            SuperQNetworkClientMgr mgr      = new SuperQNetworkClientMgr();
            SuperQNodeResponse     response = mgr.send_msg(host, request.ToString());

            return(bool.Parse(response.result));
        }
        public static superq superq_query(superq sq, string query)
        {
            // build request object from string
            SuperQNodeRequest request = new SuperQNodeRequest();

            request.cmd  = "superq_query";
            request.args = sq.publicName;
            request.body = query;

            SuperQNetworkClientMgr mgr      = new SuperQNetworkClientMgr();
            SuperQNodeResponse     response = mgr.send_msg(sq.host, request.ToString());

            if (bool.Parse(response.result) == false)
            {
                throw new Exception("Not sure what to raise here yet.");
            }

            return(new superq(response.body, "", "", "", false, true));
        }
        public static superq superq_read(string name, string host)
        {
            // build request object from string
            SuperQNodeRequest request = new SuperQNodeRequest();

            request.cmd  = "superq_read";
            request.args = name;

            SuperQNetworkClientMgr mgr      = new SuperQNetworkClientMgr();
            SuperQNodeResponse     response = mgr.send_msg(host, request.ToString());

            if (bool.Parse(response.result) == false)
            {
                throw new Exception(name + " does not exist.");
            }

            // deserialize response body into a detached superq and return
            return(new superq(response.body, "", "", "", false, true));
        }
Exemplo n.º 9
0
 static public void Delete(string name, string host)
 {
     SuperQNetworkClientMgr.superq_delete(name, host);
 }
Exemplo n.º 10
0
 static public superq Read(string name, string host)
 {
     return(SuperQNetworkClientMgr.superq_read(name, host));
 }
Exemplo n.º 11
0
 // Read remote superq
 public superq(string name, string host, bool attach = false)
 {
     FromString(SuperQNetworkClientMgr.superq_read(name, host).ToString(), attach);
 }