class IQVersionHandler extends IQHandler implements ServerFeaturesProvider {

    private static Element bodyElement;
    private IQHandlerInfo info;

    private static final Logger Log = LoggerFactory.getLogger(IQVersionHandler.class);

    public IQVersionHandler() {
        super("XMPP Server Version Handler");
        info = new IQHandlerInfo("query", "jabber:iq:version");
        if (bodyElement == null) {
            bodyElement = DocumentHelper.createElement(QName.get("query", "jabber:iq:version"));
            bodyElement.addElement("name").setText(AdminConsole.getAppName());
            bodyElement.addElement("version").setText(AdminConsole.getVersionString());
        }
    }

    @Override
    public IQ handleIQ(IQ packet) throws PacketException {<FILL_FUNCTION_BODY>}

    @Override
    public IQHandlerInfo getInfo() {
        return info;
    }

    @Override
    public Iterator<String> getFeatures() {
        return Collections.singleton("jabber:iq:version").iterator();
    }
}

        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.size() > 0) {
                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;
    
<methods>public void <init>(java.lang.String) ,public abstract org.jivesoftware.openfire.IQHandlerInfo getInfo() ,public abstract IQ handleIQ(IQ) throws org.jivesoftware.openfire.auth.UnauthorizedException,public void initialize(org.jivesoftware.openfire.XMPPServer) ,public boolean performNoSuchUserCheck() ,public void process(Packet) throws org.jivesoftware.openfire.PacketException<variables>private static final Logger Log,protected org.jivesoftware.openfire.PacketDeliverer deliverer,protected org.jivesoftware.openfire.SessionManager sessionManager