Session getSession() {
        if (sessionType == SessionType.client) {
            return XMPPServer.getInstance().getRoutingTable().getClientRoute(address);
        }
        else if (sessionType == SessionType.component) {
            return SessionManager.getInstance().getComponentSession(address.getDomain());
        }
        else if (sessionType == SessionType.connectionManager) {
            return SessionManager.getInstance().getConnectionMultiplexerSession(address);
        }
        else if (sessionType == SessionType.outgoingServer) {
            Log.error("Trying to write raw data to a server session across the cluster: " + address.toString());
            return null;
        }
        else if (sessionType == SessionType.incomingServer) {
            return SessionManager.getInstance().getIncomingServerSession(streamID);
        }
        Log.error("Found unknown session type: " + sessionType);
        return null;
    }
Cluster task that will ask a remote cluster node to deliver some raw text to a local session.

@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/session/DeliverRawTextTask.java