示例#1
0
  public void addAgent() {
    try {
      CfgAgentGroupQuery qAgentGroups = new CfgAgentGroupQuery();
      qAgentGroups.setName("EmptyGroup");
      CfgAgentGroup group = confService.retrieveObject(CfgAgentGroup.class, qAgentGroups);
      List<CfgPerson> agents = (List<CfgPerson>) group.getAgents();
      CfgPersonQuery qAgent = new CfgPersonQuery();
      qAgent.setEmployeeId("Developer001");

      CfgPerson agent = confService.retrieveObject(CfgPerson.class, qAgent);

      agents.add(agent);
      group.save();
    } catch (ConfigException e) {
      e.printStackTrace();
    }
  }
示例#2
0
  public void getAgent() {
    List<Agent> allAgent = new ArrayList<Agent>();
    try {
      CfgPersonQuery personQuery = new CfgPersonQuery();
      CfgAgentGroup group = confService.retrieveObject(CfgAgentGroup.class, personQuery);

      List<CfgPerson> agents = (List<CfgPerson>) group.getAgents();
      for (CfgPerson cfgPerson : agents) {
        Agent agent = new Agent();
        agent.setAgentAlias(cfgPerson.getFirstName());
        agent.setAgentName(cfgPerson.getLastName());
        agent.setAgentNo(cfgPerson.getEmployeeID());
        allAgent.add(agent);
      }
    } catch (ConfigException e) {
      e.printStackTrace();
    }
  }
示例#3
0
  public List<String> getGroups() {

    List<CfgAgentGroup> groups = null;
    List<String> groupID = new ArrayList<String>();
    StringBuffer buffer = new StringBuffer();
    try {
      CfgAgentGroupQuery groupQuery = new CfgAgentGroupQuery();
      groups =
          (List<CfgAgentGroup>)
              confService.retrieveMultipleObjects(CfgAgentGroup.class, groupQuery);
      for (CfgAgentGroup group : groups) {
        log.debug("[CFGGROUP]");
        if (null != group.getGroupInfo().getName() && !"".equals(group.getGroupInfo().getName())) {
          groupID.add(group.getGroupInfo().getName());
        }
      }
    } catch (ConfigException e) {
      e.printStackTrace();
    } catch (InterruptedException ex) {
      log.error("[ERROR]=" + ex.getMessage());
    }

    return groupID;
  }