org.zkoss.zk.au
Class AuRequest

java.lang.Object
  extended by org.zkoss.zk.au.AuRequest

public class AuRequest
extends java.lang.Object

A request sent from the client to the server.

Author:
tomyeh

Field Summary
static int BUSY_IGNORE
          Indicates whether it can be ignored by the server when the server receives the same requests consecutively.
static int DUPLICATE_IGNORE
          Indicates whether it can be ignored by the server when the server receives the same requests consecutively.
static int REPEAT_IGNORE
          Indicates Whether it can be ignored by the server when the server receives the same requests that was not processed yet.
 
Constructor Summary
AuRequest(Desktop desktop, java.lang.String cmd, java.util.Map data)
          Constructor for a general request sent from client.
AuRequest(Desktop desktop, java.lang.String uuid, java.lang.String cmd, java.util.Map data)
          Constructor for a request sent from a component.
 
Method Summary
 void activate()
          Activates this request.
 boolean equals(java.lang.Object o)
           
 java.lang.String getCommand()
          Returns the command of this request, such as onClick.
 Component getComponent()
          Returns the component that this request is applied for, or null if it applies to the whole page or a general request.
 java.util.Map getData()
          Returns the data of this request, or null if not available.
 Desktop getDesktop()
          Returns the desktop; never null.
 int getOptions()
          Returns the options, a combination of BUSY_IGNORE, DUPLICATE_IGNORE and REPEAT_IGNORE.
 Page getPage()
          Returns the page that this request is applied for, or null if this reqeuest is a general request -- regardless any page or component.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUSY_IGNORE

public static final int BUSY_IGNORE
Indicates whether it can be ignored by the server when the server receives the same requests consecutively.

See Also:
Constant Field Values

REPEAT_IGNORE

public static final int REPEAT_IGNORE
Indicates Whether it can be ignored by the server when the server receives the same requests that was not processed yet.

See Also:
Constant Field Values

DUPLICATE_IGNORE

public static final int DUPLICATE_IGNORE
Indicates whether it can be ignored by the server when the server receives the same requests consecutively.

See Also:
Constant Field Values
Constructor Detail

AuRequest

public AuRequest(Desktop desktop,
                 java.lang.String uuid,
                 java.lang.String cmd,
                 java.util.Map data)
Constructor for a request sent from a component.

Parameters:
desktop - the desktop containing the component; never null.
uuid - the component ID (never null)
cmd - the command of the request (never null)
data - the data; might be null.
Since:
5.0.0

AuRequest

public AuRequest(Desktop desktop,
                 java.lang.String cmd,
                 java.util.Map data)
Constructor for a general request sent from client. This is usully used to ask server to log or report status.

Parameters:
cmd - the command of the request (never null)
data - the data; might be null.
Since:
5.0.0
Method Detail

activate

public void activate()
              throws ComponentNotFoundException
Activates this request.

Used internally to identify the component and page after an execution is activated. Applications rarely need to access this method.

Throws:
ComponentNotFoundException
Since:
3.0.5

getCommand

public java.lang.String getCommand()
Returns the command of this request, such as onClick.

Since:
5.0.0

getOptions

public int getOptions()
Returns the options, a combination of BUSY_IGNORE, DUPLICATE_IGNORE and REPEAT_IGNORE.

Since:
5.0.0

getDesktop

public Desktop getDesktop()
Returns the desktop; never null.


getPage

public Page getPage()
Returns the page that this request is applied for, or null if this reqeuest is a general request -- regardless any page or component.


getComponent

public Component getComponent()
Returns the component that this request is applied for, or null if it applies to the whole page or a general request.

Throws:
ComponentNotFoundException - if the component is not found

getData

public java.util.Map getData()
Returns the data of this request, or null if not available. If the client sends a string, a number or an array as data, the data can be retrieved by the key, "". For example, getData().getInt("").

See also how to process data with JSON.

Since:
5.0.0

equals

public final boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo