Java Doc for PortletConnection.java in  » EJB-Server-resin-3.1.5 » resin » com » caucho » portal » generic » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server resin 3.1.5 » resin » com.caucho.portal.generic 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.caucho.portal.generic.PortletConnection

All known Subclasses:   com.caucho.portal.generic.HttpPortletConnection,
PortletConnection
abstract public class PortletConnection (Code)
A PortletConnection is used to obtain Action and Render objects. For implementations that support only one portlet for each connection, the pattern of use is:
 Window window = ...;
 Portlet portlet = ...; 
 Action action = connection.getAction(window);
 if (action != null) {
 try {
 if (action.isTarget()) 
 action.processAction(portlet);
 } 
 finally { 
 action.finish(); 
 } 
 }
 Render render = connection.getRender(window);
 if (render != null) {
 try {
 render.render(portlet);
 } 
 finally { 
 render.finish(); 
 } 
 }
 
For implementations that support more than one portlet for each connection, each portlet is identified with a namespace. An optional Renderer is specified, it is used to obtain a Writer or OutputStream when the portlet requests it.
 Window window = ...;
 Portlet portlet = ...; 
 String namespace = "..."; 
 Action action = connection.getAction(window, namespace);
 if (action != null) {
 try {
 if (action.isTarget()) 
 action.processAction(portlet);
 } 
 finally { 
 action.finish(); 
 } 
 }
 Render render = connection.getRender(window, namespace);
 if (render != null) {
 try {
 render.render(portlet);
 } 
 finally { 
 render.finish(); 
 } 
 }
 

See Also:   PortletConnection.getAction
See Also:   PortletConnection.getRender
See Also:   Action
See Also:   Render


Field Summary
final public static  StringPORTLET_CONNECTION
    
final public static  Loggerlog
    

Constructor Summary
protected  PortletConnection()
    

Method Summary
abstract public  voidaddProperty(String name, String value)
     Add a value to a property to be returned to the client.
abstract public  booleancanGuaranteeConfidentiality()
     Return true if the connection can guarantee confidentiality (preventing reading while in transit).
abstract public  booleancanGuaranteeIntegrity()
     Return true if the connection can guarantee integrity (preventing data tampering in the communication process).
public  voidcheckForFailure()
     Throw an exception if an error was encountered when using this conneciton.
abstract public  StringencodeURL(String path)
     Encode a url with any special encoding needed by the protocol, for example by adding a sesison id.
public  voidfinish()
    
abstract public  voidflushBuffer()
    
public static  ActiongetAction(PortletRequest portletRequest)
     Return the Action that corresponds to the PortletRequest, or null if there is not a current Action or Connection.
public  ActiongetAction(Window window, String namespace)
     Get an Action for a namespace.
abstract public  ObjectgetAttribute(String name)
     Get an attribute for the current connection.
abstract public  EnumerationgetAttributeNames()
     Get a list of all attributes for the current connection.
abstract public  StringgetAuthType()
     Return the authentication scheme used for the current request.
abstract public  intgetBufferSize()
    
abstract public  StringgetCharacterEncoding()
    
abstract public  Set<String>getClientCharacterEncodings()
     Get the character encodings acceptable to the client.
abstract public  Set<String>getClientContentTypes()
     Get the content types acceptable to the client.
abstract public  Set<Locale>getClientLocales()
     Get the locales acceptable to the client.
public static  PortletConnectiongetConnection(PortletRequest portletRequest)
    
abstract public  StringgetContentType()
     Return the content type established with setContentType(), or null if setContentType() has not been called.
abstract public  StringgetContextPath()
     Return the path to the portal portion of the url that was used to make the request.
public  ActiongetCurrentAction()
     Get the current Action object, established from a call to getRender().
public  RendergetCurrentRender()
     Get the current Render object, established from a call to getRender().
protected  intgetExpirationCache()
     Used in derived classes during finish() to determine the maximum expires time for the connection, derived classes use this value to send an expires timeout to the client.
public  StringgetId()
    
abstract public  LocalegetLocale()
     Return the Locale established with setLocale(), or null if setLocale() has not been called.
abstract public  OutputStreamgetOutputStream()
    
public static  PortalgetPortal(PortletRequest portletRequest)
     Return the Portal that corresponds to the PortletRequest, or null if there is not a current Portal or Connection.
public  PortalgetPortal()
    
abstract public  PortletSessiongetPortletSession(boolean create)
     Return a PortletSession 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.
abstract public  EnumerationgetProperties(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.
abstract public  StringgetProperty(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.
abstract public  EnumerationgetPropertyNames()
     Return the names of available properties for the connection.
abstract public  StringgetRemoteUser()
     Return the identity of the remote user, null if the identity has not been established.
public static  RendergetRender(PortletRequest portletRequest)
     Return the Render that corresponds to the PortletRequest, or null if there is not a current Render or Connection.
public  RendergetRender(Window window, String namespace)
     Get a Render for a namespace.
abstract public  StringgetRequestedSessionId()
     Return the session id that was supplied by the client for the current request.
abstract public  StringgetScheme()
     Return the scheme portion of the url that was used to make the request.
abstract public  StringgetServerName()
     Return the host name portion of the url that was used to make the request.
abstract public  intgetServerPort()
     Return the port portion of the url that was used to make the request.
abstract public  StringgetSubmitCharacterEncoding()
     Return the name of the character encoding that will be used by the Reader obtained using PortletConnection.getReader , null if none.
abstract public  intgetSubmitContentLength()
     Return the length of of the data supplied as the "body" of the request, -1 if not known.
abstract public  StringgetSubmitContentType()
     Return the MIME type of the data supplied as the "body" of the request, null if not known.
abstract public  InputStreamgetSubmitInputStream()
     Return the binary body of the current request.
abstract public  BufferedReadergetSubmitReader()
    
abstract public  PrincipalgetUserPrincipal()
     Return a java.security.Principal that contains the identity of the remote user, null if the identity has not been established.
abstract public  PrintWritergetWriter()
    
abstract public  booleanhandleConstraintFailure(Constraint constraint, int failureCode)
     Handle a constraint failure by sending some response to the client. false if the connection cannot handle the constraint failure.
abstract public  booleanhandleException(Exception exception)
     Handle an exception by sending some response to the client. false if the connection cannot handle the constraint failure.
abstract public  booleanisCommitted()
    
public  booleanisConnectionFailed()
     A connection fails if an unrecoverable error occurs.
protected  booleanisPrivate()
    
abstract public  booleanisRequestedSessionIdValid()
     Return true the session id that was supplied by the client for the current request is valid.
abstract public  booleanisSecure()
     Return true if the connection for the current request is secure, for example it uses HTTPS.
abstract public  booleanisUserInRole(String role)
     Return true if the identity of remote user has been established and the user has been assigned the role.
abstract public  voidremoveAttribute(String name)
     Remove an attribute for the current connection.
abstract public  voidreset()
    
abstract public  voidresetBuffer()
    
abstract public  StringresolveURL(String partialUrl)
    
abstract public  StringresolveURL(String partialUrl, boolean isSecure)
     Resolve a url so that it makes a request to the portal with the specified level of security.
abstract public  voidsendRedirect(String location)
    
abstract public  voidsetAttribute(String name, Object o)
     Set an attribute for the current connection.
abstract public  voidsetBufferSize(int size)
    
abstract public  voidsetCharacterEncoding(String enc)
    
public  voidsetConnectionFailed()
     Used to indicate that the connection has failed.
public  voidsetConnectionFailed(Exception ex)
     Used to indicate that the connection has failed.
abstract public  voidsetContentType(String contentType)
     Set the content type to use for the response.
abstract public  voidsetLocale(Locale locale)
     Set the locale to use for the response.
abstract public  voidsetProperty(String name, String value)
     Set a property to be returned to the client.
abstract public  voidsetSubmitCharacterEncoding(String enc)
     Override the character encoding used by the Reader obtained using PortletConnection.getReader .
public  voidstart(Portal portal, InvocationFactory invocationFactory)
    

Field Detail
PORTLET_CONNECTION
final public static String PORTLET_CONNECTION(Code)
Name of the request attribute that stores the connection



log
final public static Logger log(Code)




Constructor Detail
PortletConnection
protected PortletConnection()(Code)




Method Detail
addProperty
abstract public void addProperty(String name, String value)(Code)
Add a value to a property to be returned to the client. "properties" correspond to HTTP headers in the response for HTTP connections.
See Also:   javax.portlet.PortletResponse.addProperty



canGuaranteeConfidentiality
abstract public boolean canGuaranteeConfidentiality()(Code)
Return true if the connection can guarantee confidentiality (preventing reading while in transit).



canGuaranteeIntegrity
abstract public boolean canGuaranteeIntegrity()(Code)
Return true if the connection can guarantee integrity (preventing data tampering in the communication process).



checkForFailure
public void checkForFailure() throws PortletException(Code)
Throw an exception if an error was encountered when using this conneciton.



encodeURL
abstract public String encodeURL(String path)(Code)
Encode a url with any special encoding needed by the protocol, for example by adding a sesison id.



finish
public void finish()(Code)



flushBuffer
abstract public void flushBuffer() throws IOException(Code)



getAction
public static Action getAction(PortletRequest portletRequest)(Code)
Return the Action that corresponds to the PortletRequest, or null if there is not a current Action or Connection.



getAction
public Action getAction(Window window, String namespace) throws PortletException, IOException(Code)
Get an Action for a namespace. Return null if the action stage for the request is complete or there is some other reason that the window and it's children should not proceed further in the action stage.
throws:
  PortletException - if the namespace has already been seen in theactionstagephase of this connection



getAttribute
abstract public Object getAttribute(String name)(Code)
Get an attribute for the current connection. Attributes are name/value pairs that are valid for the duration of one connection.



getAttributeNames
abstract public Enumeration getAttributeNames()(Code)
Get a list of all attributes for the current connection. Attributes are name/value pairs that are valid for the duration of one connection. an Enumeration of String



getAuthType
abstract public String getAuthType()(Code)
Return the authentication scheme used for the current request. PortletRequest.BASIC_AUTH, PortletRequest.CLIENT_CERT_AUTH,PortletRequest.DIGEST_AUTH, PortletRequest.FORM_AUTH, or a custom method.
See Also:   javax.portlet.PortletRequest.getAuthType



getBufferSize
abstract public int getBufferSize()(Code)



getCharacterEncoding
abstract public String getCharacterEncoding()(Code)



getClientCharacterEncodings
abstract public Set<String> getClientCharacterEncodings()(Code)
Get the character encodings acceptable to the client. The returned Set is order, the most preferrable character encoding appears before the least preferred. A return of null or an empty Set indicates that the client character encodings cannot be determiend, and is treated as an indication that any locale is acceptable.



getClientContentTypes
abstract public Set<String> getClientContentTypes()(Code)
Get the content types acceptable to the client. The returned Set is ordered, the most preferrable content types appear before the least preferred. A return of null or an empty Set indicates that the client content types cannot be determiend, and is treated as an indication that any locale is acceptable.



getClientLocales
abstract public Set<Locale> getClientLocales()(Code)
Get the locales acceptable to the client. The returned Set is ordered, the most preferrable locale appears before the least preferred. If the client supports all locales, then a Locale("","","") will be present in the returned Set. A return of null or an empty Set indicates that the client locales cannot be determiend, and is treated as an indication that any locale is acceptable.



getConnection
public static PortletConnection getConnection(PortletRequest portletRequest)(Code)
Return the connection that corresponds to the PortletRequest



getContentType
abstract public String getContentType()(Code)
Return the content type established with setContentType(), or null if setContentType() has not been called.



getContextPath
abstract public String getContextPath()(Code)
Return the path to the portal portion of the url that was used to make the request.
See Also:   javax.portlet.PortletRequest.getContextPath



getCurrentAction
public Action getCurrentAction()(Code)
Get the current Action object, established from a call to getRender().



getCurrentRender
public Render getCurrentRender()(Code)
Get the current Render object, established from a call to getRender().



getExpirationCache
protected int getExpirationCache()(Code)
Used in derived classes during finish() to determine the maximum expires time for the connection, derived classes use this value to send an expires timeout to the client. -1 means never expire, 0 means expire immediately, otherwise it is a number in seconds.



getId
public String getId()(Code)
A unique identifier for this connection object, used for debugging



getLocale
abstract public Locale getLocale()(Code)
Return the Locale established with setLocale(), or null if setLocale() has not been called.



getOutputStream
abstract public OutputStream getOutputStream() throws IOException(Code)

throws:
  IllegalStatementException - if the content type has not been setwith setContentType.



getPortal
public static Portal getPortal(PortletRequest portletRequest)(Code)
Return the Portal that corresponds to the PortletRequest, or null if there is not a current Portal or Connection.



getPortal
public Portal getPortal()(Code)



getPortletSession
abstract public PortletSession getPortletSession(boolean create)(Code)
Return a PortletSession 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. create, if true create a new session if one does not already existfor the client.



getProperties
abstract public Enumeration getProperties(String propertyName)(Code)
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. "properties" correspond to HTTP headers in the request for HTTP connections. an Enumeration of String
See Also:   javax.portlet.PortletRequest.getProperties



getProperty
abstract public String getProperty(String propertyName)(Code)
Return the value of the specified connection property as a String, null if the property was not provided by the request from the client. "properties" correspond to HTTP headers in the request for HTTP connections.
See Also:   javax.portlet.PortletRequest.getProperty



getPropertyNames
abstract public Enumeration getPropertyNames()(Code)
Return the names of available properties for the connection. "properties" correspond to HTTP headers in the request for HTTP connections. an Enumeration of String
See Also:   javax.portlet.PortletRequest.getPropertyNames



getRemoteUser
abstract public String getRemoteUser()(Code)
Return the identity of the remote user, null if the identity has not been established.
See Also:   javax.portlet.PortletRequest.getRemoteUser



getRender
public static Render getRender(PortletRequest portletRequest)(Code)
Return the Render that corresponds to the PortletRequest, or null if there is not a current Render or Connection.



getRender
public Render getRender(Window window, String namespace) throws PortletException, IOException(Code)
Get a Render for a namespace. Return null if there is some reason that the window and it's children should not be rendered.
throws:
  PortletException - if the namespace has already been seen in therender phase of this connection



getRequestedSessionId
abstract public String getRequestedSessionId()(Code)
Return the session id that was supplied by the client for the current request.
See Also:   javax.portlet.PortletRequest.getRequestedSessionId



getScheme
abstract public String getScheme()(Code)
Return the scheme portion of the url that was used to make the request.
See Also:   javax.portlet.PortletRequest.getScheme



getServerName
abstract public String getServerName()(Code)
Return the host name portion of the url that was used to make the request.
See Also:   javax.portlet.PortletRequest.getServerName



getServerPort
abstract public int getServerPort()(Code)
Return the port portion of the url that was used to make the request.
See Also:   javax.portlet.PortletRequest.getServerPort



getSubmitCharacterEncoding
abstract public String getSubmitCharacterEncoding()(Code)
Return the name of the character encoding that will be used by the Reader obtained using PortletConnection.getReader , null if none.
See Also:   javax.portlet.ActionRequest.getCharacterEncoding



getSubmitContentLength
abstract public int getSubmitContentLength()(Code)
Return the length of of the data supplied as the "body" of the request, -1 if not known.
See Also:   javax.portlet.ActionRequest.getContentLength



getSubmitContentType
abstract public String getSubmitContentType()(Code)
Return the MIME type of the data supplied as the "body" of the request, null if not known.
See Also:   javax.portlet.ActionRequest.getContentType



getSubmitInputStream
abstract public InputStream getSubmitInputStream() throws IOException, IllegalStateException(Code)
Return the binary body of the current request.
throws:
  IllegalStateException - if getReader() has already beencalled for this connection.
throws:
  IOException -
See Also:   javax.portlet.ActionRequest.getPortletInputStream



getSubmitReader
abstract public BufferedReader getSubmitReader() throws UnsupportedEncodingException, IOException(Code)



getUserPrincipal
abstract public Principal getUserPrincipal()(Code)
Return a java.security.Principal that contains the identity of the remote user, null if the identity has not been established.
See Also:   javax.portlet.PortletRequest.getUserPrincipal



getWriter
abstract public PrintWriter getWriter() throws IOException(Code)

throws:
  IllegalStatementException - if the content type has not been setwith setContentType.



handleConstraintFailure
abstract public boolean handleConstraintFailure(Constraint constraint, int failureCode) throws IOException(Code)
Handle a constraint failure by sending some response to the client. false if the connection cannot handle the constraint failure.



handleException
abstract public boolean handleException(Exception exception)(Code)
Handle an exception by sending some response to the client. false if the connection cannot handle the constraint failure.



isCommitted
abstract public boolean isCommitted()(Code)



isConnectionFailed
public boolean isConnectionFailed()(Code)
A connection fails if an unrecoverable error occurs.



isPrivate
protected boolean isPrivate()(Code)
Used in derived classes during finish() to determine if the response is private



isRequestedSessionIdValid
abstract public boolean isRequestedSessionIdValid()(Code)
Return true the session id that was supplied by the client for the current request is valid.
See Also:   javax.portlet.PortletRequest.isRequestedSessionIdValid



isSecure
abstract public boolean isSecure()(Code)
Return true if the connection for the current request is secure, for example it uses HTTPS.
See Also:   javax.portlet.PortletRequest.isSecure



isUserInRole
abstract public boolean isUserInRole(String role)(Code)
Return true if the identity of remote user has been established and the user has been assigned the role.
See Also:   javax.portlet.PortletRequest.isUserInRole



removeAttribute
abstract public void removeAttribute(String name)(Code)
Remove an attribute for the current connection. Attributes are name/value pairs that are valid for the duration of one connection.



reset
abstract public void reset()(Code)



resetBuffer
abstract public void resetBuffer()(Code)



resolveURL
abstract public String resolveURL(String partialUrl)(Code)
Resolve a url so that it makes a request to the portal



resolveURL
abstract public String resolveURL(String partialUrl, boolean isSecure) throws PortletSecurityException(Code)
Resolve a url so that it makes a request to the portal with the specified level of security.



sendRedirect
abstract public void sendRedirect(String location) throws IllegalStateException, IOException(Code)



setAttribute
abstract public void setAttribute(String name, Object o)(Code)
Set an attribute for the current connection. Attributes are name/value pairs that are valid for the duration of one connection.



setBufferSize
abstract public void setBufferSize(int size)(Code)



setCharacterEncoding
abstract public void setCharacterEncoding(String enc) throws UnsupportedEncodingException(Code)



setConnectionFailed
public void setConnectionFailed()(Code)
Used to indicate that the connection has failed. A connection fails if an unrecoverable error occurs.



setConnectionFailed
public void setConnectionFailed(Exception ex)(Code)
Used to indicate that the connection has failed. A connection fails if an unrecoverable error occurs.



setContentType
abstract public void setContentType(String contentType)(Code)
Set the content type to use for the response.



setLocale
abstract public void setLocale(Locale locale)(Code)
Set the locale to use for the response.



setProperty
abstract public void setProperty(String name, String value)(Code)
Set a property to be returned to the client. "properties" correspond to HTTP headers in the response for HTTP connections.
See Also:   javax.portlet.PortletResponse.setProperty



setSubmitCharacterEncoding
abstract public void setSubmitCharacterEncoding(String enc) throws UnsupportedEncodingException, IllegalStateException(Code)
Override the character encoding used by the Reader obtained using PortletConnection.getReader . This method must be called prior to reading input using PortletConnection.getReader or PortletConnection.getPortletInputStream .
throws:
  UnsupportedEncodingException -
throws:
  IllegalStateException - if getReader() has already been called forthis connection.
See Also:   javax.portlet.ActionRequest.setCharacterEncoding



start
public void start(Portal portal, InvocationFactory invocationFactory)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.