/**
* $RCSfile: $
* $Revision: $
* $Date: $
*
* Copyright (C) 2006 Jive Software. All rights reserved.
* This software is the proprietary information of Jive Software. Use is subject to license terms.
*/
package org.jivesoftware.multiplexer.net.http;
import org.jivesoftware.multiplexer.*;
import org.dom4j.Element;
import java.util.Queue;
import java.util.LinkedList;
/**
*
*/
public class HttpSession extends Session {
private int wait;
private int hold;
private String language;
private final Queue<HttpConnection> connectionQueue = new LinkedList<HttpConnection>();
private String stanza;
public HttpSession(String serverName, String streamID) {
super(serverName, null, streamID);
}
void addConnection(HttpConnection connection) {
connection.setSession(this);
connectionQueue.offer(connection);
}
public String getAvailableStreamFeatures() {
return null;
}
public void close() {
}
public void close(boolean isServerShuttingDown) {
}
public synchronized void deliver(Element stanza) {
this.stanza = stanza.asXML();
}
/**
* This attribute specifies the longest time (in seconds) that the connection manager is allowed
* to wait before responding to any request during the session. This enables the client to
* prevent its TCP connection from expiring due to inactivity, as well as to limit the delay
* before it discovers any network failure.
*
* @param wait the longest time it is permissible to wait for a response.
*/
public void setWait(int wait) {
this.wait = wait;
}
/**
* This attribute specifies the longest time (in seconds) that the connection manager is allowed
* to wait before responding to any request during the session. This enables the client to
* prevent its TCP connection from expiring due to inactivity, as well as to limit the delay
* before it discovers any network failure.
*
* @return the longest time it is permissible to wait for a response.
*/
public int getWait() {
return wait;
}
/**
* This attribute specifies the maximum number of requests the connection manager is allowed
* to keep waiting at any one time during the session. (For example, if a constrained client
* is unable to keep open more than two HTTP connections to the same HTTP server simultaneously,
* then it SHOULD specify a value of "1".)
*
* @param hold the maximum number of simultaneous waiting requests.
*
*/
public void setHold(int hold) {
this.hold = hold;
}
/**
* This attribute specifies the maximum number of requests the connection manager is allowed
* to keep waiting at any one time during the session. (For example, if a constrained client
* is unable to keep open more than two HTTP connections to the same HTTP server simultaneously,
* then it SHOULD specify a value of "1".)
*
* @return the maximum number of simultaneous waiting requests
*/
public int getHold() {
return hold;
}
public void setLanaguage(String language) {
this.language = language;
}
}