Examples of cmd()


Examples of akka.io.Tcp.CommandFailed.cmd()

  public void onReceive(Object msg) throws Exception {
    if (msg instanceof Bound) {
      log.info("listening on [{}]", ((Bound) msg).localAddress());
    } else if (msg instanceof Tcp.CommandFailed) {
      final CommandFailed failed = (CommandFailed) msg;
      if (failed.cmd() instanceof Bind) {
        log.warning("cannot bind to [{}]", ((Bind) failed.cmd()).localAddress());
        getContext().stop(getSelf());
      } else {
        log.warning("unknown command failed [{}]", failed.cmd());
      }
View Full Code Here

Examples of akka.io.Tcp.CommandFailed.cmd()

    if (msg instanceof Bound) {
      log.info("listening on [{}]", ((Bound) msg).localAddress());
    } else if (msg instanceof Tcp.CommandFailed) {
      final CommandFailed failed = (CommandFailed) msg;
      if (failed.cmd() instanceof Bind) {
        log.warning("cannot bind to [{}]", ((Bind) failed.cmd()).localAddress());
        getContext().stop(getSelf());
      } else {
        log.warning("unknown command failed [{}]", failed.cmd());
      }
    } else
View Full Code Here

Examples of akka.io.Tcp.CommandFailed.cmd()

      final CommandFailed failed = (CommandFailed) msg;
      if (failed.cmd() instanceof Bind) {
        log.warning("cannot bind to [{}]", ((Bind) failed.cmd()).localAddress());
        getContext().stop(getSelf());
      } else {
        log.warning("unknown command failed [{}]", failed.cmd());
      }
    } else
    if (msg instanceof Connected) {
      final Connected conn = (Connected) msg;
      log.info("received connection from [{}]", conn.remoteAddress());
View Full Code Here

Examples of com.jitlogic.zorka.core.integ.NagiosJmxCommand.cmd()

                .metric(perfmon.metric("TEST", "B"))
        ).withSummaryLine("TEST ${STATUS} - test item ${ATTR.name} ${LVAL0} ${UNIT0}; ")
         .withFirstResult().withLabel("${name}")
         .withPerfLine("${LABEL}=${LVAL0}${UNIT0};${LVAL0}");

        NrpePacket pkt = cmd.cmd();

        assertNotNull("should return some packet", pkt);
        assertEquals(NrpePacket.OK, pkt.getResultCode());
        assertEquals("TEST OK - test item bean1 10 B; | bean1=10B;10", pkt.getData());
    }
View Full Code Here

Examples of com.jitlogic.zorka.core.integ.NagiosJmxCommand.cmd()

                        .withFirstResult().withLabel("${name}")
                        .withPerfLine("${LABEL}=${LVAL0}${UNIT0};${LVAL0}");

        cmd.withRcMin("LVAL0", 15, 5);
        assertEquals("Should respond with WARN status",
                NrpePacket.WARN, cmd.cmd().getResultCode());
        cmd.withRcMin("LVAL0", 20, 15);

        assertEquals("Should respond with ERROR status",
                NrpePacket.ERROR, cmd.cmd().getResultCode());
View Full Code Here

Examples of com.jitlogic.zorka.core.integ.NagiosJmxCommand.cmd()

        assertEquals("Should respond with WARN status",
                NrpePacket.WARN, cmd.cmd().getResultCode());
        cmd.withRcMin("LVAL0", 20, 15);

        assertEquals("Should respond with ERROR status",
                NrpePacket.ERROR, cmd.cmd().getResultCode());

        cmd.withRcMax("LVAL0", 7, 15);
        assertEquals("Should respond with WARN status",
                NrpePacket.WARN, cmd.cmd().getResultCode());
View Full Code Here

Examples of com.jitlogic.zorka.core.integ.NagiosJmxCommand.cmd()

        assertEquals("Should respond with ERROR status",
                NrpePacket.ERROR, cmd.cmd().getResultCode());

        cmd.withRcMax("LVAL0", 7, 15);
        assertEquals("Should respond with WARN status",
                NrpePacket.WARN, cmd.cmd().getResultCode());

        cmd.withRcMax("LVAL0", 5, 9);
        assertEquals("Should respond with WARN status",
                NrpePacket.ERROR, cmd.cmd().getResultCode());
    }
View Full Code Here

Examples of com.jitlogic.zorka.core.integ.NagiosJmxCommand.cmd()

        assertEquals("Should respond with WARN status",
                NrpePacket.WARN, cmd.cmd().getResultCode());

        cmd.withRcMax("LVAL0", 5, 9);
        assertEquals("Should respond with WARN status",
                NrpePacket.ERROR, cmd.cmd().getResultCode());
    }


    @Test
    public void testSumJmxScan() throws Exception {
View Full Code Here

Examples of com.jitlogic.zorka.core.integ.NagiosJmxCommand.cmd()

                ).withSummaryLine("TEST ${STATUS} - test items summary ${LVAL0} ${UNIT0}; ")
                 .withLabel("${name}").withSumResult("sum")
                 .withTextLine("${ATTR.name} ${LVAL0} ${UNIT0}; ")
                 .withPerfLine("${LABEL}=${LVAL0}${UNIT0};${LVAL0}");

        NrpePacket pkt = cmd.cmd();

        assertNotNull("should return some packet", pkt);
        assertEquals(NrpePacket.OK, pkt.getResultCode());
        assertEquals("TEST OK - test items summary 20 B; | sum=20B;20\n"
                   + "bean1 10 B; \n"
View Full Code Here

Examples of com.jitlogic.zorka.core.integ.NagiosJmxCommand.cmd()

                ).withSummaryLine("TEST ${STATUS} - test item ${ATTR.name} ${LVAL0} ${UNIT0}; ")
                        .withLabel("${name}").withFilterResult("name", "bean2")
                        .withTextLine("${ATTR.name} ${LVAL0} ${UNIT0}; ")
                        .withPerfLine("${LABEL}=${LVAL0}${UNIT0};${LVAL0}");

        NrpePacket pkt = cmd.cmd();

        assertNotNull("should return some packet", pkt);
        assertEquals(NrpePacket.OK, pkt.getResultCode());
        assertEquals("TEST OK - test item bean2 10 B; | bean2=10B;10\n"
                        + "bean1 10 B; | bean1=10B;10",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.