Exemple #1
0
      @Override
      protected CommandResult innerExecute(ArgoClientContext context) {

        if (!_niNames.isEmpty()) {
          for (String niName : _niNames) {
            NetworkInterface ni = null;
            try {
              ni = NetworkInterface.getByName(niName);
            } catch (SocketException e) {
              Console.error(
                  "SocketException when attempting to get Network Interface named ["
                      + niName
                      + "]");
              Console.error(e.getMessage());
            }
            if (ni == null) {
              Console.error("Network Interface named [" + niName + "] does not exist.");
            } else {
              if (!context.getNIList().contains(niName)) {
                context.getNIList().add(niName);
                Console.info("Added Network Interface named [" + niName + "]");
              } else {
                Console.info("Already using Network Interface named [" + niName + "]");
              }
            }
          }
        }

        return CommandResult.OK;
      }
Exemple #2
0
      @Override
      protected CommandResult innerExecute(ArgoClientContext context) {

        ClientTransport transport = context.getClientTransportNamed(_transportName);
        if (transport != null) {
          Console.info(transport.showConfiguration());
        } else {
          Console.error("No transport named [" + _transportName + "]");
        }
        return CommandResult.OK;
      }
Exemple #3
0
      @Override
      protected CommandResult innerExecute(ArgoClientContext context) {

        ArrayList<ClientTransport> gens = context.getClientTransports();

        for (ClientTransport t : gens) {
          Console.info(t.getDescription());
        }

        return CommandResult.OK;
      }
Exemple #4
0
      @Override
      protected CommandResult innerExecute(ArgoClientContext context) {

        ClientTransport transport = context.getClientTransportNamed(_transportName);

        if (transport != null) {
          transport.setEnabled(false);
        } else {
          Console.error("No transport named [" + _transportName + "]");
        }
        return CommandResult.OK;
      }
Exemple #5
0
    @Override
    protected CommandResult innerExecute(ArgoClientContext context) {

      Console.info("\n------------------ Client URL Information --------------------");
      Console.info("  Client Listener URL ...... " + context.getListenerURL());
      Console.info("    (use 'config -url' to change.  Setting this will restart the listener)");
      Console.info("  Client RespondTo URL ..... " + context.getRespondToURL());
      Console.info("    (use 'config -rurl' to change. All subsequest probes will use that URL)");
      Console.info("  Default CID ... " + context.getDefaultCID());
      Console.info("    (use 'config -defaultCID' to change)");

      Console.info("\n------------------ Configured Transports --------------------");

      List<ClientTransport> transports = context.getClientTransports();

      for (ClientTransport t : transports) {
        Console.info(t.showConfiguration());
      }

      return CommandResult.OK;
    }
Exemple #6
0
  @Override
  protected CommandResult innerExecute(ArgoClientContext context) {

    if (_defaultCID != null) {
      Console.info("Setting default CID to: " + _defaultCID);
      context.setDefaultCID(_defaultCID);
    }

    if (_url != null) {
      context.restartListener(_url);
    }

    if (_rurl != null) {
      context.getConfig().setResponseURL(_rurl);
    }

    return CommandResult.OK;
  }
Exemple #7
0
      @Override
      protected CommandResult innerExecute(ArgoClientContext context) {

        if (!_niNames.isEmpty()) {
          for (String niName : _niNames) {
            NetworkInterface ni = null;
            try {
              ni = NetworkInterface.getByName(niName);
            } catch (SocketException e) {
              Console.error(
                  "SocketException when attempting to get Network Interface named ["
                      + niName
                      + "]");
              Console.error(e.getMessage());
            }
            if (ni == null) {
              Console.error("Network Interface named [" + niName + "] does not exist.");
            } else {
              if (context.getNIList().contains(niName)) {
                context.getNIList().remove(niName);
                Console.info("Ignoring Network Interface named [" + niName + "]");
                if (context.getNIList().isEmpty()) {
                  Console.info(
                      "ATTENTION:  You are not using any available Network Interfaces to send probes that require a NI to work.");
                  Console.info(
                      "ATTENTION:  You must use at least one NI to send probes for those type of transports.");
                  Console.info(
                      "ATTENTION:  Use 'config transport list' to see which transports require a NI.");
                }
              } else {
                Console.info("Already ignoring Network Interface named [" + niName + "]");
              }
            }
          }
        }

        return CommandResult.OK;
      }
Exemple #8
0
      @Override
      protected CommandResult innerExecute(ArgoClientContext context) {

        List<String> niNames;
        try {
          niNames = context.getAvailableNetworkInterfaces(_mcEnabled);
        } catch (SocketException e1) {
          Console.error("Issues getting the available network interfaces.");
          Console.error(e1.getMessage());
          return CommandResult.ERROR;
        }

        if (_mcEnabled) {
          Console.info("Available Multicast enabled Network Interfaces");
        } else {
          Console.info("All Available Network Interfaces");
        }

        for (String niName : niNames) {
          try {
            NetworkInterface ni = NetworkInterface.getByName(niName);
            StringBuffer buf = new StringBuffer();
            buf.append("NI named " + ni.getName());
            if (context.getNIList().contains(ni.getName())) {
              buf.append(" (USING) ");
            }
            buf.append(" at addresses " + ni.getInterfaceAddresses());
            Console.info(buf.toString());
          } catch (SocketException e) {
            Console.error("Issues getting the network interface for name [" + niName + "]");
            Console.error(e.getMessage());
          }
        }

        return CommandResult.OK;
      }