@Override
    public IQ handleIQ(IQ packet) throws PacketException {
        if (IQ.Type.get == packet.getType()) {
            // Could cache this information for every server we see
            Element answerElement = bodyElement.createCopy();
            try {
                // Try to retrieve this for every request - security settings
                // might be changed runtime!
                final String os = System.getProperty("os.name") + ' ' 
                        + System.getProperty("os.version") + " ("
                        + System.getProperty("os.arch") + ')';
                final String java = "Java " + System.getProperty("java.version");
                answerElement.addElement("os").setText(os + " - " + java);
            } catch (SecurityException ex) {
                // Security settings don't allow the OS to be read. We'll honor
                // this and simply not report it.
            }
            IQ result = IQ.createResultIQ(packet);
            result.setChildElement(answerElement);
            return result;
        } else if (IQ.Type.set == packet.getType()) {
            // Answer an not-acceptable error since IQ should be of type GET
            IQ result = IQ.createResultIQ(packet);
            result.setError(PacketError.Condition.not_acceptable);
            return result;
        } else if (IQ.Type.result == packet.getType()) {
            /* handle results coming through BOSH Connections,
             * other results are processed in org.jivesoftware.openfire.net.SocketRead.java - getIQ()
             */
            LocalSession localSession = (LocalSession) XMPPServer.getInstance().getSessionManager().getSession(packet.getFrom());

            Element query = packet.getChildElement();
            List<Element> elements = query.elements();
            if (!elements.isEmpty()) {
                for (Element element : elements) {
                    if (element.getName() != null && element.getStringValue() != null) {
                        if (localSession!=null)
                        {
                            localSession.setSoftwareVersionData(element.getName(), element.getStringValue());
                        }
                        else
                        {
                            /*
                              The result comes from a server 2 server connection, so we write the information
                              only to the debug log, because we dont need it at this point.
                            */
                            Log.debug("XEP-0092 Packet from={} {}={}",packet.getFrom(),element.getName(),element.getStringValue());
                        }
                    }
                }
            }

            return null;
        }
        // Ignore any other type of packet
        return null;
    }
Implements the TYPE_IQ jabber:iq:version protocol (version info). Allows
XMPP entities to query each other's application versions.  The server
will respond with its current version info.

@author Iain Shigeoka
xmppserver/src/main/java/org/jivesoftware/openfire/handler/IQVersionHandler.java