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);
}
Aggregations