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(); } }
public String getFolder() { CfgFolder folder = null; try { CfgFolderQuery folderQuery = new CfgFolderQuery(); folderQuery.setName("Persons"); folder = (CfgFolder) confService.retrieveObject(folderQuery); } catch (ConfigException e) { e.printStackTrace(); } if (null != folder) { log.info( "folder name=" + folder.getName() + ",folder description=" + folder.getDescription()); return folder.getName(); } else { return ""; } }
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(); } }