Package com.azaptree.services.command

Examples of com.azaptree.services.command.CommandKey


      catMap.put(catalog.getName(), catalog);

      for (final String commandName : catalog.getCommandNames()) {
        final Command command = catalog.getCommand(commandName);
        Assert.notNull(command);
        final CommandKey commandKey = new CommandKey(catalog.getName(), commandName);
        cmdMap.put(commandKey, command);
        log.info("registered CommandKey: {}", commandKey);
      }
    }
    catalogs = null; // no longer needed
View Full Code Here


  private Resources createWadlResources(final String catalogName) {
    final Resources resources = new Resources();
    resources.setBase(String.format("%s/command-service/%s/", applicationHttpUrlBase, catalogName));
    final CommandCatalog catalog = commandService.getCommandCatalog(catalogName);
    for (final String commandName : catalog.getCommandNames()) {
      final WebRequestCommand<?, ?> command = (WebRequestCommand<?, ?>) commandService.getCommand(new CommandKey(catalogName, commandName));
      resources.getResource().add(command.createCommandResourceWadl());

      if (command.hasXmlSchema()) {
        final Resource resource = new Resource();
        resource.setPath(commandName + ".xsd");
View Full Code Here

    }
    return new WebCommandContext<>(request, response);
  }

  private void generateCommandXSD(final String target, final HttpServletResponse response) throws IOException {
    final CommandKey commandKey = targetUriCommandKeyMap.get(toCommandUriTarget(target));
    final CommandCatalog catalog = commandService.getCommandCatalog(commandKey.getCatalogName());
    @SuppressWarnings("rawtypes")
    final WebRequestCommand command = (WebRequestCommand) catalog.getCommand(commandKey.getCommandName());
    if (!command.hasXmlSchema()) {
      response.setStatus(HttpStatus.NO_CONTENT_204);
      return;
    }
    response.setStatus(HttpStatus.OK_200);
View Full Code Here

      final String[] commandNames = catalog.getCommandNames();
      for (final String command : commandNames) {
        final Command cmd = catalog.getCommand(command);
        if (cmd instanceof WebRequestCommand) {
          final String uri = String.format("/command-service/%s/%s", catalogName, command);
          final CommandKey key = new CommandKey(catalogName, command);
          map.put(uri, key);
          log.info("WebRequestCommand uri: {}", uri);
        }
      }
    }
View Full Code Here

  }

  @SuppressWarnings("rawtypes")
  @Override
  protected void process(final String target, final Request baseRequest, final HttpServletRequest request, final HttpServletResponse response) {
    final CommandKey commandKey = targetUriCommandKeyMap.get(target);
    final WebRequestCommand command = (WebRequestCommand) commandService.getCommand(commandKey);
    final WebCommandContext<?, ?> commandContext;
    try {
      commandContext = createWebCommandContext(command, baseRequest, request, response);
    } catch (JAXBException | IOException e) {
View Full Code Here

      catMap.put(catalog.getName(), catalog);

      for (String commandName : catalog.getCommandNames()) {
        final Command command = catalog.getCommand(commandName);
        Assert.notNull(command);
        cmdMap.put(new CommandKey(catalog.getName(), commandName), command);
      }
    }
    catalogs = null; // no longer needed

    this.commandCatalogs = ImmutableMap.<String, CommandCatalog> builder().putAll(catMap).build();
View Full Code Here

TOP

Related Classes of com.azaptree.services.command.CommandKey

Copyright © 2018 www.massapicom. 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.