Class PushHandleImpl

  • All Implemented Interfaces:
    PushHandle

    public class PushHandleImpl
    extends java.lang.Object
    implements PushHandle
    • Constructor Summary

      Constructors 
      Constructor Description
      PushHandleImpl​(javax.servlet.http.HttpSession httpSession, javax.websocket.Session websocketSession)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getCustomData()  
      javax.servlet.http.HttpSession getHttpSession()  
      java.lang.String getLanguage()  
      java.lang.Object getSessionObject()  
      boolean isPushOpen()  
      void pushObject​(java.lang.Object object)
      Push an object to browser
      void redirect​(java.lang.Class<?> componentClass, java.lang.String parameters)
      Redirect browser to a new target component
      void redirect​(java.lang.String url)
      Redirect browser to a new URL
      void setCustomData​(java.lang.Object customData)
      Set custom data, which would be accessible in both, pushStarted() and pushTerminated()
      void setSessionObject​(java.lang.Object sessionObject)
      Update session object in http session
      void terminatePush()
      Terminate push connection
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PushHandleImpl

        public PushHandleImpl​(javax.servlet.http.HttpSession httpSession,
                              javax.websocket.Session websocketSession)
    • Method Detail

      • terminatePush

        public void terminatePush()
        Description copied from interface: PushHandle
        Terminate push connection
        Specified by:
        terminatePush in interface PushHandle
      • pushObject

        public void pushObject​(java.lang.Object object)
        Description copied from interface: PushHandle
        Push an object to browser
        Specified by:
        pushObject in interface PushHandle
        Parameters:
        object - object to push
      • isPushOpen

        public boolean isPushOpen()
        Specified by:
        isPushOpen in interface PushHandle
        Returns:
        true, if push connection is open
      • getHttpSession

        public javax.servlet.http.HttpSession getHttpSession()
        Specified by:
        getHttpSession in interface PushHandle
        Returns:
        http session associated with this push connection
      • setCustomData

        public void setCustomData​(java.lang.Object customData)
        Description copied from interface: PushHandle
        Set custom data, which would be accessible in both, pushStarted() and pushTerminated()
        Specified by:
        setCustomData in interface PushHandle
        Parameters:
        customData - custom data
      • getCustomData

        public java.lang.Object getCustomData()
        Specified by:
        getCustomData in interface PushHandle
        Returns:
        custom data
      • getLanguage

        public java.lang.String getLanguage()
        Specified by:
        getLanguage in interface PushHandle
        Returns:
        current language
      • getSessionObject

        public java.lang.Object getSessionObject()
        Specified by:
        getSessionObject in interface PushHandle
        Returns:
        session object, which was registered in SlimwebConfiguration
      • setSessionObject

        public void setSessionObject​(java.lang.Object sessionObject)
        Description copied from interface: PushHandle
        Update session object in http session
        Specified by:
        setSessionObject in interface PushHandle
        Parameters:
        sessionObject - session object
      • redirect

        public void redirect​(java.lang.String url)
        Description copied from interface: PushHandle
        Redirect browser to a new URL
        Specified by:
        redirect in interface PushHandle
        Parameters:
        url - target url
      • redirect

        public void redirect​(java.lang.Class<?> componentClass,
                             java.lang.String parameters)
        Description copied from interface: PushHandle
        Redirect browser to a new target component
        Specified by:
        redirect in interface PushHandle
        Parameters:
        componentClass - target component class
        parameters - URL get-parameters, for example "attr1=john&attr2=smith"