Class AbstractWebServiceMessageSender<D extends WebServiceMessageSender.DestinationDescriptor>
- Type Parameters:
D- concreteWebServiceMessageSender.DestinationDescriptortype
- All Implemented Interfaces:
WebServiceMessageSender
- Direct Known Subclasses:
AbstractHttpWebServiceMessageSender, MailMessageSender, XmppMessageSender
WebServiceMessageSender implementations that share
WebServiceMessageSender.DestinationPolicy handling for supports(URI, UriSource).
A URI filter must be provided to only accept a URI that the implementation handles,
irrespective of whether it is acceptable according to an WebServiceMessageSender.UriSource.
Implementations typically inspect the URI scheme (or other transport-specific traits)
in that filter.
A URI that passes that filter is accepted when the configured WebServiceMessageSender.DestinationPolicy
accepts it. Without a policy, WebServiceMessageSender.UriSource.APPLICATION URIs are accepted and
WebServiceMessageSender.UriSource.REMOTE URIs are rejected.
- Since:
- 3.1.9
-
Nested Class Summary
Nested classes/interfaces inherited from interface WebServiceMessageSender
WebServiceMessageSender.DestinationDescriptor, WebServiceMessageSender.DestinationPolicy<D>, WebServiceMessageSender.UriSource -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractWebServiceMessageSender(Predicate<URI> supportedUriFilter) Create an instance with the URI filter to apply to accept a given URI. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract DcreateDescriptor(URI uri, WebServiceMessageSender.UriSource uriSource) protected @Nullable WebServiceMessageSender.DestinationPolicy<D> Return the configuredWebServiceMessageSender.DestinationPolicyornullif none is set.voidsetDestinationPolicy(WebServiceMessageSender.DestinationPolicy<D> destinationPolicy) Set theWebServiceMessageSender.DestinationPolicythat decides which destinations this sender may open a connection to.booleansupports(URI uri, WebServiceMessageSender.UriSource uriSource) Whether this sender supports the given URI for the suppliedWebServiceMessageSender.UriSource.booleanWhether this sender is configured to accept destinations supplied by a remote peer at all.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface WebServiceMessageSender
createConnection, supports
-
Constructor Details
-
AbstractWebServiceMessageSender
-
-
Method Details
-
setDestinationPolicy
Set theWebServiceMessageSender.DestinationPolicythat decides which destinations this sender may open a connection to.A policy is required to send to a
WebServiceMessageSender.UriSource.REMOTEdestination, such as a WS-AddressingReplyToorFaultToaddress: when none is configured, every remote destination is rejected.- Parameters:
destinationPolicy- the policy to apply
-
getDestinationPolicy
Return the configuredWebServiceMessageSender.DestinationPolicyornullif none is set.- Returns:
- the custom destination policy or
nullif none is set.
-
supportsRemoteDestinations
public boolean supportsRemoteDestinations()Description copied from interface:WebServiceMessageSenderWhether this sender is configured to accept destinations supplied by a remote peer at all.Return
falsewhen the sender rejects everyWebServiceMessageSender.UriSource.REMOTEdestination out of hand, typically because noWebServiceMessageSender.DestinationPolicyis configured.- Specified by:
supportsRemoteDestinationsin interfaceWebServiceMessageSender- Returns:
falseif no remote destination can ever be accepted
-
supports
Description copied from interface:WebServiceMessageSenderWhether this sender supports the given URI for the suppliedWebServiceMessageSender.UriSource.A URI is supported when this sender handles its transport and the configured
WebServiceMessageSender.DestinationPolicyaccepts it. When no policy is configured,WebServiceMessageSender.UriSource.APPLICATIONdestinations are accepted andWebServiceMessageSender.UriSource.REMOTEdestinations are rejected: only the application knows which peer-supplied destinations are legitimate, so there is no safe default.- Specified by:
supportsin interfaceWebServiceMessageSender- Parameters:
uri- the URI to be checkeduriSource- whether the URI is application-controlled or remote-influenced- Returns:
trueif this sender accepts the URI for that source
-
createDescriptor
- Parameters:
uri- the URI to checkuriSource- the source of the URI- Returns:
- a suitable descriptor
-