Class WebSocketServerPush

java.lang.Object
org.idempiere.ui.zk.websocket.WebSocketServerPush
All Implemented Interfaces:
org.zkoss.zk.ui.sys.ServerPush

public class WebSocketServerPush extends Object implements org.zkoss.zk.ui.sys.ServerPush
Server push implementation using web socket
Author:
hengsin
  • Constructor Details

    • WebSocketServerPush

      public WebSocketServerPush()
  • Method Details

    • activate

      public boolean activate(long timeout) throws InterruptedException, org.zkoss.zk.ui.DesktopUnavailableException
      Specified by:
      activate in interface org.zkoss.zk.ui.sys.ServerPush
      Throws:
      InterruptedException
      org.zkoss.zk.ui.DesktopUnavailableException
    • deactivate

      public boolean deactivate(boolean stop)
      Specified by:
      deactivate in interface org.zkoss.zk.ui.sys.ServerPush
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface org.zkoss.zk.ui.sys.ServerPush
    • onPiggyback

      public void onPiggyback()
      Specified by:
      onPiggyback in interface org.zkoss.zk.ui.sys.ServerPush
    • schedule

      public <T extends org.zkoss.zk.ui.event.Event> void schedule(org.zkoss.zk.ui.event.EventListener<T> task, T event, org.zkoss.zk.ui.sys.Scheduler<T> scheduler)
      Specified by:
      schedule in interface org.zkoss.zk.ui.sys.ServerPush
    • start

      public void start(org.zkoss.zk.ui.Desktop desktop)
      Specified by:
      start in interface org.zkoss.zk.ui.sys.ServerPush
    • stop

      public void stop()
      Specified by:
      stop in interface org.zkoss.zk.ui.sys.ServerPush
    • resume

      public void resume()
      Specified by:
      resume in interface org.zkoss.zk.ui.sys.ServerPush
    • registerEndPoint

      public static void registerEndPoint(String dtid, ServerPushEndPoint endpoint)
      Register web socket end point for desktop
      Parameters:
      dtid - Desktop id
      endpoint - Connected web socket end point
    • unregisterEndPoint

      public static boolean unregisterEndPoint(String dtid)
      Remove web socket end point for desktop
      Parameters:
      dtid - Desktop id
      Returns:
      true if there's end point register previously for desktop, false otherwise
    • getEndPoint

      public static ServerPushEndPoint getEndPoint(String dtid)
      Get web socket end point for desktop
      Parameters:
      dtid - Desktop id
      Returns:
      Web socket end point
    • isValidDesktopId

      public static boolean isValidDesktopId(String dtid)
      Parameters:
      dtid - desktop id
      Returns:
      true if serverpush started for dtid, false otherwise