<commit_before>package com.almende.dialog.agent;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

import org.jivesoftware.smack.XMPPException;

import com.almende.dialog.accounts.AdapterConfig;
import com.almende.dialog.adapter.MailServlet;
import com.almende.dialog.adapter.TwitterServlet;
import com.almende.dialog.adapter.TwitterServlet.TwitterEndpoint;
import com.almende.dialog.adapter.XMPPServlet;
import com.almende.dialog.adapter.tools.Broadsoft;
import com.almende.dialog.exception.ConflictException;
import com.almende.dialog.util.ServerUtils;
import com.almende.eve.agent.Agent;
import com.almende.eve.rpc.annotation.Access;
import com.almende.eve.rpc.annotation.AccessType;
import com.almende.eve.rpc.annotation.Name;
import com.almende.eve.rpc.annotation.Optional;
import com.almende.eve.rpc.jsonrpc.JSONRPCException;
import com.almende.eve.rpc.jsonrpc.JSONRPCException.CODE;
import com.almende.eve.rpc.jsonrpc.JSONRequest;
import com.almende.eve.rpc.jsonrpc.jackson.JOM;
import com.almende.util.twigmongo.TwigCompatibleMongoDatastore;
import com.almende.util.uuid.UUID;
import com.askfast.commons.agent.intf.AdapterAgentInterface;
import com.askfast.commons.entity.Adapter;
import com.fasterxml.jackson.databind.node.ArrayNode;

@Access(AccessType.PUBLIC)
public class AdapterAgent extends Agent implements AdapterAgentInterface {
	
	public static final String ADAPTER_TYPE_BROADSOFT = "broadsoft";
	public static final String ADAPTER_TYPE_SMS = "sms";
	public static final String ADAPTER_TYPE_EMAIL = "email";
	public static final String ADAPTER_TYPE_XMPP = "xmpp";
	public static final String ADAPTER_TYPE_TWITTER = "twitter";	
	public static final int EMAIL_SCHEDULER_INTERVAL = 30 * 1000; //30seconds
	public static final int TWITTER_SCHEDULER_INTERVAL = 60 * 1000; //60seconds
	private static final Logger log = Logger.getLogger( AdapterAgent.class.getSimpleName() );
	
    @Override
    protected void onCreate()
    {
        startAllInboundSceduler();
    }

    /**
     * starts scedulers for all inbound services such as Email, Twitter, XMPP etc
     */
    public void startAllInboundSceduler()
    {
        startEmailInboundSceduler();
        startTwitterInboundSceduler();
    }
    
    /**
     * stops scedulers for all inbound services such as Email, Twitter, XMPP etc
     */
    public void stopAllInboundSceduler()
    {
        stopEmailInboundSceduler();<commit_msg>update: run twitter scheduler once every 61secs<commit_after>package com.almende.dialog.agent;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

import org.jivesoftware.smack.XMPPException;

import com.almende.dialog.accounts.AdapterConfig;
import com.almende.dialog.adapter.MailServlet;
import com.almende.dialog.adapter.TwitterServlet;
import com.almende.dialog.adapter.TwitterServlet.TwitterEndpoint;
import com.almende.dialog.adapter.XMPPServlet;
import com.almende.dialog.adapter.tools.Broadsoft;
import com.almende.dialog.exception.ConflictException;
import com.almende.dialog.util.ServerUtils;
import com.almende.eve.agent.Agent;
import com.almende.eve.rpc.annotation.Access;
import com.almende.eve.rpc.annotation.AccessType;
import com.almende.eve.rpc.annotation.Name;
import com.almende.eve.rpc.annotation.Optional;
import com.almende.eve.rpc.jsonrpc.JSONRPCException;
import com.almende.eve.rpc.jsonrpc.JSONRPCException.CODE;
import com.almende.eve.rpc.jsonrpc.JSONRequest;
import com.almende.eve.rpc.jsonrpc.jackson.JOM;
import com.almende.util.twigmongo.TwigCompatibleMongoDatastore;
import com.almende.util.uuid.UUID;
import com.askfast.commons.agent.intf.AdapterAgentInterface;
import com.askfast.commons.entity.Adapter;
import com.fasterxml.jackson.databind.node.ArrayNode;

@Access(AccessType.PUBLIC)
public class AdapterAgent extends Agent implements AdapterAgentInterface {
	
	public static final String ADAPTER_TYPE_BROADSOFT = "broadsoft";
	public static final String ADAPTER_TYPE_SMS = "sms";
	public static final String ADAPTER_TYPE_EMAIL = "email";
	public static final String ADAPTER_TYPE_XMPP = "xmpp";
	public static final String ADAPTER_TYPE_TWITTER = "twitter";	
	public static final int EMAIL_SCHEDULER_INTERVAL = 30 * 1000; //30seconds
	public static final int TWITTER_SCHEDULER_INTERVAL = 61 * 1000; //61seconds
	private static final Logger log = Logger.getLogger( AdapterAgent.class.getSimpleName() );
	
    @Override
    protected void onCreate()
    {
        startAllInboundSceduler();
    }

    /**
     * starts scedulers for all inbound services such as Email, Twitter, XMPP etc
     */
    public void startAllInboundSceduler()
    {
        startEmailInboundSceduler();
        startTwitterInboundSceduler();
    }
    
    /**
     * stops scedulers for all inbound services such as Email, Twitter, XMPP etc
     */
    public void stopAllInboundSceduler()
    {
        stopEmailInboundSceduler();
{'fraction_non_alphanumeric': 0.09333062220414803, 'fraction_numerical': 0.0069133794225294835, 'mean_word_length': 4.793875147232038, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2016334', 'n_tokens_mistral': 1638, 'n_tokens_neox': 1526, 'n_words': 311}