|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.webdav.lib.WebdavSession
This WebdavSession class is for the session management of WebDAV clients. This class saves and restores the requested client. Although this class is thread safe, it should only be accessed by one concurrent thread, since the underlying protocol, HTTP, is not multiplexed. If simultaneous operations are needed, it is recommended to create additional threads, each having its own associated WebDAV client. Clients that use persistent connections SHOULD limit the number of simultaneous connections that they maintain to a given server. A single-user client SHOULD NOT maintain more than 2 connections with any server or proxy. A proxy SHOULD use up to 2*N connections to another server or proxy, where N is the number of simultaneously active users. These guidelines are intended to improve HTTP response times and avoid congestion.
Field Summary | |
protected org.apache.commons.httpclient.HttpClient |
client
The Http client instance. |
protected int |
debug
Debug level. |
Constructor Summary | |
WebdavSession()
Default constructor. |
Method Summary | |
void |
authenticate()
Authenticate. |
void |
closeSession()
Close an session and delete the connection information. |
void |
closeSession(org.apache.commons.httpclient.HttpClient client)
Deprecated. Replaced by closeSession() |
void |
connect()
Connect. |
void |
disconnect()
Disconnect. |
boolean |
error(int status,
java.lang.Exception e)
Unexpected error. |
org.apache.commons.httpclient.HttpClient |
getSessionInstance(org.apache.util.HttpURL httpURL)
Get a HttpClient instance. |
org.apache.commons.httpclient.HttpClient |
getSessionInstance(org.apache.util.HttpURL httpURL,
boolean reset)
Get a HttpClient instance. |
boolean |
info(int status,
java.util.Hashtable headers)
Recieved an informational status code. |
void |
receivedExpectation()
Received expectation. |
void |
receivedResponse()
Received response. |
void |
requiredAuthentication()
Authenticate. |
boolean |
retry(int status)
Retry. |
void |
sentRequest()
Sent request. |
void |
setDebug(int debug)
Set debug level. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected org.apache.commons.httpclient.HttpClient client
protected int debug
Constructor Detail |
public WebdavSession()
Method Detail |
public void setDebug(int debug)
public org.apache.commons.httpclient.HttpClient getSessionInstance(org.apache.util.HttpURL httpURL) throws java.io.IOException
HttpClient
instance.
This method returns a new client instance for the first time.
And it is saved util it's closed or reset.httpURL
- The http URL to connect. only used the authority part.HttpClient
.java.io.IOException
- public org.apache.commons.httpclient.HttpClient getSessionInstance(org.apache.util.HttpURL httpURL, boolean reset) throws java.io.IOException
HttpClient
instance.
This method returns a new client instance, when reset is true.httpURL
- The http URL to connect. only used the authority part.reset
- The reset flag to represent whether the saved information
is used or not.HttpClient
.java.io.IOException
- public void closeSession() throws java.io.IOException
client
- The HttpClient instance.java.io.IOException
- Error in closing socket.public void closeSession(org.apache.commons.httpclient.HttpClient client) throws java.io.IOException
client
- The HttpClient instance.java.io.IOException
- Error in closing socket.public void connect()
connect
in interface org.apache.commons.httpclient.ConnectionInterceptor
public void disconnect()
disconnect
in interface org.apache.commons.httpclient.ConnectionInterceptor
public boolean retry(int status)
retry
in interface org.apache.commons.httpclient.ConnectionInterceptor
public boolean info(int status, java.util.Hashtable headers)
info
in interface org.apache.commons.httpclient.ConnectionInterceptor
public boolean error(int status, java.lang.Exception e)
error
in interface org.apache.commons.httpclient.ConnectionInterceptor
status
- Status code; can be equal to -1 if status code is not
knowne
- Underlying exception; can be nullpublic void sentRequest()
sentRequest
in interface org.apache.commons.httpclient.ConnectionInterceptor
org.apache.commons.httpclient.ConnectionInterceptor
requestLine
- Request line sentheaders
- Headers sentpublic void receivedResponse()
receivedResponse
in interface org.apache.commons.httpclient.ConnectionInterceptor
org.apache.commons.httpclient.ConnectionInterceptor
responseLine
- Response line recievedheaders
- Headers recievedpublic void receivedExpectation()
receivedExpectation
in interface org.apache.commons.httpclient.ConnectionInterceptor
public void requiredAuthentication()
requiredAuthentication
in interface org.apache.commons.httpclient.ConnectionInterceptor
public void authenticate()
authenticate
in interface org.apache.commons.httpclient.ConnectionInterceptor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |