|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.server.AbstractCommunicationManager
@Deprecated public abstract class AbstractCommunicationManager
This is a common base class for the server-side implementations of the
communication system between the client code (compiled with GWT into
JavaScript) and the server side components. Its client side counterpart is
com.vaadin.client.ApplicationConnection.
TODO Document better!
| Nested Class Summary | |
|---|---|
static interface |
AbstractCommunicationManager.Callback
Deprecated. As of 7.0. Will likely change or be removed in a future version |
protected class |
AbstractCommunicationManager.InvalidUIDLSecurityKeyException
Deprecated. |
static class |
AbstractCommunicationManager.SimpleMultiPartInputStream
Deprecated. Stream that extracts content from another stream until the boundary string is encountered. |
| Field Summary | |
|---|---|
static char |
VAR_BURST_SEPARATOR
Deprecated. |
static char |
VAR_ESCAPE_CHARACTER
Deprecated. |
| Constructor Summary | |
|---|---|
AbstractCommunicationManager(VaadinSession session)
Deprecated. TODO New constructor - document me! |
|
| Method Summary | |
|---|---|
protected void |
changeVariables(java.lang.Object source,
VariableOwner owner,
java.util.Map<java.lang.String,java.lang.Object> m)
Deprecated. |
void |
cleanStreamVariable(ClientConnector owner,
java.lang.String name)
Deprecated. |
protected void |
closeJsonMessage(java.io.PrintWriter outWriter)
Deprecated. |
protected abstract BootstrapHandler |
createBootstrapHandler()
Deprecated. As of 7.0. Will likely change or be removed in a future version |
protected void |
doHandleSimpleMultipartFileUpload(VaadinRequest request,
VaadinResponse response,
StreamVariable streamVariable,
java.lang.String variableName,
ClientConnector owner,
java.lang.String boundary)
Deprecated. Method used to stream content from a multipart request (either from servlet or portlet request) to given StreamVariable |
protected void |
doHandleXhrFilePost(VaadinRequest request,
VaadinResponse response,
StreamVariable streamVariable,
java.lang.String variableName,
ClientConnector owner,
int contentLength)
Deprecated. Used to stream plain file post (aka XHR2.post(File)) |
static org.json.JSONObject |
encodeState(ClientConnector connector,
com.vaadin.shared.communication.SharedState state)
Deprecated. |
protected ClientConnector |
getConnector(UI uI,
java.lang.String connectorId)
Deprecated. |
protected java.lang.String |
getInitialUIDL(VaadinRequest request,
UI uI)
Deprecated. Generates the initial UIDL message that can e.g. |
protected java.lang.String |
getRequestPayload(VaadinRequest request)
Deprecated. Reads the request data from the Request and returns it converted to an UTF-8 string. |
protected java.lang.String |
getSecurityKey(VaadinRequest request)
Deprecated. Gets the security key (and generates one if needed). |
java.lang.String |
getSecurityKeyUIDL(VaadinRequest request)
Deprecated. Gets the security key (and generates one if needed) as UIDL. |
protected VaadinSession |
getSession()
Deprecated. |
java.lang.String |
getStreamVariableTargetUrl(ClientConnector owner,
java.lang.String name,
StreamVariable value)
Deprecated. |
protected abstract java.io.InputStream |
getThemeResourceAsStream(UI uI,
java.lang.String themeName,
java.lang.String resource)
Deprecated. |
void |
handleBrowserDetailsRequest(VaadinRequest request,
VaadinResponse response,
VaadinSession session)
Deprecated. |
boolean |
handleBurst(VaadinRequest source,
UI uI,
java.lang.String burst)
Deprecated. Processes a message burst received from the client. |
void |
handleFileUpload(VaadinSession session,
VaadinRequest request,
VaadinResponse response)
Deprecated. Handles file upload request submitted via Upload component. |
void |
handleHeartbeatRequest(VaadinRequest request,
VaadinResponse response,
VaadinSession session)
Deprecated. Handles a heartbeat request. |
protected boolean |
handleOtherRequest(VaadinRequest request,
VaadinResponse response)
Deprecated. Handles a request by passing it to each registered RequestHandler
in turn until one produces a response. |
void |
handleUidlRequest(VaadinRequest request,
VaadinResponse response,
AbstractCommunicationManager.Callback callback,
UI uI)
Deprecated. Internally process a UIDL request from the client. |
protected void |
highlightConnector(ClientConnector highlightedConnector)
Deprecated. |
static boolean |
isComponentVisibleToClient(Component child)
Deprecated. Checks if the component should be visible to the client. |
static boolean |
isConnectorVisibleToClient(ClientConnector connector)
Deprecated. Checks if the connector is visible in context. |
boolean |
isXSRFEnabled(VaadinSession session)
Deprecated. Returns false if the cross site request forgery protection is turned off. |
protected void |
openJsonMessage(java.io.PrintWriter outWriter,
VaadinResponse response)
Deprecated. Writes the opening of JSON message to be sent to client. |
protected void |
postPaint(UI uI)
Deprecated. Method called after the paint phase while still being synchronized on the session |
protected void |
printHighlightedConnectorHierarchy(java.lang.StringBuilder sb,
ClientConnector connector)
Deprecated. |
void |
requireLocale(java.lang.String value)
Deprecated. Queues a locale to be sent to the client (browser) for date and time entry etc. |
protected void |
sendUploadResponse(VaadinRequest request,
VaadinResponse response)
Deprecated. TODO document |
void |
servePublishedFile(VaadinRequest request,
VaadinResponse response)
Deprecated. Serve a connector resource from the classpath if the resource has previously been registered by calling registerPublishedFile(String, Class). |
protected boolean |
streamToReceiver(java.io.InputStream in,
StreamVariable streamVariable,
java.lang.String filename,
java.lang.String type,
int contentLength)
Deprecated. |
protected java.lang.String |
unescapeBurst(java.lang.String encodedValue)
Deprecated. Unescape encoded burst separator characters in a burst received from the client. |
void |
writeUidlResponse(VaadinRequest request,
boolean repaintAll,
java.io.PrintWriter outWriter,
UI ui,
boolean analyzeLayouts)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final char VAR_BURST_SEPARATOR
public static final char VAR_ESCAPE_CHARACTER
| Constructor Detail |
|---|
public AbstractCommunicationManager(VaadinSession session)
session - | Method Detail |
|---|
protected VaadinSession getSession()
protected void doHandleSimpleMultipartFileUpload(VaadinRequest request,
VaadinResponse response,
StreamVariable streamVariable,
java.lang.String variableName,
ClientConnector owner,
java.lang.String boundary)
throws java.io.IOException
request - response - streamVariable - owner - boundary -
java.io.IOException
protected void doHandleXhrFilePost(VaadinRequest request,
VaadinResponse response,
StreamVariable streamVariable,
java.lang.String variableName,
ClientConnector owner,
int contentLength)
throws java.io.IOException
request - response - streamVariable - owner - contentLength -
java.io.IOException
protected final boolean streamToReceiver(java.io.InputStream in,
StreamVariable streamVariable,
java.lang.String filename,
java.lang.String type,
int contentLength)
throws UploadException
in - streamVariable - filename - type - contentLength -
UploadException
protected void sendUploadResponse(VaadinRequest request,
VaadinResponse response)
throws java.io.IOException
request - response -
java.io.IOException
public void handleUidlRequest(VaadinRequest request,
VaadinResponse response,
AbstractCommunicationManager.Callback callback,
UI uI)
throws java.io.IOException,
AbstractCommunicationManager.InvalidUIDLSecurityKeyException,
org.json.JSONException
handleVariables(VaadinRequest, VaadinResponse, Callback, VaadinSession, UI)
to process any changes to variables by the client and then repaints
affected components using #paintAfterVariableChanges().
Also, some cleanup is done when a request arrives for an session that has
already been closed.
The method handleUidlRequest(...) in subclasses should call this method.
TODO better documentation
request - response - callback - uI - target window for the UIDL request, can be null if target not
found
java.io.IOException
AbstractCommunicationManager.InvalidUIDLSecurityKeyException
org.json.JSONExceptionprotected void postPaint(UI uI)
uI - protected void highlightConnector(ClientConnector highlightedConnector)
protected void printHighlightedConnectorHierarchy(java.lang.StringBuilder sb,
ClientConnector connector)
public java.lang.String getSecurityKeyUIDL(VaadinRequest request)
request -
protected java.lang.String getSecurityKey(VaadinRequest request)
request -
public void writeUidlResponse(VaadinRequest request,
boolean repaintAll,
java.io.PrintWriter outWriter,
UI ui,
boolean analyzeLayouts)
throws PaintException,
org.json.JSONException
PaintException
org.json.JSONException
public static org.json.JSONObject encodeState(ClientConnector connector,
com.vaadin.shared.communication.SharedState state)
throws org.json.JSONException
org.json.JSONExceptionpublic static boolean isConnectorVisibleToClient(ClientConnector connector)
isComponentVisibleToClient(Component) is used. For other types
of connectors, the contextual visibility of its first Component ancestor
is used. If no Component ancestor is found, the connector is not visible.
connector - The connector to check
true if the connector is visible to the client,
false otherwisepublic static boolean isComponentVisibleToClient(Component child)
child - The child to check
protected abstract java.io.InputStream getThemeResourceAsStream(UI uI,
java.lang.String themeName,
java.lang.String resource)
public boolean isXSRFEnabled(VaadinSession session)
session -
public boolean handleBurst(VaadinRequest source,
UI uI,
java.lang.String burst)
source - uI - the UI receiving the burstburst - the content of the burst as a String to be parsed
protected void changeVariables(java.lang.Object source,
VariableOwner owner,
java.util.Map<java.lang.String,java.lang.Object> m)
protected ClientConnector getConnector(UI uI,
java.lang.String connectorId)
protected java.lang.String getRequestPayload(VaadinRequest request)
throws java.io.IOException
request -
java.io.IOExceptionprotected java.lang.String unescapeBurst(java.lang.String encodedValue)
encodedValue - to decode
protected void closeJsonMessage(java.io.PrintWriter outWriter)
protected void openJsonMessage(java.io.PrintWriter outWriter,
VaadinResponse response)
outWriter - response - public void requireLocale(java.lang.String value)
Locale instances and sent to the client when needed, eliminating
the need to use the Locale class and all the framework behind it
on the client.
value - Locale.toString()
public java.lang.String getStreamVariableTargetUrl(ClientConnector owner,
java.lang.String name,
StreamVariable value)
public void cleanStreamVariable(ClientConnector owner,
java.lang.String name)
@Deprecated protected abstract BootstrapHandler createBootstrapHandler()
protected boolean handleOtherRequest(VaadinRequest request,
VaadinResponse response)
throws java.io.IOException
RequestHandler
in turn until one produces a response. This method is used for requests
that have not been handled by any specific functionality in the terminal
implementation (e.g. VaadinServlet).
The request handlers are invoked in the revere order in which they were added to the session until a response has been produced. This means that the most recently added handler is used first and the first request handler that was added to the session is invoked towards the end unless any previous handler has already produced a response.
request - the Vaadin request to get information fromresponse - the response to which data can be written
true if a RequestHandler has
produced a response and false if no response has
been written.
java.io.IOException - if a handler throws an exceptionVaadinSession.addRequestHandler(RequestHandler),
RequestHandler
public void handleBrowserDetailsRequest(VaadinRequest request,
VaadinResponse response,
VaadinSession session)
throws java.io.IOException
java.io.IOException
protected java.lang.String getInitialUIDL(VaadinRequest request,
UI uI)
throws PaintException,
org.json.JSONException
request - the request that caused the initializationuI - the UI for which the UIDL should be generated
PaintException - if an exception occurs while painting
org.json.JSONException - if an exception occurs while encoding output
public void servePublishedFile(VaadinRequest request,
VaadinResponse response)
throws java.io.IOException
registerPublishedFile(String, Class). Sending arbitrary files
from the classpath is prevented by only accepting resource names that
have explicitly been registered. Resources can currently only be
registered by including a JavaScript or StyleSheet
annotation on a Connector class.
request - response -
java.io.IOException
public void handleFileUpload(VaadinSession session,
VaadinRequest request,
VaadinResponse response)
throws java.io.IOException,
AbstractCommunicationManager.InvalidUIDLSecurityKeyException
UI - The UI for this requestrequest - response -
java.io.IOException
AbstractCommunicationManager.InvalidUIDLSecurityKeyException#getStreamVariableTargetUrl(ReceiverOwner, String, StreamVariable)
public void handleHeartbeatRequest(VaadinRequest request,
VaadinResponse response,
VaadinSession session)
throws java.io.IOException
request - response - session -
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||