Package com.azaptree.services.command

Examples of com.azaptree.services.command.CommandCatalog


  @Override
  @ManagedOperation
  @ManagedOperationParameters({ @ManagedOperationParameter(name = "catalogName", description = "Catalog name") })
  public String[] getCommandNames(final String catalogName) {
    Assert.hasText(catalogName, "catalogName is required");
    final CommandCatalog catalog = getCommandCatalog(catalogName);
    return catalog.getCommandNames();
  }
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();
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

  private void init() {
    final Map<String, CommandKey> map = new HashMap<>();

    final String[] catalogNames = commandService.getCommandCatalogNames();
    for (final String catalogName : catalogNames) {
      final CommandCatalog catalog = commandService.getCommandCatalog(catalogName);
      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

  @Override
  @ManagedOperation
  @ManagedOperationParameters({ @ManagedOperationParameter(name = "catalogName", description = "Catalog name") })
  public String[] getCommandNames(final String catalogName) {
    Assert.hasText(catalogName, "catalogName is required");
    final CommandCatalog catalog = getCommandCatalog(catalogName);
    return catalog.getCommandNames();
  }
View Full Code Here

TOP

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

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.