Class EventSourceUtil

    • Method Detail

      • createSubscriptionManagerEprAndRegisterHttpHandler

        public org.somda.sdc.dpws.soap.wsaddressing.model.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

        public <T> T validateRequestBody​(RequestResponseObject rrObj,
                                         Class<T> expectedType)
                                  throws SoapFaultException
        Validates a request message against a specific type and returns.
        Type Parameters:
        T - type information for the expected type
        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.
        Throws:
        SoapFaultException - if validation fails.
      • createInvalidMsg

        public 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

        public 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.
      • unregisterHttpHandler

        public 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.