use of com.xrtb.commands.LogLevel 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);
}
use of com.xrtb.commands.LogLevel in project XRTB by benmfaul.
the class TestZZZRedis method testSetLogLevel.
/**
* Test the echo/status message
*
* @throws Exception
* if the Controller is not complete.
*/
@Test
public void testSetLogLevel() throws Exception {
LogLevel e = new LogLevel("*", "-3");
e.id = "SETLOG-ID";
rcv = null;
latch = new CountDownLatch(1);
commands.add(e);
latch.await(5, TimeUnit.SECONDS);
Echo echo = (Echo) rcv;
// System.out.println(echo.toString());
assertEquals(echo.loglevel, -3);
}
Aggregations