ICEpush
  1. ICEpush
  2. PUSH-390

Add new .icepush requests for adding, querying and removing Notify-Back-URIs

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-4.0.0.GA, 4.1
    • Fix Version/s: EE-4.2.0.GA
    • Labels:
      None
    • Environment:
      ICEpush JavaScript Bridge, ICEpush Core
    • Assignee Priority:
      P1

      Description

      Instead of lazily adding the ice.notifyBack to the listen.icepush requests upon registering for cloud push and resulting in the eventual server-side NotifyBackURI representation, we should introduce new .icepush requests specifically for this:

      1. add-notify-back-uri.icepush
      2. has-notify-back-uri.icepush
      3. remove-notify-back-uri.icepush

      All these requests should be kept quite simple. The add request should at a minimum include the browserID and notifyBackURI as only the client-side is able to obtain the notifyBackURI. The response to the add request can likely just be a 200 OK or 204 No Content status message. The has request should at a minimum include the browserID. This request can be used by the cloud/mobile component to check if its browserID already has a notifyBackURI associated with it. The response to the has request can likely just be a 200 OK or 204 No Content status message indicating its browserID has a notifyBackURI associated with it, or it can likely just be a 404 Not Found status message indicating its browserID has no notifyBackURI associated with it.

      For this both the client-side and server-side need to include support for these new .icepush requests.
      1. PUSH-390.client-side.patch
        10 kB
        Mircea Toma
      2. PUSH-390.patch
        29 kB
        Jack Van Ooststroom

        Activity

        Hide
        Mircea Toma added a comment -

        Attached client side changes. I also modified the response of HasNotifyBackURI servlet to always respond with a OK 200, the response body will contain the 'true' or 'false' string depending what the result of the test it is. I believe we do not need to carry procedure invocation concepts into the HTTP realm. Also code handling on the client side is much simpler and straight forward.

        Show
        Mircea Toma added a comment - Attached client side changes. I also modified the response of HasNotifyBackURI servlet to always respond with a OK 200 , the response body will contain the 'true' or 'false' string depending what the result of the test it is. I believe we do not need to carry procedure invocation concepts into the HTTP realm. Also code handling on the client side is much simpler and straight forward.
        Hide
        Jack Van Ooststroom added a comment -

        Sending icepush/core/src/main/java/org/icepush/Browser.java
        Sending icepush/core/src/main/java/org/icepush/LocalPushGroupManager.java
        Sending icepush/core/src/main/java/org/icepush/NoopPushGroupManager.java
        Sending icepush/core/src/main/java/org/icepush/PushContext.java
        Sending icepush/core/src/main/java/org/icepush/PushGroupManager.java
        Adding icepush/core/src/main/java/org/icepush/servlet/AddNotifyBackURI.java
        Sending icepush/core/src/main/java/org/icepush/servlet/BrowserBoundServlet.java
        Adding icepush/core/src/main/java/org/icepush/servlet/HasNotifyBackURI.java
        Adding icepush/core/src/main/java/org/icepush/servlet/RemoveNotifyBackURI.java
        Sending icepush/core/src/main/javascript/application.js
        Transmitting file data ..........
        Committed revision 48625.

        Sending core/src/main/java/org/icefaces/impl/event/BridgeSetup.java
        Sending core/src/main/java/org/icefaces/impl/push/servlet/ICEpushResourceHandler.java
        Transmitting file data ..
        Committed revision 48626.

        Show
        Jack Van Ooststroom added a comment - Sending icepush/core/src/main/java/org/icepush/Browser.java Sending icepush/core/src/main/java/org/icepush/LocalPushGroupManager.java Sending icepush/core/src/main/java/org/icepush/NoopPushGroupManager.java Sending icepush/core/src/main/java/org/icepush/PushContext.java Sending icepush/core/src/main/java/org/icepush/PushGroupManager.java Adding icepush/core/src/main/java/org/icepush/servlet/AddNotifyBackURI.java Sending icepush/core/src/main/java/org/icepush/servlet/BrowserBoundServlet.java Adding icepush/core/src/main/java/org/icepush/servlet/HasNotifyBackURI.java Adding icepush/core/src/main/java/org/icepush/servlet/RemoveNotifyBackURI.java Sending icepush/core/src/main/javascript/application.js Transmitting file data .......... Committed revision 48625. Sending core/src/main/java/org/icefaces/impl/event/BridgeSetup.java Sending core/src/main/java/org/icefaces/impl/push/servlet/ICEpushResourceHandler.java Transmitting file data .. Committed revision 48626.
        Hide
        Jack Van Ooststroom added a comment -

        Sending core-ee/src/main/java/com/icesoft/icepush/BrowserBoundServlet.java
        Transmitting file data .
        Committed revision 44924.

        Sending eps/src/main/java/com/icesoft/push/DynamicPushGroupManager.java
        Sending eps/src/main/java/com/icesoft/push/RemotePushGroupManager.java
        Sending eps/src/main/java/com/icesoft/push/servlet/BrowserBoundServlet.java
        Transmitting file data ...
        Committed revision 44925.

        Show
        Jack Van Ooststroom added a comment - Sending core-ee/src/main/java/com/icesoft/icepush/BrowserBoundServlet.java Transmitting file data . Committed revision 44924. Sending eps/src/main/java/com/icesoft/push/DynamicPushGroupManager.java Sending eps/src/main/java/com/icesoft/push/RemotePushGroupManager.java Sending eps/src/main/java/com/icesoft/push/servlet/BrowserBoundServlet.java Transmitting file data ... Committed revision 44925.
        Hide
        Liana Munroe added a comment - - edited

        Tested ICEfaces4 trunk r48626:
        As a result of the commit at r48626, an NPE now occurs in any application using icepush when trying to access the application main page in a browser

        Icefaces-EE4 trunk r.44929/Labs1:
        Built and deployed cloudPush QA app locally and on Labs1. In both environments, a NPE occurs.
        Apr 14, 2016 3:36:57 PM com.icesoft.icepush.MainServlet <init>
        INFO:
        ICEsoft Technologies Inc.
        ICEpush-EE 4.1.0.SNAPSHOT
        Build number: x
        Revision: x
        Apr 14, 2016 3:36:57 PM com.sun.faces.application.view.ViewScopeManager <init>
        INFO: CDI @ViewScoped bean functionality unavailable
        Apr 14, 2016 3:36:57 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
        WARNING: JSF1064: Unable to find or serve resource, add-notify-back-uri.icepush.txt.
        Apr 14, 2016 3:36:57 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
        WARNING: JSF1064: Unable to find or serve resource, has-notify-back-uri.icepush.txt.
        Apr 14, 2016 3:36:57 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
        WARNING: JSF1064: Unable to find or serve resource, remove-notify-back-uri.icepush.txt.
        Apr 14, 2016 3:36:57 PM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException
        SEVERE: Error Rendering View[/start.xhtml]
        java.lang.NullPointerException
        at org.icefaces.impl.event.BridgeSetup$2.encode(BridgeSetup.java:245)
        at org.icefaces.impl.event.UIOutputWriter.encodeBegin(UIOutputWriter.java:27)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854)
        at com.sun.faces.renderkit.html_basic.BodyRenderer.encodeEnd(BodyRenderer.java:105)
        at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:920)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:458)
        at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:134)
        at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.icesoft.util.servlet.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:74)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.icesoft.util.servlet.CustomHeaderFilter.doFilter(CustomHeaderFilter.java:82)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
        ..............

        Show
        Liana Munroe added a comment - - edited Tested ICEfaces4 trunk r48626: As a result of the commit at r48626, an NPE now occurs in any application using icepush when trying to access the application main page in a browser Icefaces-EE4 trunk r.44929/Labs1: Built and deployed cloudPush QA app locally and on Labs1. In both environments, a NPE occurs. Apr 14, 2016 3:36:57 PM com.icesoft.icepush.MainServlet <init> INFO: ICEsoft Technologies Inc. ICEpush-EE 4.1.0.SNAPSHOT Build number: x Revision: x Apr 14, 2016 3:36:57 PM com.sun.faces.application.view.ViewScopeManager <init> INFO: CDI @ViewScoped bean functionality unavailable Apr 14, 2016 3:36:57 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource WARNING: JSF1064: Unable to find or serve resource, add-notify-back-uri.icepush.txt. Apr 14, 2016 3:36:57 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource WARNING: JSF1064: Unable to find or serve resource, has-notify-back-uri.icepush.txt. Apr 14, 2016 3:36:57 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource WARNING: JSF1064: Unable to find or serve resource, remove-notify-back-uri.icepush.txt. Apr 14, 2016 3:36:57 PM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException SEVERE: Error Rendering View [/start.xhtml] java.lang.NullPointerException at org.icefaces.impl.event.BridgeSetup$2.encode(BridgeSetup.java:245) at org.icefaces.impl.event.UIOutputWriter.encodeBegin(UIOutputWriter.java:27) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) at com.sun.faces.renderkit.html_basic.BodyRenderer.encodeEnd(BodyRenderer.java:105) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:920) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:458) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:134) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.icesoft.util.servlet.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:74) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.icesoft.util.servlet.CustomHeaderFilter.doFilter(CustomHeaderFilter.java:82) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) ..............
        Hide
        Mircea Toma added a comment - - edited

        Added resource dummy files that correspond to add/remove/has notify back URI requests. This should fix the NPE issue.

        Show
        Mircea Toma added a comment - - edited Added resource dummy files that correspond to add/remove/has notify back URI requests. This should fix the NPE issue.
        Hide
        Carmen Cristurean added a comment -

        Verified ICEfaces4 trunk r48629, the NPE is resolved.

        Show
        Carmen Cristurean added a comment - Verified ICEfaces4 trunk r48629, the NPE is resolved.
        Hide
        Jack Van Ooststroom added a comment -

        On the server-side the handling of the following new requests have been added:

        • add-notify-back-uri.icepush with a Browser-ID and Notify-Back-URI included within the request. In response a 200 OK empty response is sent back.
        • has-notify-back-uri.icepush with a Browser-ID included within the request. In response a 200 OK response is sent back containing a single boolean value.
        • remove-notify-back-uri.icepush with a Browser-ID included within the request. In response a 200 OK empty response is sent back.

        On the client-side the JavaScript Bridge has been expanded to allow for sending the new requests mentioned above.

        Finally, ICEfaces has been augmented to include and support these new requests as well.

        Marking this one as FIXED.

        Show
        Jack Van Ooststroom added a comment - On the server-side the handling of the following new requests have been added: add-notify-back-uri.icepush with a Browser-ID and Notify-Back-URI included within the request. In response a 200 OK empty response is sent back. has-notify-back-uri.icepush with a Browser-ID included within the request. In response a 200 OK response is sent back containing a single boolean value. remove-notify-back-uri.icepush with a Browser-ID included within the request. In response a 200 OK empty response is sent back. On the client-side the JavaScript Bridge has been expanded to allow for sending the new requests mentioned above. Finally, ICEfaces has been augmented to include and support these new requests as well. Marking this one as FIXED.

          People

          • Assignee:
            Jack Van Ooststroom
            Reporter:
            Jack Van Ooststroom
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: