|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.portal.generic.PortletConnection
com.caucho.portal.generic.HttpPortletConnection
public class HttpPortletConnection
A connection to an HttpServletRequest and HttpServletResponse.
| Field Summary | |
|---|---|
static java.lang.String |
HTTP_SERVLET_REQUEST
request attribute for the HttpServletRequest |
static java.lang.String |
HTTP_SERVLET_RESPONSE
request attribute for the HttpServletResponse |
| Fields inherited from class com.caucho.portal.generic.PortletConnection |
|---|
log, PORTLET_CONNECTION |
| Constructor Summary | |
|---|---|
HttpPortletConnection()
|
|
| Method Summary | |
|---|---|
void |
addProperty(java.lang.String name,
java.lang.String value)
Add a value to a property to be returned to the client. |
boolean |
canGuaranteeConfidentiality()
Return true if the connection can guarantee confidentiality (preventing reading while in transit). |
boolean |
canGuaranteeIntegrity()
Return true if the connection can guarantee integrity (preventing data tampering in the communication process). |
java.lang.String |
encodeURL(java.lang.String location)
A path with a schem is encoded only. |
void |
finish()
|
void |
flushBuffer()
|
java.lang.Object |
getAttribute(java.lang.String name)
Attributes for the connection are HttpServletRequest attributes. |
java.util.Enumeration |
getAttributeNames()
Attributes for the connection are HttpServletRequest attributes. |
java.lang.String |
getAuthType()
Return the authentication scheme used for the current request. |
int |
getBufferSize()
|
java.lang.String |
getCharacterEncoding()
|
java.util.Set<java.lang.String> |
getClientCharacterEncodings()
Get the character encodings acceptable to the client. |
java.util.Set<java.lang.String> |
getClientContentTypes()
Get the content types acceptable to the client. |
java.util.Set<java.util.Locale> |
getClientLocales()
Get the locales acceptable to the client. |
java.lang.String |
getContentType()
Return the content type established with setContentType(), or null if setContentType() has not been called. |
java.lang.String |
getContextPath()
Return the path to the portal portion of the url that was used to make the request. |
HttpServletRequest |
getHttpRequest()
|
static HttpServletRequest |
getHttpRequest(PortletRequest request)
|
HttpServletResponse |
getHttpResponse()
|
static HttpServletResponse |
getHttpResponse(PortletRequest request)
|
java.util.Locale |
getLocale()
Return the Locale established with setLocale(), or null if setLocale() has not been called. |
java.io.OutputStream |
getOutputStream()
|
PortletSession |
getPortletSession(boolean create)
Return a PortletSession for the current client, or null if one is
not available. |
java.util.Enumeration |
getProperties(java.lang.String propertyName)
Return the values of the specified connection property as an array of Strings, null if the property was not provided by the request from the client. |
java.lang.String |
getProperty(java.lang.String propertyName)
Return the value of the specified connection property as a String, null if the property was not provided by the request from the client. |
java.util.Enumeration |
getPropertyNames()
Return the names of available properties for the connection. |
java.lang.String |
getRemoteUser()
Return the identity of the remote user, null if the identity has not been established. |
java.lang.String |
getRequestedSessionId()
Return the session id that was supplied by the client for the current request. |
java.lang.String |
getScheme()
Return the scheme portion of the url that was used to make the request. |
java.lang.String |
getServerName()
Return the host name portion of the url that was used to make the request. |
int |
getServerPort()
Return the port portion of the url that was used to make the request. |
java.lang.String |
getSubmitCharacterEncoding()
Return the name of the character encoding that will be used by the Reader obtained using #getReader, null if none. |
int |
getSubmitContentLength()
Return the length of of the data supplied as the "body" of the request, -1 if not known. |
java.lang.String |
getSubmitContentType()
Return the MIME type of the data supplied as the "body" of the request, null if not known. |
java.io.InputStream |
getSubmitInputStream()
Return the binary body of the current request. |
java.io.BufferedReader |
getSubmitReader()
|
java.security.Principal |
getUserPrincipal()
Return a Principal that contains the identity of
the remote user, null if the identity has not been established. |
java.io.PrintWriter |
getWriter()
|
boolean |
handleConstraintFailure(Constraint constraint,
int failureCode)
Handle a constraint failure by sending some response to the client. |
boolean |
handleException(java.lang.Exception exception)
Handle an exception by sending some response to the client. |
boolean |
isCommitted()
|
boolean |
isRequestedSessionIdValid()
Return true the session id that was supplied by the client for the current request is valid. |
boolean |
isSecure()
Return true if the connection for the current request is secure, for example it uses HTTPS. |
boolean |
isUserInRole(java.lang.String role)
Return true if the identity of remote user has been established and the user has been assigned the role. |
protected java.lang.String |
makeServletUrl(HttpServletRequest request)
|
void |
removeAttribute(java.lang.String name)
Attributes for the connection are HttpServletRequest attributes. |
void |
reset()
|
void |
resetBuffer()
|
java.lang.String |
resolveURL(java.lang.String url)
Resolve a url so that it makes a request to the portal |
java.lang.String |
resolveURL(java.lang.String url,
boolean secure)
Resolve the url with the given security level and encode it. |
void |
sendRedirect(java.lang.String location)
|
void |
setAttribute(java.lang.String name,
java.lang.Object o)
Attributes for the connection are HttpServletRequest attributes. |
void |
setBufferSize(int size)
|
void |
setCharacterEncoding(java.lang.String enc)
|
void |
setContentType(java.lang.String contentType)
Set the content type to use for the response. |
void |
setLocale(java.util.Locale locale)
Set the locale to use for the response. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Set a property to be returned to the client. |
void |
setSubmitCharacterEncoding(java.lang.String enc)
Override the character encoding used by the Reader obtained using #getReader. |
void |
start(Portal portal,
PortletContext portletContext,
HttpServletRequest httpRequest,
HttpServletResponse httpResponse,
boolean useParameters)
|
void |
start(Portal portal,
PortletContext portletContext,
HttpServletRequest httpRequest,
HttpServletResponse httpResponse,
InvocationFactory invocationFactory)
|
| Methods inherited from class com.caucho.portal.generic.PortletConnection |
|---|
checkForFailure, getAction, getAction, getConnection, getCurrentAction, getCurrentRender, getExpirationCache, getId, getPortal, getPortal, getRender, getRender, isConnectionFailed, isPrivate, setConnectionFailed, setConnectionFailed, start |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String HTTP_SERVLET_REQUEST
public static final java.lang.String HTTP_SERVLET_RESPONSE
| Constructor Detail |
|---|
public HttpPortletConnection()
| Method Detail |
|---|
public static HttpServletRequest getHttpRequest(PortletRequest request)
public static HttpServletResponse getHttpResponse(PortletRequest request)
public void start(Portal portal,
PortletContext portletContext,
HttpServletRequest httpRequest,
HttpServletResponse httpResponse,
boolean useParameters)
public void start(Portal portal,
PortletContext portletContext,
HttpServletRequest httpRequest,
HttpServletResponse httpResponse,
InvocationFactory invocationFactory)
protected java.lang.String makeServletUrl(HttpServletRequest request)
public void finish()
finish in class PortletConnectionpublic HttpServletRequest getHttpRequest()
public HttpServletResponse getHttpResponse()
public java.util.Set<java.lang.String> getClientContentTypes()
getClientContentTypes in class PortletConnectionpublic java.util.Set<java.util.Locale> getClientLocales()
getClientLocales in class PortletConnectionpublic java.util.Set<java.lang.String> getClientCharacterEncodings()
getClientCharacterEncodings in class PortletConnectionpublic java.lang.String resolveURL(java.lang.String url)
PortletConnection
resolveURL in class PortletConnection
public java.lang.String resolveURL(java.lang.String url,
boolean secure)
throws PortletSecurityException
false.
If secure is true, the prefix set with
setSecureUrlPrefix() is prepended.
resolveURL in class PortletConnectionPortletSecurityException - if secure is true but the url
cannot be made secure because setSecureUrlPrefix() has not been called.
public boolean handleConstraintFailure(Constraint constraint,
int failureCode)
throws java.io.IOException
PortletConnection
handleConstraintFailure in class PortletConnectionjava.io.IOExceptionpublic boolean handleException(java.lang.Exception exception)
PortletConnection
handleException in class PortletConnectionpublic boolean canGuaranteeIntegrity()
canGuaranteeIntegrity in class PortletConnectionpublic boolean canGuaranteeConfidentiality()
canGuaranteeConfidentiality in class PortletConnectionpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute in class PortletConnection
public void setAttribute(java.lang.String name,
java.lang.Object o)
setAttribute in class PortletConnectionpublic void removeAttribute(java.lang.String name)
removeAttribute in class PortletConnectionpublic java.util.Enumeration getAttributeNames()
getAttributeNames in class PortletConnectionpublic PortletSession getPortletSession(boolean create)
PortletConnectionPortletSession for the current client, or null if one is
not available.
A PortletSession once established will be consistently returned for a
client on subsequent requests. Different clients will never have the same
PortletSession.
getPortletSession in class PortletConnectionpublic java.lang.String getScheme()
PortletConnection
getScheme in class PortletConnectionjavax.portlet.PortletRequest#getSchemepublic java.lang.String getServerName()
PortletConnection
getServerName in class PortletConnectionjavax.portlet.PortletRequest#getServerNamepublic int getServerPort()
PortletConnection
getServerPort in class PortletConnectionjavax.portlet.PortletRequest#getServerPortpublic java.lang.String getContextPath()
PortletConnection
getContextPath in class PortletConnectionjavax.portlet.PortletRequest#getContextPathpublic java.lang.String getAuthType()
PortletConnection
getAuthType in class PortletConnectionjavax.portlet.PortletRequest#getAuthTypepublic boolean isSecure()
PortletConnection
isSecure in class PortletConnectionjavax.portlet.PortletRequest#isSecurepublic java.lang.String getRequestedSessionId()
PortletConnection
getRequestedSessionId in class PortletConnectionjavax.portlet.PortletRequest#getRequestedSessionIdpublic boolean isRequestedSessionIdValid()
PortletConnection
isRequestedSessionIdValid in class PortletConnectionjavax.portlet.PortletRequest#isRequestedSessionIdValidpublic java.lang.String getRemoteUser()
PortletConnection
getRemoteUser in class PortletConnectionjavax.portlet.PortletRequest#getRemoteUserpublic java.security.Principal getUserPrincipal()
PortletConnectionPrincipal that contains the identity of
the remote user, null if the identity has not been established.
getUserPrincipal in class PortletConnectionjavax.portlet.PortletRequest#getUserPrincipalpublic boolean isUserInRole(java.lang.String role)
PortletConnection
isUserInRole in class PortletConnectionjavax.portlet.PortletRequest#isUserInRolepublic java.lang.String getProperty(java.lang.String propertyName)
PortletConnection
getProperty in class PortletConnectionjavax.portlet.PortletRequest#getPropertypublic java.util.Enumeration getProperties(java.lang.String propertyName)
PortletConnection
getProperties in class PortletConnectionjavax.portlet.PortletRequest#getPropertiespublic java.util.Enumeration getPropertyNames()
PortletConnection
getPropertyNames in class PortletConnectionjavax.portlet.PortletRequest#getPropertyNamespublic java.lang.String getSubmitContentType()
PortletConnection
getSubmitContentType in class PortletConnectionjavax.portlet.ActionRequest#getContentTypepublic int getSubmitContentLength()
PortletConnection
getSubmitContentLength in class PortletConnectionjavax.portlet.ActionRequest#getContentLength
public java.io.InputStream getSubmitInputStream()
throws java.io.IOException
PortletConnection
getSubmitInputStream in class PortletConnectionjava.io.IOExceptionjavax.portlet.ActionRequest#getPortletInputStream
public void setSubmitCharacterEncoding(java.lang.String enc)
throws java.io.UnsupportedEncodingException,
java.lang.IllegalStateException
PortletConnection#getReader. This method must be called prior to reading
input using #getReader or #getPortletInputStream.
setSubmitCharacterEncoding in class PortletConnectionjava.io.UnsupportedEncodingException
java.lang.IllegalStateException - if getReader() has already been called for
this connection.javax.portlet.ActionRequest#setCharacterEncodingpublic java.lang.String getSubmitCharacterEncoding()
PortletConnection#getReader, null if none.
getSubmitCharacterEncoding in class PortletConnectionjavax.portlet.ActionRequest#getCharacterEncoding
public java.io.BufferedReader getSubmitReader()
throws java.io.UnsupportedEncodingException,
java.io.IOException
getSubmitReader in class PortletConnectionjava.io.UnsupportedEncodingException
java.io.IOExceptionpublic java.lang.String encodeURL(java.lang.String location)
encodeURL in class PortletConnection
public void sendRedirect(java.lang.String location)
throws java.io.IOException
sendRedirect in class PortletConnectionjava.io.IOException
public void setProperty(java.lang.String name,
java.lang.String value)
PortletConnection
setProperty in class PortletConnectionjavax.portlet.PortletResponse#setProperty
public void addProperty(java.lang.String name,
java.lang.String value)
PortletConnection
addProperty in class PortletConnectionjavax.portlet.PortletResponse#addPropertypublic void setContentType(java.lang.String contentType)
PortletConnection
setContentType in class PortletConnectionpublic java.lang.String getContentType()
getContentType in class PortletConnectionpublic void setLocale(java.util.Locale locale)
PortletConnection
setLocale in class PortletConnectionpublic java.util.Locale getLocale()
getLocale in class PortletConnectionpublic void setBufferSize(int size)
setBufferSize in class PortletConnectionpublic int getBufferSize()
getBufferSize in class PortletConnection
public void flushBuffer()
throws java.io.IOException
flushBuffer in class PortletConnectionjava.io.IOExceptionpublic void resetBuffer()
resetBuffer in class PortletConnectionpublic void reset()
reset in class PortletConnectionpublic boolean isCommitted()
isCommitted in class PortletConnection
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class PortletConnectionjava.io.IOExceptionpublic java.lang.String getCharacterEncoding()
getCharacterEncoding in class PortletConnection
public void setCharacterEncoding(java.lang.String enc)
throws java.io.UnsupportedEncodingException
setCharacterEncoding in class PortletConnectionjava.io.UnsupportedEncodingException
public java.io.PrintWriter getWriter()
throws java.io.IOException
getWriter in class PortletConnectionjava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||