Search in sources :

Example 1 with HttpConnection

use of org.jivesoftware.openfire.http.HttpConnection in project Openfire by igniterealtime.

the class SessionManager method createClientHttpSession.

/**
     * Creates a new <tt>ClientSession</tt> with the specified streamID.
     *
     * @param connection the connection to create the session from.
     * @param id the streamID to use for the new session.
     * @return a newly created session.
     */
public HttpSession createClientHttpSession(long rid, InetAddress address, StreamID id, HttpConnection connection, Locale language) throws UnauthorizedException {
    if (serverName == null) {
        throw new UnauthorizedException("Server not initialized");
    }
    PacketDeliverer backupDeliverer = server.getPacketDeliverer();
    HttpSession session = new HttpSession(backupDeliverer, serverName, address, id, rid, connection, language);
    Connection conn = session.getConnection();
    conn.init(session);
    conn.registerCloseListener(clientSessionListener, session);
    localSessionManager.getPreAuthenticatedSessions().put(session.getAddress().getResource(), session);
    connectionsCounter.incrementAndGet();
    return session;
}
Also used : HttpSession(org.jivesoftware.openfire.http.HttpSession) UnauthorizedException(org.jivesoftware.openfire.auth.UnauthorizedException) HttpConnection(org.jivesoftware.openfire.http.HttpConnection)

Aggregations

UnauthorizedException (org.jivesoftware.openfire.auth.UnauthorizedException)1 HttpConnection (org.jivesoftware.openfire.http.HttpConnection)1 HttpSession (org.jivesoftware.openfire.http.HttpSession)1