Class EventSourceUtil
-
- All Implemented Interfaces:
public class EventSourceUtilUtility class for the EventSourceInterceptorDispatcher and SubscriptionRegistry.
-
-
Method Summary
Modifier and Type Method Description EndpointReferenceTypecreateSubscriptionManagerEprAndRegisterHttpHandler(String scheme, String address, Integer port, Interceptor interceptor)Creates a new subscription manager EPR based on the given transport information. <T> TvalidateRequestBody(RequestResponseObject rrObj, Class<T> expectedType)Validates a request message against a specific type and returns. SoapMessagecreateInvalidMsg(RequestResponseObject rrObj, String reason)Creates a SOAP fault message with a reason text. SoapMessagecreateForNotifyTo(String wsaAction, Object payload, SourceSubscriptionManager subMan)Creates a notification message. DurationgrantExpires(@Nullable() Duration expires)Grants an expiration duration for a subscription. SourceSubscriptionManagervalidateSubscriptionEpr(RequestResponseObject rrObj, Map<String, SourceSubscriptionManager> subscriptions)Inspects a request message to contain a valid subscription manager. voidunregisterHttpHandler(SourceSubscriptionManager subMan)Helper function that unregisters a subscription manager from an HTTP handler. -
-
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.
-
validateSubscriptionEpr
SourceSubscriptionManager validateSubscriptionEpr(RequestResponseObject rrObj, Map<String, SourceSubscriptionManager> subscriptions)
Inspects a request message to contain a valid subscription manager.
- Parameters:
rrObj- the request response object to inspect.subscriptions- available subscriptions.- Returns:
returns the subscription manager of a valid subscription identifier in rrObj.
-
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.
-
-
-
-