Package org.zkoss.zats.mimic.impl
Class EmulatorClient
java.lang.Object
org.zkoss.zats.mimic.impl.EmulatorClient
- All Implemented Interfaces:
Client,ClientCtrl
The default server emulator client implementation.
- Author:
- pao
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.zkoss.zats.mimic.impl.ClientCtrl
ClientCtrl.DestroyListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect to a zul file, you have to provide the path that relative to the resource root folderconnectAsIncluded(String zulPath, Map<String, Object> args) connect to a zul file, you have to provide the path that relative to the resource root folder.connectWithContent(String content, String ext, ComponentAgent parent, Map<String, Object> args) Connect to a zul content or another language from a string.voiddestroy()destroy this client, it will also destory all un-destroyed desktops that is created by this clientvoiddestroy(DesktopAgent desktopAgent) voidflush the queued AU update event including piggyback events.getConnection(String path, String method) get a connection with current session and cookie.get value of cookie with specify name.get all cookies in an unmodifiable map.get the current echo event handling mode.Returns a map containing the given mappings.openConnection(String path) open a connection with current session and cookie.voidpostPiggyback(String desktopId, String targetUUID, String command, Map<String, Object> data, boolean ignorable) post a piggyback asynchronous update event.voidpostUpdate(String desktopId, String targetUUID, String command, Map<String, Object> data, boolean ignorable) post an asynchronous update event.voidset cookie for the client, the cookie will be sent at every HTTP request.voidvoidchange the echo event handling mode.
-
Constructor Details
-
EmulatorClient
-
-
Method Details
-
connectAsIncluded
Description copied from interface:Clientconnect to a zul file, you have to provide the path that relative to the resource root folder. You can pass arguments through a map into the specific zul file as including.- Specified by:
connectAsIncludedin interfaceClient- Parameters:
zulPath- the path of zul file.args- the arguments to pass.- Returns:
- desktop agent.
- See Also:
-
connectWithContent
public DesktopAgent connectWithContent(String content, String ext, ComponentAgent parent, Map<String, Object> args) Description copied from interface:ClientConnect to a zul content or another language from a string. You can pass arguments through a map into the specific zul content or another language.- Specified by:
connectWithContentin interfaceClient- Parameters:
content- the raw content of the page. It must be a XML and compliant to the page format (such as ZUL).parent- the parent component, or null if you want it to be a root component. If parent is null, the page is assumed to be the current page, which is determined by the execution context. In other words, the new component will be the root component of the current page if parent is null.- Returns:
- desktop agent.
- See Also:
-
Executions.createComponentsDirectly(String, String, org.zkoss.zk.ui.Component, Map)
-
connect
Description copied from interface:Clientconnect to a zul file, you have to provide the path that relative to the resource root folder -
destroy
public void destroy()Description copied from interface:Clientdestroy this client, it will also destory all un-destroyed desktops that is created by this client -
destroy
- Specified by:
destroyin interfaceClientCtrl
-
postUpdate
public void postUpdate(String desktopId, String targetUUID, String command, Map<String, Object> data, boolean ignorable) Description copied from interface:ClientCtrlpost an asynchronous update event. It will be queued until invoke flush.- Specified by:
postUpdatein interfaceClientCtrl
-
postPiggyback
public void postPiggyback(String desktopId, String targetUUID, String command, Map<String, Object> data, boolean ignorable) Description copied from interface:ClientCtrlpost a piggyback asynchronous update event. a piggyback event's order is after normal events. It will be queued until invoke flush.- Specified by:
postPiggybackin interfaceClientCtrl
-
flush
Description copied from interface:ClientCtrlflush the queued AU update event including piggyback events.- Specified by:
flushin interfaceClientCtrl
-
getConnection
Description copied from interface:ClientCtrlget a connection with current session and cookie.- Specified by:
getConnectionin interfaceClientCtrl- Parameters:
path- connect to this pathmethod- HTTP method
-
openConnection
Description copied from interface:ClientCtrlopen a connection with current session and cookie.- Specified by:
openConnectionin interfaceClientCtrl- Parameters:
path- connect to this path- Throws:
IOException
-
setDestroyListener
- Specified by:
setDestroyListenerin interfaceClientCtrl
-
setCookie
Description copied from interface:Clientset cookie for the client, the cookie will be sent at every HTTP request. The cookie name can't start with '$'. Please refer to section 3.2.2 of RFC 2965. If the name existed, the origin value will be replaced. -
getCookie
Description copied from interface:Clientget value of cookie with specify name. -
getCookies
Description copied from interface:Clientget all cookies in an unmodifiable map.- Specified by:
getCookiesin interfaceClient- Returns:
- the map contained cookies.
-
setEchoEventMode
Description copied from interface:Clientchange the echo event handling mode. the default mode is EchoEventMode.IMMEDIATE- Specified by:
setEchoEventModein interfaceClient- Parameters:
mode- Control echo event handling mode. If null, do nothing.- See Also:
-
getEchoEventMode
Description copied from interface:Clientget the current echo event handling mode. the default mode is EchoEventMode.IMMEDIATE- Specified by:
getEchoEventModein interfaceClient- Returns:
- current echo event handling mode.
- See Also:
-
mapsOf
Returns a map containing the given mappings.
-