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 UiEngine.

Author:
tomyeh

Constructor Summary
AuRequest(Desktop desktop, Command cmd, java.lang.String[] data)
          Constructor for a general request sent from client.
AuRequest(Desktop desktop, java.lang.String uuid, Command cmd, java.lang.String[] data)
          Constructor for a request sent from a component.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 Command getCommand()
          Returns the command; never null.
static Command getCommand(java.lang.String name)
          Returns the command of the specified name.
 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.lang.String getComponentUuid()
          Returns the UUID.
 java.lang.String[] getData()
          Returns the data of the command, might be null.
 Desktop getDesktop()
          Returns the desktop; never null.
 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.
static boolean hasRequest(java.lang.String cmdnm)
          Returns whether the specified request name is valid.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AuRequest

public AuRequest(Desktop desktop,
                 java.lang.String uuid,
                 Command cmd,
                 java.lang.String[] data)
Constructor for a request sent from a component. Since we cannot invoke Desktop.getComponentByUuid(java.lang.String) without activating an execution, we have to use this method.

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

AuRequest

public AuRequest(Desktop desktop,
                 Command cmd,
                 java.lang.String[] 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; never null.
data - the data; might be null.
Method Detail

hasRequest

public static final boolean hasRequest(java.lang.String cmdnm)
Returns whether the specified request name is valid. A request is a event that are sent from the browser.

An request name is the ID of a command (Command.getId()) which starts with "on".


getCommand

public static final Command getCommand(java.lang.String name)
Returns the command of the specified name.

Throws:
CommandNotFoundException - if the command is not found

getDesktop

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


getPage

public final 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.

Throws:
ComponentNotFoundException - if the page is not found

getComponent

public final 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

getComponentUuid

public final java.lang.String getComponentUuid()
Returns the UUID.


getCommand

public final Command getCommand()
Returns the command; never null.


getData

public final java.lang.String[] getData()
Returns the data of the command, might be null.


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-2007 Potix Corporation. All Rights Reserved.