|
||||||||||
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. might be refactored or removed before 7.0.0 |
class |
AbstractCommunicationManager.ErrorHandlerErrorEvent
Deprecated. |
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. might be refactored or removed before 7.0.0 |
protected void |
doHandleSimpleMultipartFileUpload(WrappedRequest request,
WrappedResponse 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(WrappedRequest request,
WrappedResponse 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(WrappedRequest request,
UI uI)
Deprecated. Generates the initial UIDL message that can e.g. |
protected java.lang.String |
getRequestPayload(WrappedRequest request)
Deprecated. Reads the request data from the Request and returns it converted to an UTF-8 string. |
protected java.lang.String |
getSecurityKey(WrappedRequest request)
Deprecated. Gets the security key (and generates one if needed). |
java.lang.String |
getSecurityKeyUIDL(WrappedRequest request)
Deprecated. Gets the security key (and generates one if needed) as UIDL. |
StreamVariable |
getStreamVariable(java.lang.String connectorId,
java.lang.String variableName)
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. |
protected VaadinSession |
getVaadinSession()
Deprecated. |
protected boolean |
handleApplicationRequest(WrappedRequest request,
WrappedResponse response)
Deprecated. Handles a request by passing it to each registered RequestHandler
in turn until one produces a response. |
void |
handleBrowserDetailsRequest(WrappedRequest request,
WrappedResponse response,
VaadinSession session)
Deprecated. |
boolean |
handleBurst(WrappedRequest source,
UI uI,
java.lang.String burst)
Deprecated. Processes a message burst received from the client. |
void |
handleFileUpload(VaadinSession session,
WrappedRequest request,
WrappedResponse response)
Deprecated. Handles file upload request submitted via Upload component. |
void |
handleHeartbeatRequest(WrappedRequest request,
WrappedResponse response,
VaadinSession session)
Deprecated. Handles a heartbeat request. |
void |
handleUidlRequest(WrappedRequest request,
WrappedResponse response,
AbstractCommunicationManager.Callback callback,
UI uI)
Deprecated. Internally process a UIDL request from the client. |
protected void |
highlightConnector(com.vaadin.shared.Connector highlightedConnector)
Deprecated. |
static boolean |
isVisible(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,
WrappedResponse 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 |
printHighlightedComponentHierarchy(java.lang.StringBuilder sb,
AbstractComponent component)
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(WrappedRequest request,
WrappedResponse response)
Deprecated. TODO document |
void |
serveConnectorResource(WrappedRequest request,
WrappedResponse response)
Deprecated. Serve a connector resource from the classpath if the resource has previously been registered by calling registerResource(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(WrappedRequest 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 getVaadinSession()
protected void doHandleSimpleMultipartFileUpload(WrappedRequest request, WrappedResponse 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(WrappedRequest request, WrappedResponse 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(WrappedRequest request, WrappedResponse response) throws java.io.IOException
request
- response
-
java.io.IOException
public void handleUidlRequest(WrappedRequest request, WrappedResponse response, AbstractCommunicationManager.Callback callback, UI uI) throws java.io.IOException, AbstractCommunicationManager.InvalidUIDLSecurityKeyException, org.json.JSONException
handleVariables(WrappedRequest, WrappedResponse, 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.JSONException
protected void postPaint(UI uI)
uI
- protected void highlightConnector(com.vaadin.shared.Connector highlightedConnector)
protected void printHighlightedComponentHierarchy(java.lang.StringBuilder sb, AbstractComponent component)
public java.lang.String getSecurityKeyUIDL(WrappedRequest request)
request
-
protected java.lang.String getSecurityKey(WrappedRequest request)
request
-
public void writeUidlResponse(WrappedRequest 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.JSONException
public static boolean isVisible(ClientConnector connector)
isVisible(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
otherwiseprotected abstract java.io.InputStream getThemeResourceAsStream(UI uI, java.lang.String themeName, java.lang.String resource)
public boolean isXSRFEnabled(VaadinSession session)
session
-
public boolean handleBurst(WrappedRequest 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(WrappedRequest request) throws java.io.IOException
request
-
java.io.IOException
protected 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, WrappedResponse 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 handleApplicationRequest(WrappedRequest request, WrappedResponse 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 wrapped 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(WrappedRequest request, WrappedResponse response, VaadinSession session) throws java.io.IOException
java.io.IOException
protected java.lang.String getInitialUIDL(WrappedRequest 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 outputpublic void serveConnectorResource(WrappedRequest request, WrappedResponse response) throws java.io.IOException
registerResource(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, WrappedRequest request, WrappedResponse 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(WrappedRequest request, WrappedResponse response, VaadinSession session) throws java.io.IOException
request
- response
- session
-
java.io.IOException
public StreamVariable getStreamVariable(java.lang.String connectorId, java.lang.String variableName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |