|
|||||||||
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 multi-session management of WebDAV clients. This class saves and restores the requested 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()
|
Method Summary | |
void |
authenticate()
Authenticate. |
void |
closeSession(org.apache.commons.httpclient.HttpClient client)
Close an session and delete the connection information. |
void |
connect()
Connect. |
void |
disconnect()
Disconnect. |
boolean |
error(int status,
java.lang.Exception e)
Unexpected error. |
java.util.Enumeration |
findSessions(java.lang.String partOfAuthority)
Find the sessions having the part of the authority string. |
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. |
java.util.Enumeration |
getSessions()
Get all session information. |
boolean |
info(int status,
java.util.Hashtable headers)
Recieved an informational status code. |
boolean |
isSession(org.apache.util.HttpURL httpURL)
Test a session to be connected. |
boolean |
isSession(java.lang.String authority)
Test a session to be connected. |
void |
recievedExpectation()
Recieved expectation. |
void |
recievedResponse()
Recieved response. |
void |
requiredAuthentication()
Authenticate. |
boolean |
retry(int status)
Retry. |
void |
sentRequest()
Sent request. |
void |
setDebug(int debug)
Set debug level. |
protected void |
setSession(org.apache.commons.httpclient.HttpClient client)
Set the session by the given client. |
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
- protected void setSession(org.apache.commons.httpclient.HttpClient client) throws java.io.IOException
client
- The Http client instance.java.io.IOException
- public boolean isSession(org.apache.util.HttpURL httpURL) throws java.net.MalformedURLException
httpURL
- The http URL to connect. only used the authority part.java.net.MalformedURLException
- public boolean isSession(java.lang.String authority)
authority
- The authority string.public java.util.Enumeration findSessions(java.lang.String partOfAuthority)
partOfAuthority
can be user or host part.partOfAuthority
- The part of the authority string.public java.util.Enumeration getSessions()
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
public void recievedResponse()
recievedResponse
in interface org.apache.commons.httpclient.ConnectionInterceptor
public void recievedExpectation()
recievedExpectation
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 |