|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cocoon.servletservice.AbstractServletConnection
Nested Class Summary | |
protected static class |
AbstractServletConnection.NoServletContextAvailableException
A special exception indicating that there is no servlet context available. |
Field Summary | |
protected boolean |
connected
If already connected |
protected ServletContext |
context
The current block context |
protected Log |
logger
By default we use the logger for this class. |
protected ServletServiceRequest |
request
Connection request |
protected ByteArrayOutputStream |
requestBody
|
protected ServletServiceResponse |
response
Connection response |
protected InputStream |
responseBody
|
protected URI |
uri
|
Constructor Summary | |
AbstractServletConnection()
|
Method Summary | |
void |
connect()
Connect to the servlet service. |
String |
getContentType()
Get the mime-type of the servlet-service. |
String |
getHeaderField(String name)
|
long |
getHeaderFieldDate(String name,
long defaultValue)
|
InputStream |
getInputStream()
Return an InputStream object to read from the source. |
long |
getLastModified()
Get the last modification date of the servlet service. |
OutputStream |
getOutputStream()
Returns an output stream that writes as POST to this connection. |
int |
getResponseCode()
|
URI |
getURI()
Get a URI representing this servlet connection. |
protected abstract void |
performConnect()
Access the servlet and fill the response object. |
void |
setIfModifiedSince(long ifmodifiedsince)
Set the last modification date if you want to make use of caching. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final Log logger
protected ServletServiceRequest request
protected ServletServiceResponse response
protected ServletContext context
protected boolean connected
protected ByteArrayOutputStream requestBody
protected InputStream responseBody
protected URI uri
Constructor Detail |
public AbstractServletConnection()
Method Detail |
public void connect() throws IOException, ServletException
ServletConnection
connect
in interface ServletConnection
ServletException
- Any other problem when connecting to a servlet service.
IOException
- The connection to the servlet service can't be established.protected abstract void performConnect() throws ServletException, IOException
ServletException
IOException
public InputStream getInputStream() throws IOException, ServletException
InputStream
object to read from the source.
getInputStream
in interface ServletConnection
IOException
ServletException
public void setIfModifiedSince(long ifmodifiedsince)
ServletConnection
setIfModifiedSince
in interface ServletConnection
ifmodifiedsince
- The timestamp of the last known resource.public long getLastModified()
ServletConnection
getLastModified
in interface ServletConnection
public String getContentType()
ServletConnection
getContentType
in interface ServletConnection
public long getHeaderFieldDate(String name, long defaultValue)
public String getHeaderField(String name)
public int getResponseCode() throws IOException
getResponseCode
in interface ServletConnection
IOException
public OutputStream getOutputStream() throws IllegalStateException
getOutputStream
in interface ServletConnection
IllegalStateException
- - if already connectedpublic URI getURI()
ServletConnection
getURI
in interface ServletConnection
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |