public boolean processEvent(Event event, boolean queryTweets, TweetDatabaseConnector connector) throws TwitterException
  {
    boolean ret = false;
    
    Date dateFrom = event.getDateFrom();
    Date dateTo = event.getDateTo();
    Date currentDate = Calendar.getInstance().getTime();
    
    if(between(currentDate, dateFrom, dateTo))
    {
      ret = true;
      try
      {
	// initialize the twitterstream with customer keys
	connector.updateEventCollectionState(event.getEventId(), Event.COLLECTION_STATE_ACTIVE); // update event to collecting active
	if(queryTweets)
	{
	  Query query = new Query(event.getTags());
	  SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
	  if(event.getDateFrom() != null)
	    query.setSince(sdf.format(event.getDateFrom()));
	  if(event.getDateTo() != null)
	    query.setUntil(sdf.format(event.getDateTo()));
	    
	  List<Status> statuses = loadTweets(query);
	  int countTweetsInserted = 0;
	    
	  for (int i = 0; i < statuses.size(); i++)
	  {
	    Status tweet = statuses.get(i);
	    if (tweet != null)
	    {
	      TweetState tw = new TweetState(tweet.getId(), tweet.getText(), tweet.getUser().getName(), new Date(tweet.getCreatedAt().getTime()), tweet.getUser().getLocation(), tweet.getUser().getLang(), event.getEventId());
	      countTweetsInserted+=connector.insertTweetEntry(tw);
	    }
	  }
	  System.out.println("Event: " + event.getEventTitle() + " --> " + countTweetsInserted + " Tweets inserted into the database.");
	  traceHandler.getLogger().log(Level.INFO, "Event: " + event.getEventTitle() + " --> " + countTweetsInserted + " Tweets inserted into the database.");
	}
	connector.updateEventCollectionState(event.getEventId(), Event.COLLECTION_STATE_FINISHED); // update event to collecting finished
      } catch (TwitterException ex)
      {
	ex.printStackTrace();
	traceHandler.getLogger().log(Level.ERROR, "Twitter Failure: " + ex.getMessage());
      }
    }
    return ret;
  }