class ClientSessionTask extends RemoteSessionTask {

    private static Logger logger = LoggerFactory.getLogger(ClientSessionTask.class);

    private JID address;
    private transient Session session;

    public ClientSessionTask() {
        super();
    }

    public ClientSessionTask(JID address, Operation operation) {
        super(operation);
        this.address = address;
    }

    Session getSession() {
        if (session == null) {
            session = XMPPServer.getInstance().getRoutingTable().getClientRoute(address);
        }
        return session;
    }

    public void run() {<FILL_FUNCTION_BODY>}

    public void writeExternal(ObjectOutput out) throws IOException {
        super.writeExternal(out);
        ExternalizableUtil.getInstance().writeSerializable(out, address);
    }

    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        super.readExternal(in);
        address = (JID) ExternalizableUtil.getInstance().readSerializable(in);
    }

    public String toString() {
        return super.toString() + " operation: " + operation + " address: " + address;
    }
}

        if (getSession() == null || getSession().isClosed()) {
            logger.error("Session not found for JID: " + address);
            return;
        }
        super.run();

        ClientSession session = (ClientSession) getSession();
        if (session instanceof RemoteClientSession) {
            // The session is being hosted by other cluster node so log this unexpected case
            Cache<String, ClientRoute> usersCache = CacheFactory.createCache(RoutingTableImpl.C2S_CACHE_NAME);
            ClientRoute route = usersCache.get(address.toString());
            byte[] nodeIDByte = route != null ? route.getNodeID().toByteArray() : new byte[0];

            logger.warn("Found remote session instead of local session. JID: {} found in Node: {} and local node is: {}",
                address, nodeIDByte, XMPPServer.getInstance().getNodeID().toByteArray());
        }
        if (operation == Operation.isInitialized) {
            if (session instanceof RemoteClientSession) {
                // Something is wrong since the session should be local instead of remote
                // Assume some default value
                result = true;
            }
            else {
                result = session.isInitialized();
            }
        }
        else if (operation == Operation.incrementConflictCount) {
            if (session instanceof RemoteClientSession) {
                // Something is wrong since the session should be local instead of remote
                // Assume some default value
                result = 2;
            }
            else {
                result = session.incrementConflictCount();
            }
        }
        else if (operation == Operation.hasRequestedBlocklist) {
            if (session instanceof RemoteClientSession) {
                // Something is wrong since the session should be local instead of remote
                // Assume some default value
                result = false;
            }
            else {
                result = session.hasRequestedBlocklist();
            }
        }
    
<methods>public void <init>() ,public java.lang.Object getResult() ,public void readExternal(java.io.ObjectInput) throws java.io.IOException, java.lang.ClassNotFoundException,public void run() ,public void writeExternal(java.io.ObjectOutput) throws java.io.IOException<variables>private static final Logger Log,protected org.jivesoftware.openfire.session.RemoteSessionTask.Operation operation,protected java.lang.Object result