예제 #1
0
        public void run()
        {
            try
            {
                string csdl = "interaction.type == \"twitter\" and interaction.sample <= 1.0";

                m_form.deletesLog("Creating definition...");
                m_form.deletesLog("  " + csdl);
                Definition def = m_form.user.createDefinition(csdl);

                m_form.deletesLog("Creating consumer...");
                m_consumer = def.getConsumer(this, "http");

                m_form.deletesLog("Consuming...");
                m_consumer.consume();
            }
            catch (Exception e)
            {
                m_form.deletesLog(e.GetType().ToString() + ": " + e.Message);
                if (m_consumer != null)
                {
                    m_consumer.stop();
                }
            }
        }
예제 #2
0
 public void onInteraction(StreamConsumer consumer, Interaction interaction, string hash)
 {
     try
     {
         m_form.deletesLog(".", false);
     }
     catch (Exception e)
     {
         m_form.deletesLog(e.GetType().ToString() + ": " + e.Message);
     }
 }
예제 #3
0
 public void onDeleted(StreamConsumer consumer, Interaction interaction, string hash)
 {
     try
     {
         m_form.footballLog("Delete request for interaction " + interaction.getStringVal("interaction.id") + " of type " + interaction.getStringVal("interaction.type"));
         m_form.footballLog("Please delete it from your archive.");
         m_form.footballLog("--");
     }
     catch (Exception e)
     {
         m_form.footballLog(e.GetType().ToString() + ": " + e.Message);
     }
 }
예제 #4
0
        public void onDeleted(StreamConsumer consumer, Interaction interaction, string hash)
        {
            try
            {
                m_form.deletesLog("X", false);

                m_count--;
                if (m_count == 0)
                {
                    m_form.deletesLog("\r\n\r\nStopping consumer...");
                    consumer.stop();
                }
            }
            catch (Exception e)
            {
                m_form.deletesLog(e.GetType().ToString() + ": " + e.Message);
            }
        }
예제 #5
0
        public void onInteraction(StreamConsumer consumer, Interaction interaction, string hash)
        {
            try
            {
                m_form.footballLog("Type: " + interaction.getStringVal("interaction.type"));
                m_form.footballLog("Content: " + interaction.getStringVal("interaction.content"));
                m_form.footballLog("--");

                m_count--;
                if (m_count == 0)
                {
                    m_form.footballLog("Stopping consumer...");
                    consumer.stop();
                }
            }
            catch (Exception e)
            {
                m_form.footballLog(e.GetType().ToString() + ": " + e.Message);
            }
        }
예제 #6
0
        public void run()
        {
            try
            {
                string csdl = "interaction.content contains \"football\"";

                m_form.footballLog("Creating definition...");
                m_form.footballLog("  " + csdl);
                Definition def = m_form.user.createDefinition(csdl);

                m_form.footballLog("Creating consumer...");
                m_consumer = def.getConsumer(this, "http");

                m_form.footballLog("Consuming...");
                m_consumer.consume();
            }
            catch (Exception e)
            {
                m_form.footballLog(e.GetType().ToString() + ": " + e.Message);
            }
        }
예제 #7
0
 /// <summary>
 /// Get a StreamConsumer object for the given stream hash.
 /// </summary>
 /// <param name="hash">The stream hash.</param>
 /// <param name="event_handler">The object that will receive events.</param>
 /// <param name="type">The type of StreamConsumer required.</param>
 /// <returns>A StreamConsumer object.</returns>
 public StreamConsumer getConsumer(string hash, IEventHandler event_handler, string type = "http")
 {
     return(StreamConsumer.factory(this, type, new Definition(this, null, hash), event_handler));
 }
예제 #8
0
 public void onWarning(StreamConsumer consumer, string message)
 {
     m_form.deletesLog("\r\nWARN: " + message);
 }
예제 #9
0
 public void onConnect(StreamConsumer consumer)
 {
     m_form.deletesLog("Connected");
     m_form.deletesLog("--");
 }
예제 #10
0
        public void onDisconnect(StreamConsumer consumer)
        {
            m_form.footballLog("Disconnected");
            m_form.footballLog("--");

            m_form.resetFootballStartButton();
        }
예제 #11
0
 public void onError(StreamConsumer consumer, string message)
 {
     m_form.deletesLog("\r\nERR: " + message);
 }
예제 #12
0
 public void onWarning(StreamConsumer consumer, string message)
 {
     m_form.footballLog("WARN: " + message);
     m_form.footballLog("--");
 }
예제 #13
0
 public void onConnect(StreamConsumer consumer)
 {
     m_form.footballLog("Connected");
     m_form.footballLog("--");
 }
예제 #14
0
 /// <summary>
 /// Get a StreamConsumer object for the given array of stream hashes.
 /// </summary>
 /// <param name="hashes">The array of stream hashes.</param>
 /// <param name="event_handler">The object that will receive events.</param>
 /// <param name="type">The type of StreamConsumer required.</param>
 /// <returns>A StreamConsumer object.</returns>
 public StreamConsumer getMultiConsumer(string[] hashes, IEventHandler event_handler, string type = "http")
 {
     return(StreamConsumer.factory(this, type, hashes, event_handler));
 }
예제 #15
0
        public void onDisconnect(StreamConsumer consumer)
        {
            m_form.deletesLog("\r\nDisconnected");

            m_form.resetDeletesStartButton();
        }
예제 #16
0
 /// <summary>
 /// Get a consumer object of the given type for this Definition.
 /// </summary>
 /// <param name="event_handler">An object that implements the IEventHandler interface.</param>
 /// <param name="type">The consumer type required.</param>
 /// <returns>An instance of a class derived from StreamConsumer.</returns>
 public StreamConsumer getConsumer(IEventHandler event_handler, string type = "http")
 {
     return(StreamConsumer.factory(m_user, type, this, event_handler));
 }
예제 #17
0
 public void onError(StreamConsumer consumer, string message)
 {
     m_form.footballLog("ERR: " + message);
     m_form.footballLog("--");
 }