wiseman
  1. wiseman
  2. WISEMAN-150

implement PushWithAck mode in eventing module

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: eventing
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      150

      Description

      We are from Fudan-Hitachi Innovative Software Technology Labratory (InSTech
      Joint Lab) .
      We are ready to contribute to wiseman communication.

      The PushWithAck mode in eventing module has not been implemented in wiseman
      project yet,
      we would like to implement it.

      While we communicate with Jean-Francois Denise and Rachal Denis,
      we get many valuable comments from them .

      Thank you very much, Jean-Francois and Rachal .

      Now we summarize the proposal on PushWithAck mode in eventing module.

      1.In package of com.sun.ws.management.server we add two subscription context
      classes:
      one class EventingContextWithAck for PushWithAck mode,
      the other class EventingContextBatched for Batched Delivery mode.
      EventingContextWithAck which is a subclass of EventingContext which is for Push
      mode,
      EventingContextBatched which is a subclass of EventingWithAckContext.

      About EventingContextWithAck,
      we add two member variables to EventingContextWithAck :
      private EndpointReferenceType eventReplyTo;
      private Duration operationTimeout;

      then add getters & setters for the two member variables.

      About EventingContextBatched,
      we add two member variables to EventingContextBatched :
      private int maxElements;
      private Duration maxTime;

      then add getters & setters for the two member variables.

      2.In class of com.sun.ws.management.server.WSEventingSupport
      we add four static "set" methods for the four options, i.e.
      eventReplyTo,operationTimeout,maxElements,maxTime so that
      the application developer can set values after the subscription context has
      been created.

      public static void setSendReplyTo(final UUID id, final EndpointReferenceType
      eventReplyTo);
      public static void setSendOperationTimeout(final UUID id, final Duration
      operationTimeout);
      public static void setSendMaxElements(final UUID id, final int maxElements);
      public static void setSendMaxTime(final UUID id, final Duration maxTime);

      3.In class of com.sun.ws.management.server.WSEventingBaseSupport
      we add two delivery modes which was not supported in version 1.0 .

      private static final String[] SUPPORTED_DELIVERY_MODES =

      { Eventing.PUSH_DELIVERY_MODE, EventingExtensions.PULL_DELIVERY_MODE, EventingExtensions.PUSH_WITH_ACK_DELIVERY_MODE, EventingExtensions.EVENTS_DELIVERY_MODE }

      ;

      This time we focus on the PushWithAck mode.
      The Batched Delivery mode will be supported later by us.

      4.In class of com.sun.ws.management.server.WSEventingSupport
      we update the static function:

      public static UUID subscribe(final HandlerContext handlerContext,
      final WSEventingRequest request,
      final WSEventingResponse response,
      final boolean isFiltered,
      final int queueSize,
      final ContextListener listener,
      final Object factory)
      throws DatatypeConfigurationException, SOAPException,
      JAXBException, FaultException

      { ... }

      So that the subscription context , i.e. the EventingContextWithAck or
      EventingContextBatched object
      would be initialized as the server receives the subscription request with
      PushWithAck or Batched Delivery mode.

      5.In class of com.sun.ws.management.server.EventingSupport
      we update the static function:

      public static boolean sendEvent(UUID id, Object content)
      throws SOAPException, JAXBException, IOException { ... }

      So that the application developer will use this uniform interface to send
      events
      from EventSource to EventSink regardless of the delivery mode specified by
      users.
      We add the support for the PushWithAck mode this time.

      6.In class of com.sun.ws.management.server.WSEventingBaseSupport
      we add one static function similar to function
      public static Addressing createPushEventMessage(UUID id, Object content):

      protected static Addressing createEventMessagePushWithAck(
      final EventingContextWithAck ctx,
      final Object content)
      throws SOAPException, JAXBException, IOException

      { ... }

      In function of com.sun.ws.management.server.EventingSupport.sendEvent(...)
      we call this function to create event message in PushWithAck mode.

      We provide the unit test code for this function
      in file of
      wiseman/se/test/src/com/sun/ws/management/server/WSEventingBaseSupportTest.java
      .

      7.In class of com.sun.ws.management.transport.HttpClient
      we add one static function:
      public static Addressing sendRequest(
      final Addressing addressing,
      final String destination)
      throws IOException, SOAPException, JAXBException { ... }

      In function of com.sun.ws.management.server.EventingSupport.sendEvent(...)
      we call this function to send event and get the response, i.e. acknowledgement
      or fault message .

      8.In class of com.sun.ws.management.server.EventingSupport
      we add ont private static function:

      private static boolean parseEventResponse(Addressing eventResponse)
      throws SOAPException, JAXBException, IOException

      { ... }

      If the eventResponse is one ACK message, it will return true,
      if the eventResponse is one Fault message, it will return false.

      In function of com.sun.ws.management.server.EventingSupport.sendEvent(...)
      we call this function to get the type of response message.

      9.As Jean-Francois said, there will be many issues on the EventSink side.
      This time we add one new package for event sink:
      com.sun.ws.management.server.sink .
      And we add one class named WSEventingSupportSink to this package.
      In class of com.sun.ws.management.server.sink.WSEventingSupportSink
      we add two static functions:

      public static Addressing createEventACKAcknowledgement(Addressing
      request)
      throws SOAPException, JAXBException, IOException { ... }

      public static Addressing createDeliveryRefusedFaultMessage(
      Addressing request,
      String reason)
      throws SOAPException, JAXBException, IOException

      { ... }

      Both functions can be called on EventSink side to create the response message,
      e.g. ACK message,
      after the event is received by sink.

      We provide the unit test code for the two functions
      in file of wiseman/se/test/src/management/WSEventingSupportTest.java .

      That is all for the proposal this time.
      The following is the file list:
      Added:
      wiseman/se/src/com/sun/ws/management/server/EventingContextWithAck.java
      wiseman/se/src/com/sun/ws/management/server/EventingContextBatched.java
      wiseman/se/src/com/sun/ws/management/server/sink/WSEventingSupportSink.java

      wiseman/se/test/src/management/WSEventingSupportTest.java

      wiseman/se/test/src/com/sun/ws/management/server/WSEventingBaseSupportTest.java

      Modified:
      wiseman/se/src/com/sun/ws/management/server/WSEventingSupport.java
      wiseman/se/src/com/sun/ws/management/server/WSEventingBaseSupport.java
      wiseman/se/src/com/sun/ws/management/server/EventingSupport.java
      wiseman/se/src/com/sun/ws/management/transport/HttpClient.java

      Thanks to Jean-Francois and Rachal again.
      Merry X'mas ahead.

      1. EventingContextBatched.java
        2 kB
        cxiao
      2. EventingContextWithAck.java
        2 kB
        cxiao
      3. EventingSupport.java
        14 kB
        cxiao
      4. HttpClient.java
        16 kB
        cxiao
      5. patch_PushWithAckMode.txt
        92 kB
        cxiao
      6. WSEventingBaseSupport.java
        10 kB
        cxiao
      7. WSEventingBaseSupportTest.java
        6 kB
        cxiao
      8. WSEventingSupport.java
        21 kB
        cxiao
      9. WSEventingSupportSink.java
        5 kB
        cxiao
      10. WSEventingSupportTest.java
        5 kB
        cxiao

        Activity

        Hide
        cxiao added a comment -

        Created an attachment (id=17)
        java file for WSEventingSupportSink, added.

        Show
        cxiao added a comment - Created an attachment (id=17) java file for WSEventingSupportSink, added.
        Hide
        cxiao added a comment -

        Created an attachment (id=18)
        java file for WSEventingSupportTest, added.

        Show
        cxiao added a comment - Created an attachment (id=18) java file for WSEventingSupportTest, added.
        Hide
        cxiao added a comment -

        We are ready to contribute to wiseman community. sorry, not communication.

        Show
        cxiao added a comment - We are ready to contribute to wiseman community. sorry, not communication.
        Hide
        cxiao added a comment -

        Created an attachment (id=19)
        a diff file which can be applied to wiseman. a patch for pushwithack .

        Show
        cxiao added a comment - Created an attachment (id=19) a diff file which can be applied to wiseman. a patch for pushwithack .
        Hide
        cxiao added a comment -

        If the diff file in attachment is applied to wiseman,
        it will add or modify the following files:

        Added:
        wiseman/se/src/com/sun/ws/management/server/EventingContextWithAck.java
        wiseman/se/src/com/sun/ws/management/server/EventingContextBatched.java
        wiseman/se/src/com/sun/ws/management/server/sink/WSEventingSupportSink.java

        wiseman/se/test/src/management/WSEventingSupportSinkTest.java
        wiseman/se/test/src/management/WSEventingBaseSupportTest.java

        Modified:
        wiseman/se/src/com/sun/ws/management/server/WSEventingSupport.java
        wiseman/se/src/com/sun/ws/management/server/WSEventingBaseSupport.java
        wiseman/se/src/com/sun/ws/management/server/EventingSupport.java
        wiseman/se/src/com/sun/ws/management/transport/HttpClient.java
        wiseman/se/src/com/sun/ws/management/server/EventingContext.java

        Show
        cxiao added a comment - If the diff file in attachment is applied to wiseman, it will add or modify the following files: Added: wiseman/se/src/com/sun/ws/management/server/EventingContextWithAck.java wiseman/se/src/com/sun/ws/management/server/EventingContextBatched.java wiseman/se/src/com/sun/ws/management/server/sink/WSEventingSupportSink.java wiseman/se/test/src/management/WSEventingSupportSinkTest.java wiseman/se/test/src/management/WSEventingBaseSupportTest.java Modified: wiseman/se/src/com/sun/ws/management/server/WSEventingSupport.java wiseman/se/src/com/sun/ws/management/server/WSEventingBaseSupport.java wiseman/se/src/com/sun/ws/management/server/EventingSupport.java wiseman/se/src/com/sun/ws/management/transport/HttpClient.java wiseman/se/src/com/sun/ws/management/server/EventingContext.java

          People

          • Assignee:
            denis_rachal
            Reporter:
            cxiao
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: