public HTTPPOSTExecutor(DSRESTConnection connection, HttpWebRequest Client, DSRESTCommand command, DSAdmin Sender, Delegate callback, Delegate EXCallback, TJSONArray parameters)
                : base(connection, Client, command, Sender, callback, EXCallback)
            {
                this._parameters = parameters;

                Client.Method = "POST";
                SetUpHeaders(Client);
            }
Exemple #2
0
 public WorkerThread(DSRESTConnection connection,
                     DSCallbackChannelManager mngr)
     : base()
 {
     this.dsadmin = new DSAdmin(connection, mngr.ExCallback);
     this.mngr    = mngr;
     callbacks    = new Dictionary <string, DBXCallback>();
 }
Exemple #3
0
        /**
         * Allows you to prepare and execute a request of type REST.
         *
         * Use the properties and methods of DSRESTCommand to: <br>
         * &nbsp;&nbsp;&nbsp;&nbsp;- Set and get the request type. <br>
         * &nbsp;&nbsp;&nbsp;&nbsp;- Set and get the specific method to call. <br>
         * &nbsp;&nbsp;&nbsp;&nbsp;- Prepare the command from a metadata input
         * parameter. <br>
         * &nbsp;&nbsp;&nbsp;&nbsp;- Get all the parameters contained. <br>
         * &nbsp;&nbsp;&nbsp;&nbsp;- Get a parameter by index or name.
         *
         */

        public DSRESTCommand(DSRESTConnection Connection) : base()
        {
            this.Connection = Connection;
            Admin           = new DSAdmin(Connection, (ex) =>
            {
                throw ex;
            });
        }
 /**
  * Allows you to prepare and execute a request of type REST.
  *
  * Use the properties and methods of DSRESTCommand to: <br>
  * &nbsp;&nbsp;&nbsp;&nbsp;- Set and get the request type. <br>
  * &nbsp;&nbsp;&nbsp;&nbsp;- Set and get the specific method to call. <br>
  * &nbsp;&nbsp;&nbsp;&nbsp;- Prepare the command from a metadata input
  * parameter. <br>
  * &nbsp;&nbsp;&nbsp;&nbsp;- Get all the parameters contained. <br>
  * &nbsp;&nbsp;&nbsp;&nbsp;- Get a parameter by index or name.
  *
  */
 public DSRESTCommand(DSRESTConnection Connection)
     : base()
 {
     this.Connection = Connection;
     Admin = new DSAdmin(Connection, (ex) =>
     {
     throw ex;
     });
 }
 public DSCallbackChannelManager(DSRESTConnection Connection,
         String ChannelName)
     : base()
 {
     locker = new Object();
     this.ChannelName = ChannelName;
     this.ManagerID = getNewManagerID();
     this.Connection = Connection;
     this.dsadmin = new DSAdmin(this.Connection, ExCallback);
     Random random = new Random();
     this.SecurityToken = Convert.ToString(random.Next(100000)) + "." + Convert.ToString(random.Next(100000));
 }
