Class EventSourceUtil

    • Constructor Detail

    • Method Detail

      • createSubscriptionManagerEprAndRegisterHttpHandler

         EndpointReferenceType createSubscriptionManagerEprAndRegisterHttpHandler(String scheme, String address, Integer port, Interceptor interceptor)

        Creates a new subscription manager EPR based on the given transport information.

        Parameters:
        scheme - the scheme (HTTP/HTTPS) to use.
        address - the local address to use for the setup of the manager.
        port - the local port to use for the setup of the manager.
        interceptor - the interceptor that handles incoming HTTP requests.
        Returns:

        the EPR to be used in SubscribeResponse messages.

      • validateRequestBody

         <T> T validateRequestBody(RequestResponseObject rrObj, Class<T> expectedType)

        Validates a request message against a specific type and returns.

        Parameters:
        rrObj - the request response object to be inspected.
        expectedType - the expected type to check against.
        Returns:

        the instance found in the request response object, cast to the given type.

      • createInvalidMsg

         SoapMessage createInvalidMsg(RequestResponseObject rrObj, String reason)

        Creates a SOAP fault message with a reason text.

        Parameters:
        rrObj - the request response object to be used for the fault message.
        reason - the reason text.
        Returns:

        a SOAP message representing a fault message.

      • createForNotifyTo

         SoapMessage createForNotifyTo(String wsaAction, Object payload, SourceSubscriptionManager subMan)

        Creates a notification message.

        Parameters:
        wsaAction - the action URI used for the notification.
        payload - the payload to send as a JAXBElement or an object that can be marshalled.
        subMan - the subscription manager used for reference parameter retrieval.
        Returns:

        a SOAP message representing the notification.

      • grantExpires

         Duration grantExpires(@Nullable() Duration expires)

        Grants an expiration duration for a subscription.

        Parameters:
        expires - the requested expiration duration.
        Returns:

        the granted expiration, which is at most SOURCE_MAX_EXPIRES.

      • unregisterHttpHandler

         void unregisterHttpHandler(SourceSubscriptionManager subMan)

        Helper function that unregisters a subscription manager from an HTTP handler.

        Parameters:
        subMan - the subscription manager for which to end HTTP request handling.