Package com.dianping.cat.configuration.app.entity

Examples of com.dianping.cat.configuration.app.entity.Command


    case APP_LIST:
      generateCommandsForModel(model);
      break;
    case APP_UPDATE:
      id = payload.getId();
      Command command = m_appConfigManager.getConfig().findCommand(id);

      if (command == null) {
        command = new Command();
      }
      model.setUpdateCommand(command);
      break;
    case APP_SUBMIT:
      id = payload.getId();
View Full Code Here


  public static String CONNECT_TYPE = "连接类型";

  public static final String ACTIVITY_PREFIX = "http://tgapp.dianping.com/activity/";

  public Pair<Boolean, Integer> addCommand(String domain, String title, String name) throws Exception {
    Command command = new Command();

    command.setDomain(domain);
    command.setTitle(title);
    command.setName(name);

    boolean isActivityCommand = name.startsWith(ACTIVITY_PREFIX);
    int commandId;
    if (isActivityCommand) {
      commandId = findAvailableId(1000, 1500);
    } else {
      commandId = findAvailableId(1, 200);
    }
    command.setId(commandId);

    m_config.addCommand(command);
    return new Pair<Boolean, Integer>(storeConfig(), commandId);
  }
View Full Code Here

    m_config.addCommand(command);
    return new Pair<Boolean, Integer>(storeConfig(), commandId);
  }

  public boolean updateCommand(int id, String domain, String name, String title) {
    Command command = m_config.findCommand(id);

    command.setDomain(domain);
    command.setName(name);
    command.setTitle(title);
    return storeConfig();
  }
View Full Code Here

      return false;
    }
  }

  public Map<Integer, Code> queryCodeByCommand(int command) {
    Command c = m_config.findCommand(command);

    if (c != null) {
      Map<Integer, Code> values = c.getCodes();
      Map<Integer, Code> result = new HashMap<Integer, Code>(values);

      result.putAll(m_config.getCodes());
      return result;
    } else {
View Full Code Here

    return title;
  }

  private String queryCommand(int command) {
    Map<Integer, Command> commands = m_appConfigManager.getRawCommands();
    Command value = commands.get(command);

    if (value != null) {
      return value.getName();
    } else {
      throw new RuntimeException("Error config in command code: " + command);
    }
  }
View Full Code Here

  private String queryDomainByCommand(String command) {
    Map<Integer, Command> commands = m_appConfigManager.getRawCommands();
    String domain = "";

    for (Entry<Integer, Command> entry : commands.entrySet()) {
      Command commandObj = entry.getValue();

      if (commandObj.getName().equals(command)) {
        domain = commandObj.getDomain();
      }
    }
    return domain;
  }
View Full Code Here

TOP

Related Classes of com.dianping.cat.configuration.app.entity.Command

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.