Search in sources :

Example 1 with NobidReason

use of com.xrtb.commands.NobidReason in project XRTB by benmfaul.

the class WebCampaign method doExecute.

/**
	 * Used to stop, start, nobbideason and change log level of a bidder
	 * instance.
	 * 
	 * @param m
	 *            Map. The command parameters.
	 * @return Sting. The JSON encoded return of the command.
	 * @throws Exception
	 *             on cache/aerospike or JSON errors.
	 */
public String doExecute(Map m) throws Exception {
    String action = (String) m.get("action");
    String who = (String) m.get("who");
    String username = (String) m.get("username");
    switch(action) {
        case "start":
            StartBidder start = new StartBidder();
            start.from = username;
            start.to = who;
            Controller.getInstance().startBidder(start);
            break;
        case "stop":
            StopBidder stop = new StopBidder();
            stop.from = username;
            stop.to = who;
            Controller.getInstance().stopBidder(stop);
            break;
        case "loglevel":
            LogLevel level = new LogLevel();
            level.from = username;
            level.to = who;
            String valu = (String) m.get("level");
            level.target = valu;
            Controller.getInstance().setLogLevel(level);
            break;
        case "nobidreason":
            NobidReason nbr = new NobidReason();
            nbr.from = username;
            nbr.to = who;
            valu = (String) m.get("level");
            nbr.target = valu;
            Controller.getInstance().setNoBidReason(nbr);
            break;
        case "reload":
            break;
        default:
            break;
    }
    Map x = new HashMap();
    x.put("message", "Command sent");
    return getString(x);
}
Also used : StopBidder(com.xrtb.commands.StopBidder) HashMap(java.util.HashMap) StartBidder(com.xrtb.commands.StartBidder) HashMap(java.util.HashMap) Map(java.util.Map) LogLevel(com.xrtb.commands.LogLevel) NobidReason(com.xrtb.commands.NobidReason)

Aggregations

LogLevel (com.xrtb.commands.LogLevel)1 NobidReason (com.xrtb.commands.NobidReason)1 StartBidder (com.xrtb.commands.StartBidder)1 StopBidder (com.xrtb.commands.StopBidder)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1