Class AuRequest

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

public class AuRequest extends Object
A request sent from the client to the server.
Author:
tomyeh
  • Field Details

    • BUSY_IGNORE

      public static final int BUSY_IGNORE
      Indicates whether it can be ignored by the server when the server is busy.
      See Also:
    • REPEAT_IGNORE

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

      public static final int DUPLICATE_IGNORE
      Indicates whether it can be ignored by the server when the server receives the same requests that was not processed yet.
      See Also:
  • Constructor Details

    • AuRequest

      public AuRequest(Desktop desktop, String uuid, String cmd, Map<String,Object> 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, String cmd, Map<String,Object> data)
      Constructor for a general request sent from client. This is usually 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 Details

    • 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 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 request 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
    • getUuid

      public String getUuid()
      Returns the UUID. In most case, it is the same as getComponent()'s getUuid(). However, they are not the same if the component of the UUID has been merged (as a stub component, such as StubComponent) into another one.
      Since:
      6.0.0
    • getData

      public Map<String,Object> getData()
      Returns the data of this request. 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 ZK Client-side Reference: AU Requests: Server-side Processing

      Notice that, since 5.0.4, this method never returns null. If no data at all, it simply returns an empty map.

      Since:
      5.0.0
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object