com.sun.xml.internal.ws.client.HandlerConfiguration Java Examples

The following examples show how to use com.sun.xml.internal.ws.client.HandlerConfiguration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClientMUTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Do MU Header Processing on incoming message (response)
 *
 * @return
 *         if all the headers in the packet are understood, returns an action to
 *         call the previous pipes with response packet
 * @throws SOAPFaultException
 *         if all the headers in the packet are not understood, throws SOAPFaultException
 */
@Override @NotNull
public NextAction processResponse(Packet response) {
    if (response.getMessage() == null) {
        return super.processResponse(response);
    }
    HandlerConfiguration handlerConfig = response.handlerConfig;

    if (handlerConfig == null) {
        //Use from binding instead of defaults in case response packet does not have it,
        //may have been changed from the time of invocation, it ok as its only fallback case.
        handlerConfig = binding.getHandlerConfig();
    }
    Set<QName> misUnderstoodHeaders = getMisUnderstoodHeaders(response.getMessage().getHeaders(), handlerConfig.getRoles(),binding.getKnownHeaders());
    if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) {
        return super.processResponse(response);
    }
    throw createMUSOAPFaultException(misUnderstoodHeaders);
}
 
Example #2
Source File: ClientMUTube.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Do MU Header Processing on incoming message (response)
 *
 * @return
 *         if all the headers in the packet are understood, returns an action to
 *         call the previous pipes with response packet
 * @throws SOAPFaultException
 *         if all the headers in the packet are not understood, throws SOAPFaultException
 */
@Override @NotNull
public NextAction processResponse(Packet response) {
    if (response.getMessage() == null) {
        return super.processResponse(response);
    }
    HandlerConfiguration handlerConfig = response.handlerConfig;

    if (handlerConfig == null) {
        //Use from binding instead of defaults in case response packet does not have it,
        //may have been changed from the time of invocation, it ok as its only fallback case.
        handlerConfig = binding.getHandlerConfig();
    }
    Set<QName> misUnderstoodHeaders = getMisUnderstoodHeaders(response.getMessage().getHeaders(), handlerConfig.getRoles(),binding.getKnownHeaders());
    if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) {
        return super.processResponse(response);
    }
    throw createMUSOAPFaultException(misUnderstoodHeaders);
}
 
Example #3
Source File: ClientMUTube.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Do MU Header Processing on incoming message (response)
 *
 * @return
 *         if all the headers in the packet are understood, returns an action to
 *         call the previous pipes with response packet
 * @throws SOAPFaultException
 *         if all the headers in the packet are not understood, throws SOAPFaultException
 */
@Override @NotNull
public NextAction processResponse(Packet response) {
    if (response.getMessage() == null) {
        return super.processResponse(response);
    }
    HandlerConfiguration handlerConfig = response.handlerConfig;

    if (handlerConfig == null) {
        //Use from binding instead of defaults in case response packet does not have it,
        //may have been changed from the time of invocation, it ok as its only fallback case.
        handlerConfig = binding.getHandlerConfig();
    }
    Set<QName> misUnderstoodHeaders = getMisUnderstoodHeaders(response.getMessage().getHeaders(), handlerConfig.getRoles(),binding.getKnownHeaders());
    if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) {
        return super.processResponse(response);
    }
    throw createMUSOAPFaultException(misUnderstoodHeaders);
}
 
Example #4
Source File: ClientMUTube.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Do MU Header Processing on incoming message (response)
 *
 * @return
 *         if all the headers in the packet are understood, returns an action to
 *         call the previous pipes with response packet
 * @throws SOAPFaultException
 *         if all the headers in the packet are not understood, throws SOAPFaultException
 */
@Override @NotNull
public NextAction processResponse(Packet response) {
    if (response.getMessage() == null) {
        return super.processResponse(response);
    }
    HandlerConfiguration handlerConfig = response.handlerConfig;

    if (handlerConfig == null) {
        //Use from binding instead of defaults in case response packet does not have it,
        //may have been changed from the time of invocation, it ok as its only fallback case.
        handlerConfig = binding.getHandlerConfig();
    }
    Set<QName> misUnderstoodHeaders = getMisUnderstoodHeaders(response.getMessage().getHeaders(), handlerConfig.getRoles(),binding.getKnownHeaders());
    if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) {
        return super.processResponse(response);
    }
    throw createMUSOAPFaultException(misUnderstoodHeaders);
}
 
Example #5
Source File: ClientMUTube.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Do MU Header Processing on incoming message (response)
 *
 * @return
 *         if all the headers in the packet are understood, returns an action to
 *         call the previous pipes with response packet
 * @throws SOAPFaultException
 *         if all the headers in the packet are not understood, throws SOAPFaultException
 */
@Override @NotNull
public NextAction processResponse(Packet response) {
    if (response.getMessage() == null) {
        return super.processResponse(response);
    }
    HandlerConfiguration handlerConfig = response.handlerConfig;

    if (handlerConfig == null) {
        //Use from binding instead of defaults in case response packet does not have it,
        //may have been changed from the time of invocation, it ok as its only fallback case.
        handlerConfig = binding.getHandlerConfig();
    }
    Set<QName> misUnderstoodHeaders = getMisUnderstoodHeaders(response.getMessage().getHeaders(), handlerConfig.getRoles(),binding.getKnownHeaders());
    if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) {
        return super.processResponse(response);
    }
    throw createMUSOAPFaultException(misUnderstoodHeaders);
}
 
Example #6
Source File: ClientMUTube.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Do MU Header Processing on incoming message (response)
 *
 * @return
 *         if all the headers in the packet are understood, returns an action to
 *         call the previous pipes with response packet
 * @throws SOAPFaultException
 *         if all the headers in the packet are not understood, throws SOAPFaultException
 */
@Override @NotNull
public NextAction processResponse(Packet response) {
    if (response.getMessage() == null) {
        return super.processResponse(response);
    }
    HandlerConfiguration handlerConfig = response.handlerConfig;

    if (handlerConfig == null) {
        //Use from binding instead of defaults in case response packet does not have it,
        //may have been changed from the time of invocation, it ok as its only fallback case.
        handlerConfig = binding.getHandlerConfig();
    }
    Set<QName> misUnderstoodHeaders = getMisUnderstoodHeaders(response.getMessage().getHeaders(), handlerConfig.getRoles(),binding.getKnownHeaders());
    if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) {
        return super.processResponse(response);
    }
    throw createMUSOAPFaultException(misUnderstoodHeaders);
}
 
Example #7
Source File: BindingImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected BindingImpl(BindingID bindingId, WebServiceFeature ... features) {
    this.bindingId = bindingId;
    handlerConfig = new HandlerConfiguration(Collections.<String>emptySet(), Collections.<Handler>emptyList());
    if (handlerConfig.getHandlerKnownHeaders() != null)
        knownHeaders.addAll(handlerConfig.getHandlerKnownHeaders());
    this.features = new WebServiceFeatureList(features);
    this.features.validate();
}
 
Example #8
Source File: ClientMessageHandlerTube.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
            List<MessageHandler> msgHandlersSnapShot= handlerConfig.getMessageHandlers();
            if (!msgHandlersSnapShot.isEmpty()) {
                handlers.addAll(msgHandlersSnapShot);
                roles = new HashSet<String>();
                roles.addAll(handlerConfig.getRoles());
                processor = new SOAPHandlerProcessor(true, this, getBinding(), handlers);
            }
    }
}
 
Example #9
Source File: BindingImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected BindingImpl(BindingID bindingId, WebServiceFeature ... features) {
    this.bindingId = bindingId;
    handlerConfig = new HandlerConfiguration(Collections.<String>emptySet(), Collections.<Handler>emptyList());
    if (handlerConfig.getHandlerKnownHeaders() != null)
        knownHeaders.addAll(handlerConfig.getHandlerKnownHeaders());
    this.features = new WebServiceFeatureList(features);
    this.features.validate();
}
 
Example #10
Source File: ClientMessageHandlerTube.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
            List<MessageHandler> msgHandlersSnapShot= handlerConfig.getMessageHandlers();
            if (!msgHandlersSnapShot.isEmpty()) {
                handlers.addAll(msgHandlersSnapShot);
                roles = new HashSet<String>();
                roles.addAll(handlerConfig.getRoles());
                processor = new SOAPHandlerProcessor(true, this, getBinding(), handlers);
            }
    }
}
 
Example #11
Source File: HandlerTube.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void setUpProcessorInternal() {
    HandlerConfiguration hc = ((BindingImpl) binding).getHandlerConfig();
    if (hc != this.hc)
            resetProcessor();
    this.hc = hc;

    setUpProcessor();
}
 
Example #12
Source File: ClientSOAPHandlerTube.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
            List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
            if (!soapSnapShot.isEmpty()) {
                handlers.addAll(soapSnapShot);
                roles = new HashSet<String>();
                roles.addAll(handlerConfig.getRoles());
                processor = new SOAPHandlerProcessor(true, this, getBinding(), handlers);
            }
    }
}
 
Example #13
Source File: ServerSOAPHandlerTube.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void setUpHandlersOnce() {
    handlers = new ArrayList<Handler>();
    HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
    List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
    if (!soapSnapShot.isEmpty()) {
        handlers.addAll(soapSnapShot);
        roles = new HashSet<String>();
        roles.addAll(handlerConfig.getRoles());
    }
}
 
Example #14
Source File: ServerMessageHandlerTube.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void setUpHandlersOnce() {
    handlers = new ArrayList<Handler>();
    HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
    List<MessageHandler> msgHandlersSnapShot= handlerConfig.getMessageHandlers();
    if (!msgHandlersSnapShot.isEmpty()) {
        handlers.addAll(msgHandlersSnapShot);
        roles = new HashSet<String>();
        roles.addAll(handlerConfig.getRoles());
    }
}
 
Example #15
Source File: ClientMessageHandlerTube.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
            List<MessageHandler> msgHandlersSnapShot= handlerConfig.getMessageHandlers();
            if (!msgHandlersSnapShot.isEmpty()) {
                handlers.addAll(msgHandlersSnapShot);
                roles = new HashSet<String>();
                roles.addAll(handlerConfig.getRoles());
                processor = new SOAPHandlerProcessor(true, this, getBinding(), handlers);
            }
    }
}
 
Example #16
Source File: SOAPBindingImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds the next and other roles in case this has
 * been called by a user without them.
 * Creates a new HandlerConfiguration object and sets it on the BindingImpl.
 */
public void setRoles(Set<String> roles) {
    if (roles == null) {
        roles = new HashSet<String>();
    }
    if (roles.contains(ROLE_NONE)) {
        throw new WebServiceException(ClientMessages.INVALID_SOAP_ROLE_NONE());
    }
    addRequiredRoles(roles);
    setHandlerConfig(new HandlerConfiguration(roles, getHandlerConfig()));
}
 
Example #17
Source File: BindingImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected void setHandlerConfig(HandlerConfiguration handlerConfig) {
    this.handlerConfig = handlerConfig;
    knownHeaders.clear();
    knownHeaders.addAll(addedHeaders);
    if (handlerConfig != null && handlerConfig.getHandlerKnownHeaders() != null)
        knownHeaders.addAll(handlerConfig.getHandlerKnownHeaders());
}
 
Example #18
Source File: SOAPBindingImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds the next and other roles in case this has
 * been called by a user without them.
 * Creates a new HandlerConfiguration object and sets it on the BindingImpl.
 */
public void setRoles(Set<String> roles) {
    if (roles == null) {
        roles = new HashSet<String>();
    }
    if (roles.contains(ROLE_NONE)) {
        throw new WebServiceException(ClientMessages.INVALID_SOAP_ROLE_NONE());
    }
    addRequiredRoles(roles);
    setHandlerConfig(new HandlerConfiguration(roles, getHandlerConfig()));
}
 
Example #19
Source File: ServerMessageHandlerTube.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void setUpHandlersOnce() {
    handlers = new ArrayList<Handler>();
    HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
    List<MessageHandler> msgHandlersSnapShot= handlerConfig.getMessageHandlers();
    if (!msgHandlersSnapShot.isEmpty()) {
        handlers.addAll(msgHandlersSnapShot);
        roles = new HashSet<String>();
        roles.addAll(handlerConfig.getRoles());
    }
}
 
Example #20
Source File: HandlerTube.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void setUpProcessorInternal() {
    HandlerConfiguration hc = ((BindingImpl) binding).getHandlerConfig();
    if (hc != this.hc)
            resetProcessor();
    this.hc = hc;

    setUpProcessor();
}
 
Example #21
Source File: HandlerTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void setUpProcessorInternal() {
    HandlerConfiguration hc = ((BindingImpl) binding).getHandlerConfig();
    if (hc != this.hc)
            resetProcessor();
    this.hc = hc;

    setUpProcessor();
}
 
Example #22
Source File: ClientSOAPHandlerTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
            List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
            if (!soapSnapShot.isEmpty()) {
                handlers.addAll(soapSnapShot);
                roles = new HashSet<String>();
                roles.addAll(handlerConfig.getRoles());
                processor = new SOAPHandlerProcessor(true, this, getBinding(), handlers);
            }
    }
}
 
Example #23
Source File: ServerSOAPHandlerTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void setUpHandlersOnce() {
    handlers = new ArrayList<Handler>();
    HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
    List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
    if (!soapSnapShot.isEmpty()) {
        handlers.addAll(soapSnapShot);
        roles = new HashSet<String>();
        roles.addAll(handlerConfig.getRoles());
    }
}
 
Example #24
Source File: ServerMessageHandlerTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void setUpHandlersOnce() {
    handlers = new ArrayList<Handler>();
    HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
    List<MessageHandler> msgHandlersSnapShot= handlerConfig.getMessageHandlers();
    if (!msgHandlersSnapShot.isEmpty()) {
        handlers.addAll(msgHandlersSnapShot);
        roles = new HashSet<String>();
        roles.addAll(handlerConfig.getRoles());
    }
}
 
Example #25
Source File: BindingImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected void setHandlerConfig(HandlerConfiguration handlerConfig) {
    this.handlerConfig = handlerConfig;
    knownHeaders.clear();
    knownHeaders.addAll(addedHeaders);
    if (handlerConfig != null && handlerConfig.getHandlerKnownHeaders() != null)
        knownHeaders.addAll(handlerConfig.getHandlerKnownHeaders());
}
 
Example #26
Source File: SOAPBindingImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds the next and other roles in case this has
 * been called by a user without them.
 * Creates a new HandlerConfiguration object and sets it on the BindingImpl.
 */
public void setRoles(Set<String> roles) {
    if (roles == null) {
        roles = new HashSet<String>();
    }
    if (roles.contains(ROLE_NONE)) {
        throw new WebServiceException(ClientMessages.INVALID_SOAP_ROLE_NONE());
    }
    addRequiredRoles(roles);
    setHandlerConfig(new HandlerConfiguration(roles, getHandlerConfig()));
}
 
Example #27
Source File: ServerMUTube.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public ServerMUTube(ServerTubeAssemblerContext tubeContext, Tube next) {
    super(tubeContext.getEndpoint().getBinding(), next);

    this.tubeContext = tubeContext;

    //On Server, HandlerConfiguration does n't change after publish, so store locally
    HandlerConfiguration handlerConfig = binding.getHandlerConfig();
    roles = handlerConfig.getRoles();
    handlerKnownHeaders = binding.getKnownHeaders();
}
 
Example #28
Source File: BindingImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void setHandlerConfig(HandlerConfiguration handlerConfig) {
    this.handlerConfig = handlerConfig;
    knownHeaders.clear();
    knownHeaders.addAll(addedHeaders);
    if (handlerConfig != null && handlerConfig.getHandlerKnownHeaders() != null)
        knownHeaders.addAll(handlerConfig.getHandlerKnownHeaders());
}
 
Example #29
Source File: BindingImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected BindingImpl(BindingID bindingId, WebServiceFeature ... features) {
    this.bindingId = bindingId;
    handlerConfig = new HandlerConfiguration(Collections.<String>emptySet(), Collections.<Handler>emptyList());
    if (handlerConfig.getHandlerKnownHeaders() != null)
        knownHeaders.addAll(handlerConfig.getHandlerKnownHeaders());
    this.features = new WebServiceFeatureList(features);
    this.features.validate();
}
 
Example #30
Source File: HTTPBindingImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This method separates the logical and protocol handlers and
 * sets the HandlerConfiguration.
 * Only logical handlers are allowed with HTTPBinding.
 * Setting SOAPHandlers throws WebServiceException
 */
public void setHandlerChain(List<Handler> chain) {
    for (Handler handler : chain) {
        if (!(handler instanceof LogicalHandler)) {
            throw new WebServiceException(ClientMessages.NON_LOGICAL_HANDLER_SET(handler.getClass()));
        }
    }
    setHandlerConfig(new HandlerConfiguration(Collections.<String>emptySet(), chain));
}