class IQMessageCarbonsHandler extends IQHandler implements ServerFeaturesProvider {

    private static final String NAMESPACE = "urn:xmpp:carbons:2";

    private IQHandlerInfo info;

    public IQMessageCarbonsHandler() {
        super("XEP-0280: Message Carbons");
        info = new IQHandlerInfo("", NAMESPACE);
    }

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

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

    @Override
    public Iterator<String> getFeatures() {
        return Collections.singleton(NAMESPACE).iterator();
    }
}

        Element enable = packet.getChildElement();
        if (XMPPServer.getInstance().isLocal(packet.getFrom())) {
            if (enable.getName().equals("enable")) {
                ClientSession clientSession = sessionManager.getSession(packet.getFrom());
                clientSession.setMessageCarbonsEnabled(true);
                return IQ.createResultIQ(packet);

            } else if (enable.getName().equals("disable")) {
                ClientSession clientSession = sessionManager.getSession(packet.getFrom());
                clientSession.setMessageCarbonsEnabled(false);
                return IQ.createResultIQ(packet);
            } else {
                IQ error = IQ.createResultIQ(packet);
                error.setError(PacketError.Condition.bad_request);
                return error;
            }
        } else {
            // if the request is from a client that is not hosted on this server.
            IQ error = IQ.createResultIQ(packet);
            error.setError(PacketError.Condition.not_allowed);
            return error;
        }
    
<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