PhoneUser user = phoneManager.getByUsername(node);
PhoneUser user = phoneManager.getPhoneUserByUsername(node);
    public void handleDisco(IQ iq) {        if (iq.getType().equals(IQ.Type.error)) {            Log.info("Received disco error - "+iq);            return;        }        if (!(iq.getType() == IQ.Type.get || iq.getType() == IQ.Type.set)) {            Log.debug("Not set or get - "+iq);            return;        }        // if information was sent to the component itself        if(plugin.getComponentJID().equals(iq.getTo())) {            //try to see if there is a node on the query            Element child = iq.getChildElement();            String node = child.attributeValue("node");            // category - directory (since searching is possible)            // type - phone            // features            // var - http://jabber.org/protocol/disco#info            // var - jabber:iq:version            IQ reply = IQ.createResultIQ(iq);            reply.setType(IQ.Type.result);            reply.setChildElement(iq.getChildElement().createCopy());            Element queryElement = reply.getChildElement();            // Create and add the identity            Element identity = queryElement.addElement("identity");            identity.addAttribute("category", "directory");            identity.addAttribute("type", "phone");            identity.addAttribute("name", "phone");            // Create and add a the feature provided by the workgroup            // Create and add a the disco#info feature            Element feature = queryElement.addElement("feature");            feature.addAttribute("var", "http://jabber.org/protocol/disco#info");            if(node == null) {                // Indicate that we can provide information about the software version being used                feature = queryElement.addElement("feature");                feature.addAttribute("var", "jabber:iq:version");            } else {                // This is a query against a specific user                PhoneManager phoneManager = null;                try {                    phoneManager = PhoneManagerFactory.getPhoneManager();                    PhoneUser user = phoneManager.getByUsername(node);                    // if there is a user they have support                    if(user != null) {                        // var http://jivesoftware.com/phone                        feature = queryElement.addElement("feature");                        feature.addAttribute("var", "http://jivesoftware.com/phone");                    }                }                catch (Exception e) {                    log.log(Level.SEVERE, e.getMessage(), e);                }                finally {                    PhoneManagerFactory.close(phoneManager);                }            }            send(reply);        } else {            // todo implement        }    }