Exemple #6
0
        public DSCallbackChannelManager(DSRESTConnection Connection,
                                        String ChannelName)
            : base()
        {
            locker           = new Object();
            this.ChannelName = ChannelName;
            this.ManagerID   = getNewManagerID();
            this.Connection  = Connection;
            this.dsadmin     = new DSAdmin(this.Connection, ExCallback);
            Random random = new Random();

            this.SecurityToken = Convert.ToString(random.Next(100000)) + "." + Convert.ToString(random.Next(100000));
        }
        /**
         * Clone the current connection. The session is optionally included in the clone.
         *
         * @param includeSession true to include session information in the new connection, false to exclude it.
         *
         * @return the new DSRESTConnection
         */

        public DSRESTConnection Clone(bool includeSession)
        {
            DSRESTConnection connection = new DSRESTConnection();

            connection.setHost(this.getHost());
            connection.setPort(this.getPort());
            connection.setProtocol(this.getProtocol());
            connection.setUserName(this.getUserName());
            connection.setPassword(this.getPassword());
            connection.setUrlPath(this.getUrlPath());
            connection.setConnectionTimeout(this.getConnectionTimeout());
            if (includeSession)
            {
                connection.setSessionID(this.getSessionID());
                connection.SessionIDExpires = this.SessionIDExpires;
            }
            return(connection);
        }
            protected HTTPExecutor(DSRESTConnection connection, HttpWebRequest Client, DSRESTCommand command, DSAdmin Sender, Delegate callback, Delegate EXCallback)
            {
                this.connection = connection;
                this.Client     = Client;
                this.command    = command;
                this.Sender     = Sender;
                this.callback   = callback;
                this.EXCallback = EXCallback;
                this._TimedOut  = false;
                this._Timer     = null;

                //don't enable timeout if the request is for a heavyweight callback. Heavyweight callbacks should be timed out
                //with custom code, which uses a call to close the channel with the server when the timeout happens.
                if (connection.getConnectionTimeout() > 0 && !isHeavyweightCallbackRequest(Client))
                {
                    connection.syncContext.Send(new SendOrPostCallback(x => initTimer()), null);
                }
            }
            public HTTPPOSTExecutor(DSRESTConnection connection, HttpWebRequest Client, DSRESTCommand command, DSAdmin Sender, Delegate callback, Delegate EXCallback, TJSONArray parameters)
                : base(connection, Client, command, Sender, callback, EXCallback)
            {
                this._parameters = parameters;

                Client.Method = "POST";
                SetUpHeaders(Client);
            }
 public HTTPGETExecutor(DSRESTConnection connection, HttpWebRequest Client, DSRESTCommand command, DSAdmin Sender, Delegate callback, Delegate EXCallback)
     : base(connection, Client, command, Sender, callback, EXCallback)
 {
     Client.Method = "GET";
     SetUpHeaders(Client);
 }
            protected HTTPExecutor(DSRESTConnection connection, HttpWebRequest Client, DSRESTCommand command, DSAdmin Sender, Delegate callback, Delegate EXCallback)
            {
                this.connection = connection;
                this.Client = Client;
                this.command = command;
                this.Sender = Sender;
                this.callback = callback;
                this.EXCallback = EXCallback;
                this._TimedOut = false;
                this._Timer = null;

                //don't enable timeout if the request is for a heavyweight callback. Heavyweight callbacks should be timed out
                //with custom code, which uses a call to close the channel with the server when the timeout happens.
                if (connection.getConnectionTimeout() > 0 && !isHeavyweightCallbackRequest(Client))
                {
                    connection.syncContext.Send(new SendOrPostCallback(x => initTimer()), null);
                }
            }
 /**
  * Clone the current connection. The session is optionally included in the clone.
  *
  * @param includeSession true to include session information in the new connection, false to exclude it.
  *
  * @return the new DSRESTConnection
  */
 public DSRESTConnection Clone(bool includeSession)
 {
     DSRESTConnection connection = new DSRESTConnection();
     connection.setHost(this.getHost());
     connection.setPort(this.getPort());
     connection.setProtocol(this.getProtocol());
     connection.setUserName(this.getUserName());
     connection.setPassword(this.getPassword());
     connection.setUrlPath(this.getUrlPath());
     connection.setConnectionTimeout(this.getConnectionTimeout());
     if (includeSession)
     {
         connection.setSessionID(this.getSessionID());
         connection.SessionIDExpires = this.SessionIDExpires;
     }
     return connection;
 }
Exemple #13
0
 public DSAdmin(DSRESTConnection Connection, ExceptionCallback ExCal)
 {
     BaseExCal = ExCal;
     connection = Connection;
 }
 public WorkerThread(DSRESTConnection connection,
         DSCallbackChannelManager mngr)
     : base()
 {
     this.dsadmin = new DSAdmin(connection, mngr.ExCallback);
     this.mngr = mngr;
     callbacks = new Dictionary<string, DBXCallback>();
 }
Exemple #15
0
 public TCompanyTweet(DSRESTConnection Connection, ExceptionCallback ExCal)
     : base(Connection, ExCal)
 {
 }
 public HTTPGETExecutor(DSRESTConnection connection, HttpWebRequest Client, DSRESTCommand command, DSAdmin Sender, Delegate callback, Delegate EXCallback)
     : base(connection, Client, command, Sender, callback, EXCallback)
 {
     Client.Method = "GET";
     SetUpHeaders(Client);
 }