Package org.jivesoftware.xmpp.workgroup

Examples of org.jivesoftware.xmpp.workgroup.Agent


            try {
                // See if they are a user in the system.
                UserManager.getInstance().getUser(usernameToken);
                usernameToken += ("@" + ComponentManagerFactory.getComponentManager().getServerName());
                JID address = new JID(usernameToken.trim());
                Agent agent;

                if (agentManager.hasAgent(address)) {
                    agent = agentManager.getAgent(address);
                }
                else {
View Full Code Here


        IQ reply = IQ.createResultIQ(packet);
        Element iq = packet.getChildElement();
        String name = iq.getName();

        boolean isPersonal = iq.element("personal") != null;
        Agent agent;
        try {
            agent = workgroup.getAgentManager().getAgent(packet.getFrom());
        }
        catch (AgentNotFoundException e) {
            sendItemNotFound(packet, workgroup);
            return;
        }


        if ("macros".equals(name) && !isPersonal) {
            Element globalMacros = reply.setChildElement("macros", "http://jivesoftware.com/protocol/workgroup");
            DbProperties props = workgroup.getProperties();
            String macroModel = props.getProperty("jive.macro" + workgroup.getID());
            if (ModelUtil.hasLength(macroModel)) {
                globalMacros.addElement("model").setText(macroModel);
            }
            else {
                sendItemNotFound(packet, workgroup);
                return;
            }
        }
        else if (isPersonal) {
            Element personalMacros = reply.setChildElement("macros", "http://jivesoftware.com/protocol/workgroup");
            DbProperties props = agent.getProperties();
            String macroModel = props.getProperty("personal.macro");
            if (ModelUtil.hasLength(macroModel)) {
                personalMacros.addElement("model").setText(macroModel);
            }
            else {
View Full Code Here

        Element iq = packet.getChildElement();

        String personalMacro = iq.element("personalMacro").getTextTrim();
        try {
            // Verify that an agent is requesting this information.
            Agent agent = workgroup.getAgentManager().getAgent(packet.getFrom());

            DbProperties props = agent.getProperties();
            XStream xstream = new XStream();
            xstream.alias("macro", Macro.class);
            xstream.alias("macrogroup", MacroGroup.class);
            MacroGroup group = (MacroGroup)xstream.fromXML(personalMacro);
View Full Code Here

TOP

Related Classes of org.jivesoftware.xmpp.workgroup.Agent

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.