From da629278e6decc610804fa7a1e9508e9e8e40deb Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Mon, 14 Apr 2014 16:07:59 +0200 Subject: [PATCH] Added @Override annotation to interface implementations --- .../core/SimpleFaultMessageResolver.java | 3 +- .../ws/client/core/WebServiceTemplate.java | 28 +++++++++++--- .../support/WebServiceGatewaySupport.java | 3 +- .../ws/client/support/WebServiceAccessor.java | 3 +- .../AbstractCachingDestinationProvider.java | 3 +- .../AbstractValidatingInterceptor.java | 11 ++++-- .../AnnotationDrivenBeanDefinitionParser.java | 9 +++-- .../InterceptorsBeanDefinitionParser.java | 9 +++-- .../config/WebServicesNamespaceHandler.java | 5 ++- .../ws/context/AbstractMessageContext.java | 7 +++- .../ws/context/DefaultMessageContext.java | 8 +++- .../ws/mime/AbstractMimeMessage.java | 8 +++- .../ws/pox/dom/DomPoxMessage.java | 13 ++++--- .../ws/pox/dom/DomPoxMessageFactory.java | 4 +- .../ws/server/MessageDispatcher.java | 13 ++++--- .../AbstractDom4jPayloadEndpoint.java | 7 ++-- .../endpoint/AbstractDomPayloadEndpoint.java | 3 +- .../AbstractEndpointExceptionResolver.java | 10 +++-- .../endpoint/AbstractJDomPayloadEndpoint.java | 9 +++-- .../endpoint/AbstractLoggingInterceptor.java | 14 ++++--- .../AbstractMarshallingPayloadEndpoint.java | 10 +++-- .../endpoint/AbstractSaxPayloadEndpoint.java | 7 ++-- .../AbstractStaxEventPayloadEndpoint.java | 12 +++++- .../AbstractStaxStreamPayloadEndpoint.java | 35 ++++++++++++++++- .../endpoint/AbstractXomPayloadEndpoint.java | 20 +++++++--- .../AbstractMethodEndpointAdapter.java | 4 +- .../adapter/DefaultMethodEndpointAdapter.java | 6 ++- .../MarshallingMethodEndpointAdapter.java | 5 ++- .../adapter/MessageEndpointAdapter.java | 4 +- .../adapter/PayloadEndpointAdapter.java | 4 +- ...hParamAnnotationMethodEndpointAdapter.java | 13 ++++--- .../AbstractPayloadMethodProcessor.java | 4 +- .../AbstractPayloadSourceMethodProcessor.java | 4 +- .../MarshallingPayloadMethodProcessor.java | 6 ++- .../MessageContextMethodArgumentResolver.java | 4 +- .../StaxPayloadMethodArgumentResolver.java | 4 +- .../XPathParamMethodArgumentResolver.java | 16 ++++---- .../AbstractJaxb2PayloadMethodProcessor.java | 27 ++++++++++++- .../JaxbElementPayloadMethodProcessor.java | 3 +- .../XmlRootElementPayloadMethodProcessor.java | 3 +- .../AbstractValidatingInterceptor.java | 9 ++++- .../DelegatingSmartEndpointInterceptor.java | 9 ++++- .../EndpointInterceptorAdapter.java | 14 ++++--- .../PayloadTransformingInterceptor.java | 19 ++++++---- .../mapping/AbstractEndpointMapping.java | 6 ++- .../mapping/SimpleMethodEndpointMapping.java | 3 +- .../mapping/XPathPayloadEndpointMapping.java | 7 ++-- .../endpoint/support/PayloadRootUtils.java | 17 ++++++--- .../ws/soap/AbstractSoapMessage.java | 9 ++++- .../ws/soap/SoapMessageFactory.java | 4 +- .../addressing/client/ActionCallback.java | 3 +- .../messageid/UuidMessageIdStrategy.java | 4 +- .../server/AbstractActionEndpointMapping.java | 3 +- .../AbstractAddressingEndpointMapping.java | 10 ++++- .../server/AddressingEndpointInterceptor.java | 15 +++++--- .../AnnotationActionEndpointMapping.java | 6 ++- .../version/AbstractAddressingVersion.java | 17 ++++++--- .../soap/addressing/version/Addressing10.java | 3 +- .../addressing/version/Addressing200408.java | 3 +- .../ws/soap/axiom/AxiomAttachment.java | 7 +++- .../ws/soap/axiom/AxiomHandler.java | 22 ++++++++++- .../ws/soap/axiom/AxiomSoap11Body.java | 22 +++++++---- .../ws/soap/axiom/AxiomSoap11Fault.java | 6 ++- .../ws/soap/axiom/AxiomSoap11Header.java | 11 +++--- .../ws/soap/axiom/AxiomSoap12Body.java | 18 ++++++--- .../ws/soap/axiom/AxiomSoap12Fault.java | 20 +++++++--- .../ws/soap/axiom/AxiomSoap12Header.java | 17 +++++---- .../ws/soap/axiom/AxiomSoapBody.java | 15 +++++--- .../ws/soap/axiom/AxiomSoapElement.java | 9 ++++- .../ws/soap/axiom/AxiomSoapEnvelope.java | 4 +- .../ws/soap/axiom/AxiomSoapFault.java | 7 +++- .../ws/soap/axiom/AxiomSoapFaultDetail.java | 14 +++++-- .../axiom/AxiomSoapFaultDetailElement.java | 4 +- .../ws/soap/axiom/AxiomSoapHeader.java | 21 +++++++--- .../ws/soap/axiom/AxiomSoapHeaderElement.java | 9 ++++- .../ws/soap/axiom/AxiomSoapMessage.java | 19 +++++++++- .../soap/axiom/AxiomSoapMessageFactory.java | 34 +++++++++-------- .../ws/soap/axiom/NonCachingPayload.java | 38 +++++++++++++++++-- .../ws/soap/axiom/StreamingOMDataSource.java | 14 ++++--- .../soap/client/core/SoapActionCallback.java | 3 +- .../client/core/SoapFaultMessageResolver.java | 3 +- .../ws/soap/saaj/SaajAttachment.java | 7 +++- .../ws/soap/saaj/SaajSoap11Body.java | 8 +++- .../ws/soap/saaj/SaajSoap11Fault.java | 6 ++- .../ws/soap/saaj/SaajSoap11Header.java | 3 +- .../ws/soap/saaj/SaajSoap12Body.java | 8 +++- .../ws/soap/saaj/SaajSoap12Fault.java | 11 +++++- .../ws/soap/saaj/SaajSoap12Header.java | 5 ++- .../ws/soap/saaj/SaajSoapEnvelope.java | 4 +- .../ws/soap/saaj/SaajSoapFaultDetail.java | 8 +++- .../soap/saaj/SaajSoapFaultDetailElement.java | 4 +- .../ws/soap/saaj/SaajSoapMessageFactory.java | 8 +++- .../soap/saaj/support/SaajContentHandler.java | 19 ++++++++-- .../ws/soap/saaj/support/SaajXmlReader.java | 10 +++-- ...gValidatingMarshallingPayloadEndpoint.java | 3 +- ...apHeaderElementMethodArgumentResolver.java | 4 +- .../method/SoapMethodArgumentResolver.java | 4 +- ...elegatingSmartSoapEndpointInterceptor.java | 5 ++- .../SoapEnvelopeLoggingInterceptor.java | 3 +- .../DelegatingSoapEndpointMapping.java | 7 +++- ...ActionAnnotationMethodEndpointMapping.java | 7 +++- .../mapping/SoapActionEndpointMapping.java | 7 +++- .../ws/soap/soap11/Soap11Body.java | 7 +++- .../ws/soap/soap12/Soap12Body.java | 7 +++- .../ws/support/MarshallingUtils.java | 6 ++- .../AbstractWebServiceConnection.java | 5 ++- .../context/DefaultTransportContext.java | 3 +- .../http/AbstractHttpSenderConnection.java | 6 ++- .../AbstractHttpWebServiceMessageSender.java | 3 +- .../http/ClientHttpRequestConnection.java | 5 +-- .../http/ClientHttpRequestMessageSender.java | 3 +- .../transport/http/CommonsHttpConnection.java | 13 ++++--- .../http/CommonsHttpMessageSender.java | 17 +++++---- .../http/HttpComponentsConnection.java | 13 ++++--- .../http/HttpComponentsMessageSender.java | 6 ++- .../transport/http/HttpServletConnection.java | 8 +++- .../ws/transport/http/HttpUrlConnection.java | 3 +- .../http/HttpUrlConnectionMessageSender.java | 3 +- ...bServiceMessageReceiverHandlerAdapter.java | 7 +++- .../http/WsdlDefinitionHandlerAdapter.java | 12 ++++-- .../http/XsdSchemaHandlerAdapter.java | 12 ++++-- .../support/EnumerationIterator.java | 5 ++- ...ebServiceMessageReceiverObjectSupport.java | 9 +++-- .../wsdl/wsdl11/DefaultWsdl11Definition.java | 6 ++- .../wsdl11/ProviderBasedWsdl4jDefinition.java | 3 +- .../wsdl/wsdl11/SimpleWsdl11Definition.java | 4 +- .../ws/wsdl/wsdl11/Wsdl4jDefinition.java | 7 ++-- .../provider/AbstractPortTypesProvider.java | 9 +++-- .../provider/DefaultConcretePartProvider.java | 12 +++--- .../provider/DefaultMessagesProvider.java | 7 ++-- .../InliningXsdSchemaTypesProvider.java | 3 +- .../ws/wsdl/wsdl11/provider/SoapProvider.java | 6 ++- .../ws/MockWebServiceMessage.java | 7 +++- .../ws/MockWebServiceMessageFactory.java | 4 +- .../ws/config/DummyInterceptor.java | 8 +++- .../ws/config/DummyMarshaller.java | 5 ++- .../ws/config/MyInterceptor.java | 8 +++- .../MarshallingPayloadEndpointTest.java | 20 +++++----- .../PayloadLoggingInterceptorTest.java | 16 ++++---- .../mapping/JdkProxyRegistrationTest.java | 16 ++++---- ...idatingMarshallingPayloadEndpointTest.java | 15 +++++--- .../SoapEnvelopeLoggingInterceptorTest.java | 14 ++++--- .../support/DefaultStrategiesHelperTest.java | 9 +++-- .../AbstractWsSecurityInterceptor.java | 18 ++++++--- .../callback/AbstractCallbackHandler.java | 3 +- .../support/KeyManagersFactoryBean.java | 8 +++- .../security/support/KeyStoreFactoryBean.java | 12 ++++-- .../wss4j/Wss4jSecurityInterceptor.java | 3 +- .../callback/KeyStoreCallbackHandler.java | 9 +++-- ...mplePasswordValidationCallbackHandler.java | 9 +++-- ...rityPasswordValidationCallbackHandler.java | 11 +++--- .../wss4j/support/CryptoFactoryBean.java | 17 ++++++--- .../x509/X509AuthenticationProvider.java | 12 ++++-- .../x509/X509AuthenticationToken.java | 6 ++- .../x509/cache/EhCacheBasedX509UserCache.java | 16 +++++--- .../x509/cache/NullX509UserCache.java | 5 ++- .../DaoX509AuthoritiesPopulator.java | 33 ++++++++-------- .../security/xwss/XwsSecurityInterceptor.java | 4 +- .../callback/DefaultTimestampValidator.java | 3 +- .../callback/KeyStoreCallbackHandler.java | 4 +- .../MockValidationCallbackHandler.java | 4 +- ...mplePasswordValidationCallbackHandler.java | 10 +++-- ...SimpleUsernamePasswordCallbackHandler.java | 9 +++-- ...gCertificateValidationCallbackHandler.java | 8 ++-- ...gestPasswordValidationCallbackHandler.java | 7 ++-- ...TextPasswordValidationCallbackHandler.java | 8 ++-- .../callback/XwssCallbackHandlerChain.java | 5 ++- ...AbstractJaasValidationCallbackHandler.java | 3 +- ...sCertificateValidationCallbackHandler.java | 3 +- ...TextPasswordValidationCallbackHandler.java | 3 +- .../callback/jaas/CertificateLoginModule.java | 7 +++- .../callback/jaas/PlainTextLoginModule.java | 8 +++- .../xwss/callback/jaas/SimplePrincipal.java | 3 +- .../http/HttpExchangeConnection.java | 12 ++++-- .../http/HttpsUrlConnectionMessageSender.java | 5 ++- .../WebServiceMessageReceiverHttpHandler.java | 3 +- .../http/WsdlDefinitionHttpHandler.java | 4 +- .../ws/transport/jms/JmsMessageSender.java | 6 ++- .../transport/jms/JmsReceiverConnection.java | 5 ++- .../ws/transport/jms/JmsSenderConnection.java | 7 +++- .../jms/WebServiceMessageListener.java | 3 +- .../transport/mail/MailMessageReceiver.java | 6 ++- .../ws/transport/mail/MailMessageSender.java | 5 ++- .../mail/MailReceiverConnection.java | 9 ++++- .../transport/mail/MailSenderConnection.java | 15 ++++++-- .../monitor/AbstractMonitoringStrategy.java | 4 +- ...bstractAsyncStandaloneMessageReceiver.java | 3 +- .../AbstractStandaloneMessageReceiver.java | 6 ++- .../transport/xmpp/XmppMessageReceiver.java | 7 ++-- .../ws/transport/xmpp/XmppMessageSender.java | 9 +++-- .../xmpp/XmppReceiverConnection.java | 11 ++++-- .../transport/xmpp/XmppSenderConnection.java | 15 +++++--- .../support/XmppConnectionFactoryBean.java | 15 +++++--- .../SimpleTestingMessageReceiver.java | 3 +- .../ws/transport/http/FaultEndpoint.java | 3 +- .../ws/transport/http/NoResponseEndpoint.java | 3 +- .../ws/transport/http/ResponseEndpoint.java | 3 +- .../support/EchoPayloadEndpoint.java | 3 +- .../test/client/AbstractResponseCreator.java | 3 +- .../ws/test/client/ErrorResponseCreator.java | 3 +- .../test/client/ExceptionResponseCreator.java | 3 +- .../ws/test/client/MockSenderConnection.java | 10 ++++- .../client/MockWebServiceMessageSender.java | 4 +- .../ws/test/client/ResponseCreators.java | 5 ++- .../ws/test/client/UriMatcher.java | 9 +++-- .../WebServiceMessageMatcherAdapter.java | 3 +- .../XPathExpectationsHelperAdapter.java | 8 +++- .../ws/test/server/MockWebServiceClient.java | 14 +++---- .../ws/test/server/RequestCreators.java | 5 ++- .../test/server/SoapFaultResponseMatcher.java | 9 +++-- .../WebServiceMessageMatcherAdapter.java | 3 +- .../XPathExpectationsHelperAdapter.java | 8 +++- .../creator/AbstractMessageCreator.java | 3 +- .../matcher/AbstractSoapMessageMatcher.java | 7 ++-- .../ws/test/support/matcher/DiffMatcher.java | 10 ++--- .../matcher/SchemaValidatingMatcher.java | 12 +++--- .../xml/dom/DomContentHandler.java | 17 +++++++-- .../xml/namespace/SimpleNamespaceContext.java | 7 +++- .../xml/sax/AbstractXmlReader.java | 14 ++++++- .../validation/Jaxp13ValidatorFactory.java | 14 +++++-- .../xml/xpath/AbstractXPathTemplate.java | 8 ++-- .../xpath/JaxenXPathExpressionFactory.java | 9 ++++- .../xml/xpath/JaxenXPathTemplate.java | 9 ++++- .../xpath/Jaxp13XPathExpressionFactory.java | 13 +++++-- .../xml/xpath/Jaxp13XPathTemplate.java | 28 ++++++++++---- .../xml/xpath/XPathExpressionFactoryBean.java | 6 ++- .../xml/xsd/SimpleXsdSchema.java | 8 +++- .../xml/xsd/commons/CommonsXsdSchema.java | 7 +++- .../commons/CommonsXsdSchemaCollection.java | 8 +++- .../validation/XmlValidatorFactoryTest.java | 10 +++-- 230 files changed, 1407 insertions(+), 598 deletions(-) diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/core/SimpleFaultMessageResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/client/core/SimpleFaultMessageResolver.java index 908227ef..f5908ed1 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/core/SimpleFaultMessageResolver.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/core/SimpleFaultMessageResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ import org.springframework.ws.client.WebServiceFaultException; public class SimpleFaultMessageResolver implements FaultMessageResolver { /** Throws a new WebServiceFaultException. */ + @Override public void resolveFault(WebServiceMessage message) { if (message instanceof FaultAwareWebServiceMessage) { throw new WebServiceFaultException((FaultAwareWebServiceMessage) message); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceTemplate.java b/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceTemplate.java index 6cb9edb6..c087facf 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceTemplate.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceTemplate.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -26,6 +26,9 @@ import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.beans.factory.BeanInitializationException; import org.springframework.oxm.Marshaller; import org.springframework.oxm.Unmarshaller; @@ -56,9 +59,6 @@ import org.springframework.ws.transport.context.TransportContextHolder; import org.springframework.ws.transport.http.HttpUrlConnectionMessageSender; import org.springframework.ws.transport.support.TransportUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * The central class for client-side Web services. It provides a message-driven approach to sending and * receiving {@link WebServiceMessage} instances. @@ -368,18 +368,22 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService // Marshalling methods // + @Override public Object marshalSendAndReceive(final Object requestPayload) { return marshalSendAndReceive(requestPayload, null); } + @Override public Object marshalSendAndReceive(String uri, final Object requestPayload) { return marshalSendAndReceive(uri, requestPayload, null); } + @Override public Object marshalSendAndReceive(final Object requestPayload, final WebServiceMessageCallback requestCallback) { return marshalSendAndReceive(getDefaultUri(), requestPayload, requestCallback); } + @Override public Object marshalSendAndReceive(String uri, final Object requestPayload, final WebServiceMessageCallback requestCallback) { @@ -415,20 +419,24 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService // Result-handling methods // + @Override public boolean sendSourceAndReceiveToResult(Source requestPayload, Result responseResult) { return sendSourceAndReceiveToResult(requestPayload, null, responseResult); } + @Override public boolean sendSourceAndReceiveToResult(String uri, Source requestPayload, Result responseResult) { return sendSourceAndReceiveToResult(uri, requestPayload, null, responseResult); } + @Override public boolean sendSourceAndReceiveToResult(Source requestPayload, WebServiceMessageCallback requestCallback, final Result responseResult) { return sendSourceAndReceiveToResult(getDefaultUri(), requestPayload, requestCallback, responseResult); } + @Override public boolean sendSourceAndReceiveToResult(String uri, Source requestPayload, WebServiceMessageCallback requestCallback, @@ -456,22 +464,26 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService // Source-handling methods // + @Override public T sendSourceAndReceive(final Source requestPayload, final SourceExtractor responseExtractor) { return sendSourceAndReceive(requestPayload, null, responseExtractor); } + @Override public T sendSourceAndReceive(String uri, final Source requestPayload, final SourceExtractor responseExtractor) { return sendSourceAndReceive(uri, requestPayload, null, responseExtractor); } + @Override public T sendSourceAndReceive(final Source requestPayload, final WebServiceMessageCallback requestCallback, final SourceExtractor responseExtractor) { return sendSourceAndReceive(getDefaultUri(), requestPayload, requestCallback, responseExtractor); } + @Override public T sendSourceAndReceive(String uri, final Source requestPayload, final WebServiceMessageCallback requestCallback, @@ -505,11 +517,13 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService // WebServiceMessage-handling methods // + @Override public boolean sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessageCallback responseCallback) { return sendAndReceive(getDefaultUri(), requestCallback, responseCallback); } + @Override public boolean sendAndReceive(String uri, WebServiceMessageCallback requestCallback, WebServiceMessageCallback responseCallback) { @@ -519,11 +533,13 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService return result != null && result; } + @Override public T sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessageExtractor responseExtractor) { return sendAndReceive(getDefaultUri(), requestCallback, responseExtractor); } + @Override public T sendAndReceive(String uriString, WebServiceMessageCallback requestCallback, WebServiceMessageExtractor responseExtractor) { @@ -824,6 +840,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService this.callback = callback; } + @Override public Boolean extractData(WebServiceMessage message) throws IOException, TransformerException { callback.doWithMessage(message); return Boolean.TRUE; @@ -839,6 +856,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService this.sourceExtractor = sourceExtractor; } + @Override public T extractData(WebServiceMessage message) throws IOException, TransformerException { return sourceExtractor.extractData(message.getPayloadSource()); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/core/support/WebServiceGatewaySupport.java b/spring-ws-core/src/main/java/org/springframework/ws/client/core/support/WebServiceGatewaySupport.java index 70fe2bf0..b734bd69 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/core/support/WebServiceGatewaySupport.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/core/support/WebServiceGatewaySupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -177,6 +177,7 @@ public abstract class WebServiceGatewaySupport implements InitializingBean { webServiceTemplate.setInterceptors(interceptors); } + @Override public final void afterPropertiesSet() throws Exception { webServiceTemplate.afterPropertiesSet(); initGateway(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/WebServiceAccessor.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/WebServiceAccessor.java index 8b332508..9c46c5ab 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/WebServiceAccessor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/WebServiceAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,6 +82,7 @@ public abstract class WebServiceAccessor extends TransformerObjectSupport implem this.messageSenders = messageSenders; } + @Override public void afterPropertiesSet() { Assert.notNull(getMessageFactory(), "Property 'messageFactory' is required"); Assert.notEmpty(getMessageSenders(), "Property 'messageSenders' is required"); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/AbstractCachingDestinationProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/AbstractCachingDestinationProvider.java index a0659042..6cb28790 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/AbstractCachingDestinationProvider.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/AbstractCachingDestinationProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,6 +48,7 @@ public abstract class AbstractCachingDestinationProvider implements DestinationP this.cache = cache; } + @Override public final URI getDestination() { if (cache) { if (cachedUri == null) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/AbstractValidatingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/AbstractValidatingInterceptor.java index e44ae575..26019aaf 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/AbstractValidatingInterceptor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/AbstractValidatingInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ package org.springframework.ws.client.support.interceptor; import java.io.IOException; import javax.xml.transform.Source; +import org.xml.sax.SAXParseException; + import org.springframework.beans.factory.InitializingBean; import org.springframework.core.io.Resource; import org.springframework.util.Assert; @@ -34,8 +36,6 @@ import org.springframework.xml.validation.XmlValidatorFactory; import org.springframework.xml.xsd.XsdSchema; import org.springframework.xml.xsd.XsdSchemaCollection; -import org.xml.sax.SAXParseException; - /** * Abstract base class for {@link ClientInterceptor} implementations that validate part of the message using a schema. * The exact message part is determined by the {@link #getValidationRequestSource(WebServiceMessage)} and {@link @@ -138,6 +138,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup this.validateResponse = validateResponse; } + @Override public void afterPropertiesSet() throws Exception { if (validator == null && !ObjectUtils.isEmpty(schemas)) { Assert.hasLength(schemaLanguage, "schemaLanguage is required"); @@ -162,6 +163,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup * @return true if the message is valid; false otherwise * @see #setValidateRequest(boolean) */ + @Override public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException { if (validateRequest) { Source requestSource = getValidationRequestSource(messageContext.getRequest()); @@ -212,6 +214,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup * @return true if the response is valid; false otherwise * @see #setValidateResponse(boolean) */ + @Override public boolean handleResponse(MessageContext messageContext) throws WebServiceClientException { if (validateResponse) { Source responseSource = getValidationResponseSource(messageContext.getResponse()); @@ -253,11 +256,13 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup } /** Does nothing by default. Faults are not validated. */ + @Override public boolean handleFault(MessageContext messageContext) throws WebServiceClientException { return true; } /** Does nothing by default.*/ + @Override public void afterCompletion(MessageContext messageContext, Exception ex) throws WebServiceClientException { } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParser.java b/spring-ws-core/src/main/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParser.java index c8ba1c76..225ef391 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParser.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParser.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -16,6 +16,8 @@ package org.springframework.ws.config; +import org.w3c.dom.Element; + import org.springframework.beans.BeanMetadataElement; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.RuntimeBeanReference; @@ -47,8 +49,6 @@ import org.springframework.ws.soap.server.endpoint.adapter.method.SoapHeaderElem import org.springframework.ws.soap.server.endpoint.adapter.method.SoapMethodArgumentResolver; import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping; -import org.w3c.dom.Element; - /** * {@link BeanDefinitionParser} that parses the {@code annotation-driven} element to configure a Spring WS application. * @@ -72,6 +72,7 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser { private static final boolean xomPresent = ClassUtils.isPresent("nu.xom.Element", AnnotationDrivenBeanDefinitionParser.class.getClassLoader()); + @Override public BeanDefinition parse(Element element, ParserContext parserContext) { Object source = parserContext.extractSource(element); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/InterceptorsBeanDefinitionParser.java b/spring-ws-core/src/main/java/org/springframework/ws/config/InterceptorsBeanDefinitionParser.java index a8f52e4d..5fa7df63 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/config/InterceptorsBeanDefinitionParser.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/config/InterceptorsBeanDefinitionParser.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -18,6 +18,8 @@ package org.springframework.ws.config; import java.util.List; +import org.w3c.dom.Element; + import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.config.BeanReference; @@ -34,8 +36,6 @@ import org.springframework.ws.soap.server.endpoint.interceptor.DelegatingSmartSo import org.springframework.ws.soap.server.endpoint.interceptor.PayloadRootSmartSoapEndpointInterceptor; import org.springframework.ws.soap.server.endpoint.interceptor.SoapActionSmartEndpointInterceptor; -import org.w3c.dom.Element; - /** * Parser for the {@code <sws:interceptors/>} element. * @@ -44,6 +44,7 @@ import org.w3c.dom.Element; */ class InterceptorsBeanDefinitionParser implements BeanDefinitionParser { + @Override public BeanDefinition parse(Element element, ParserContext parserContext) { CompositeComponentDefinition compDefinition = new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element)); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java b/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java index eca24e15..d4a4385c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -27,6 +27,7 @@ import org.springframework.beans.factory.xml.NamespaceHandlerSupport; */ public class WebServicesNamespaceHandler extends NamespaceHandlerSupport { + @Override public void init() { registerBeanDefinitionParser("annotation-driven", new AnnotationDrivenBeanDefinitionParser()); registerBeanDefinitionParser("interceptors", new InterceptorsBeanDefinitionParser()); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/context/AbstractMessageContext.java b/spring-ws-core/src/main/java/org/springframework/ws/context/AbstractMessageContext.java index ca8385f0..a701a5ad 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/context/AbstractMessageContext.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/context/AbstractMessageContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,22 +35,27 @@ public abstract class AbstractMessageContext implements MessageContext { */ private Map properties; + @Override public boolean containsProperty(String name) { return getProperties().containsKey(name); } + @Override public Object getProperty(String name) { return getProperties().get(name); } + @Override public String[] getPropertyNames() { return StringUtils.toStringArray(getProperties().keySet()); } + @Override public void removeProperty(String name) { getProperties().remove(name); } + @Override public void setProperty(String name, Object value) { getProperties().put(name, value); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/context/DefaultMessageContext.java b/spring-ws-core/src/main/java/org/springframework/ws/context/DefaultMessageContext.java index cd76af54..4a514f4b 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/context/DefaultMessageContext.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/context/DefaultMessageContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,14 +53,17 @@ public class DefaultMessageContext extends AbstractMessageContext { this.messageFactory = messageFactory; } + @Override public WebServiceMessage getRequest() { return request; } + @Override public boolean hasResponse() { return response != null; } + @Override public WebServiceMessage getResponse() { if (response == null) { response = messageFactory.createWebServiceMessage(); @@ -68,15 +71,18 @@ public class DefaultMessageContext extends AbstractMessageContext { return response; } + @Override public void setResponse(WebServiceMessage response) { checkForResponse(); this.response = response; } + @Override public void clearResponse() { response = null; } + @Override public void readResponse(InputStream inputStream) throws IOException { checkForResponse(); response = messageFactory.createWebServiceMessage(inputStream); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/mime/AbstractMimeMessage.java b/spring-ws-core/src/main/java/org/springframework/ws/mime/AbstractMimeMessage.java index a26a51b9..1c35fc1f 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/mime/AbstractMimeMessage.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/mime/AbstractMimeMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ import org.springframework.util.Assert; */ public abstract class AbstractMimeMessage implements MimeMessage { + @Override public final Attachment addAttachment(String contentId, File file) throws AttachmentException { Assert.hasLength(contentId, "contentId must not be empty"); Assert.notNull(file, "File must not be null"); @@ -43,6 +44,7 @@ public abstract class AbstractMimeMessage implements MimeMessage { return addAttachment(contentId, dataHandler); } + @Override public final Attachment addAttachment(String contentId, InputStreamSource inputStreamSource, String contentType) { Assert.hasLength(contentId, "contentId must not be empty"); Assert.notNull(inputStreamSource, "InputStreamSource must not be null"); @@ -71,18 +73,22 @@ public abstract class AbstractMimeMessage implements MimeMessage { this.contentType = contentType; } + @Override public InputStream getInputStream() throws IOException { return inputStreamSource.getInputStream(); } + @Override public OutputStream getOutputStream() { throw new UnsupportedOperationException("Read-only javax.activation.DataSource"); } + @Override public String getContentType() { return contentType; } + @Override public String getName() { if (inputStreamSource instanceof Resource) { Resource resource = (Resource) inputStreamSource; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessage.java b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessage.java index 3afb834a..bf9bb134 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessage.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,16 +26,16 @@ import javax.xml.transform.dom.DOMResult; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + import org.springframework.util.Assert; import org.springframework.ws.pox.PoxMessage; import org.springframework.ws.transport.TransportConstants; import org.springframework.ws.transport.TransportOutputStream; import org.springframework.xml.namespace.QNameUtils; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - /** * Implementation of the PoxMessage interface that is based on a DOM Document. * @@ -70,6 +70,7 @@ public class DomPoxMessage implements PoxMessage { return document; } + @Override public Result getPayloadResult() { NodeList children = document.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { @@ -78,6 +79,7 @@ public class DomPoxMessage implements PoxMessage { return new DOMResult(document); } + @Override public Source getPayloadSource() { return new DOMSource(document); } @@ -100,6 +102,7 @@ public class DomPoxMessage implements PoxMessage { return builder.toString(); } + @Override public void writeTo(OutputStream outputStream) throws IOException { try { if (outputStream instanceof TransportOutputStream) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java index 84e6ef79..26c07220 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,6 +76,7 @@ public class DomPoxMessageFactory extends TransformerObjectSupport implements We documentBuilderFactory.setExpandEntityReferences(expandEntityRef); } + @Override public DomPoxMessage createWebServiceMessage() { try { DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); @@ -90,6 +91,7 @@ public class DomPoxMessageFactory extends TransformerObjectSupport implements We } } + @Override public DomPoxMessage createWebServiceMessage(InputStream inputStream) throws IOException { try { DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/MessageDispatcher.java b/spring-ws-core/src/main/java/org/springframework/ws/server/MessageDispatcher.java index 9203bfaf..6c4b07a2 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/MessageDispatcher.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/MessageDispatcher.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,6 +23,9 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactoryUtils; import org.springframework.beans.factory.BeanNameAware; @@ -44,9 +47,6 @@ import org.springframework.ws.soap.server.SoapMessageDispatcher; import org.springframework.ws.support.DefaultStrategiesHelper; import org.springframework.ws.transport.WebServiceMessageReceiver; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Central dispatcher for use within Spring-WS, dispatching Web service messages to registered endpoints. *

@@ -148,16 +148,19 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa this.endpointMappings = endpointMappings; } + @Override public final void setBeanName(String beanName) { this.beanName = beanName; } + @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { initEndpointAdapters(applicationContext); initEndpointExceptionResolvers(applicationContext); initEndpointMappings(applicationContext); } + @Override public void receive(MessageContext messageContext) throws Exception { // Let's keep a reference to the request content as it came in, it might be changed by interceptors in dispatch() String requestContent = ""; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDom4jPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDom4jPayloadEndpoint.java index 2203ec2f..1659a781 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDom4jPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDom4jPayloadEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,6 @@ import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.dom.DOMSource; -import org.springframework.xml.transform.TransformerObjectSupport; - import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; @@ -30,6 +28,8 @@ import org.dom4j.io.DocumentResult; import org.dom4j.io.DocumentSource; import org.w3c.dom.Node; +import org.springframework.xml.transform.TransformerObjectSupport; + /** * Abstract base class for endpoints that handle the message payload as dom4j elements. Offers the message payload as a * dom4j Element, and allows subclasses to create a response by returning an Element. @@ -56,6 +56,7 @@ public abstract class AbstractDom4jPayloadEndpoint extends TransformerObjectSupp this.alwaysTransform = alwaysTransform; } + @Override public final Source invoke(Source request) throws Exception { Element requestElement = null; if (request != null) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDomPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDomPayloadEndpoint.java index d52dd471..bedbbf75 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDomPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDomPayloadEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,6 +86,7 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor this.alwaysTransform = alwaysTransform; } + @Override public final Source invoke(Source request) throws Exception { if (documentBuilderFactory == null) { documentBuilderFactory = createDocumentBuilderFactory(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractEndpointExceptionResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractEndpointExceptionResolver.java index 028ab6b2..2a4e7881 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractEndpointExceptionResolver.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractEndpointExceptionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,13 +18,13 @@ package org.springframework.ws.server.endpoint; import java.util.Set; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.core.Ordered; import org.springframework.ws.context.MessageContext; import org.springframework.ws.server.EndpointExceptionResolver; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Abstract base class for {@link EndpointExceptionResolver EndpointExceptionResolvers}. *

@@ -83,6 +83,7 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep this.order = order; } + @Override public final int getOrder() { return order; } @@ -93,6 +94,7 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep * * @see #resolveExceptionInternal(MessageContext,Object,Exception) */ + @Override public final boolean resolveException(MessageContext messageContext, Object endpoint, Exception ex) { Object mappedEndpoint = endpoint instanceof MethodEndpoint ? ((MethodEndpoint) endpoint).getBean() : endpoint; if (mappedEndpoints != null && !mappedEndpoints.contains(mappedEndpoint)) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractJDomPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractJDomPayloadEndpoint.java index e091464c..f0d5932b 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractJDomPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractJDomPayloadEndpoint.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -20,8 +20,6 @@ import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.dom.DOMSource; -import org.springframework.xml.transform.TransformerObjectSupport; - import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.input.DOMBuilder; @@ -29,6 +27,8 @@ import org.jdom2.transform.JDOMResult; import org.jdom2.transform.JDOMSource; import org.w3c.dom.Node; +import org.springframework.xml.transform.TransformerObjectSupport; + /** * Abstract base class for endpoints that handle the message payload as JDOM elements. *

@@ -56,6 +56,7 @@ public abstract class AbstractJDomPayloadEndpoint extends TransformerObjectSuppo this.alwaysTransform = alwaysTransform; } + @Override public final Source invoke(Source request) throws Exception { Element requestElement = getDocumentElement(request); Element responseElement = invokeInternal(requestElement); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractLoggingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractLoggingInterceptor.java index a6db110f..46fc499d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractLoggingInterceptor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractLoggingInterceptor.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -24,14 +24,14 @@ import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.stream.StreamResult; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.ws.WebServiceMessage; import org.springframework.ws.context.MessageContext; import org.springframework.ws.server.EndpointInterceptor; import org.springframework.xml.transform.TransformerObjectSupport; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Abstract base class for EndpointInterceptor instances that log a part of a * WebServiceMessage. By default, both request and response messages are logged, but this behaviour can be @@ -84,6 +84,7 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor * @return true * @throws TransformerException when the payload cannot be transformed to a string */ + @Override public final boolean handleRequest(MessageContext messageContext, Object endpoint) throws TransformerException { if (logRequest && isLogEnabled()) { logMessageSource("Request: ", getSource(messageContext.getRequest())); @@ -99,6 +100,7 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor * @return true * @throws TransformerException when the payload cannot be transformed to a string */ + @Override public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception { if (logResponse && isLogEnabled()) { logMessageSource("Response: ", getSource(messageContext.getResponse())); @@ -107,11 +109,13 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor } /** Does nothing by default. Faults are not logged. */ + @Override public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception { return true; } /** Does nothing by default*/ + @Override public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) { } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java index f1db2c02..fb5cd48c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,9 @@ package org.springframework.ws.server.endpoint; import java.io.IOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.beans.factory.InitializingBean; import org.springframework.oxm.Marshaller; import org.springframework.oxm.Unmarshaller; @@ -26,9 +29,6 @@ import org.springframework.ws.WebServiceMessage; import org.springframework.ws.context.MessageContext; import org.springframework.ws.support.MarshallingUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Endpoint that unmarshals the request payload, and marshals the response object. This endpoint needs a * Marshaller and Unmarshaller, both of which can be set using properties. An abstract @@ -122,10 +122,12 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo this.unmarshaller = unmarshaller; } + @Override public void afterPropertiesSet() throws Exception { afterMarshallerSet(); } + @Override public final void invoke(MessageContext messageContext) throws Exception { WebServiceMessage request = messageContext.getRequest(); Object requestObject = unmarshalRequest(request); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractSaxPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractSaxPayloadEndpoint.java index 88c31cce..5011c620 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractSaxPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractSaxPayloadEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,10 @@ package org.springframework.ws.server.endpoint; import javax.xml.transform.Source; import javax.xml.transform.sax.SAXResult; -import org.springframework.xml.transform.TransformerObjectSupport; - import org.xml.sax.ContentHandler; +import org.springframework.xml.transform.TransformerObjectSupport; + /** * Abstract base class for endpoints that handle the message payload with a SAX ContentHandler. Allows * subclasses to create a response by returning a Source. @@ -47,6 +47,7 @@ public abstract class AbstractSaxPayloadEndpoint extends TransformerObjectSuppor * @see #createContentHandler() * @see #getResponse(org.xml.sax.ContentHandler) */ + @Override public final Source invoke(Source request) throws Exception { ContentHandler contentHandler = null; if (request != null) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxEventPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxEventPayloadEndpoint.java index e854ae2a..829fe3d3 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxEventPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxEventPayloadEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,6 +53,7 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo private XMLEventFactory eventFactory; + @Override public final void invoke(MessageContext messageContext) throws Exception { XMLEventReader eventReader = getEventReader(messageContext.getRequest().getPayloadSource()); XMLEventWriter streamWriter = new ResponseCreatingEventWriter(messageContext); @@ -163,15 +164,18 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo this.messageContext = messageContext; } + @Override public NamespaceContext getNamespaceContext() { return eventWriter.getNamespaceContext(); } + @Override public void setNamespaceContext(NamespaceContext context) throws XMLStreamException { createEventWriter(); eventWriter.setNamespaceContext(context); } + @Override public void add(XMLEventReader reader) throws XMLStreamException { createEventWriter(); while (reader.hasNext()) { @@ -179,6 +183,7 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo } } + @Override public void add(XMLEvent event) throws XMLStreamException { createEventWriter(); eventWriter.add(event); @@ -197,28 +202,33 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo } } + @Override public void close() throws XMLStreamException { if (eventWriter != null) { eventWriter.close(); } } + @Override public void flush() throws XMLStreamException { if (eventWriter != null) { eventWriter.flush(); } } + @Override public String getPrefix(String uri) throws XMLStreamException { createEventWriter(); return eventWriter.getPrefix(uri); } + @Override public void setDefaultNamespace(String uri) throws XMLStreamException { createEventWriter(); eventWriter.setDefaultNamespace(uri); } + @Override public void setPrefix(String prefix, String uri) throws XMLStreamException { createEventWriter(); eventWriter.setPrefix(prefix, uri); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxStreamPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxStreamPayloadEndpoint.java index ad2fad80..1a318eec 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxStreamPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxStreamPayloadEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,6 +48,7 @@ import org.springframework.ws.context.MessageContext; @SuppressWarnings("Since15") public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayloadEndpoint implements MessageEndpoint { + @Override public final void invoke(MessageContext messageContext) throws Exception { XMLStreamReader streamReader = getStreamReader(messageContext.getRequest().getPayloadSource()); XMLStreamWriter streamWriter = new ResponseCreatingStreamWriter(messageContext); @@ -137,15 +138,18 @@ public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayl this.messageContext = messageContext; } + @Override public NamespaceContext getNamespaceContext() { return streamWriter.getNamespaceContext(); } + @Override public void setNamespaceContext(NamespaceContext context) throws XMLStreamException { createStreamWriter(); streamWriter.setNamespaceContext(context); } + @Override public void close() throws XMLStreamException { if (streamWriter != null) { streamWriter.close(); @@ -166,147 +170,176 @@ public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayl } + @Override public void flush() throws XMLStreamException { if (streamWriter != null) { streamWriter.flush(); } } + @Override public String getPrefix(String uri) throws XMLStreamException { createStreamWriter(); return streamWriter.getPrefix(uri); } + @Override public Object getProperty(String name) throws IllegalArgumentException { return streamWriter.getProperty(name); } + @Override public void setDefaultNamespace(String uri) throws XMLStreamException { createStreamWriter(); streamWriter.setDefaultNamespace(uri); } + @Override public void setPrefix(String prefix, String uri) throws XMLStreamException { createStreamWriter(); streamWriter.setPrefix(prefix, uri); } + @Override public void writeAttribute(String localName, String value) throws XMLStreamException { createStreamWriter(); streamWriter.writeAttribute(localName, value); } + @Override public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException { createStreamWriter(); streamWriter.writeAttribute(namespaceURI, localName, value); } + @Override public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException { createStreamWriter(); streamWriter.writeAttribute(prefix, namespaceURI, localName, value); } + @Override public void writeCData(String data) throws XMLStreamException { createStreamWriter(); streamWriter.writeCData(data); } + @Override public void writeCharacters(String text) throws XMLStreamException { createStreamWriter(); streamWriter.writeCharacters(text); } + @Override public void writeCharacters(char[] text, int start, int len) throws XMLStreamException { createStreamWriter(); streamWriter.writeCharacters(text, start, len); } + @Override public void writeComment(String data) throws XMLStreamException { createStreamWriter(); streamWriter.writeComment(data); } + @Override public void writeDTD(String dtd) throws XMLStreamException { createStreamWriter(); streamWriter.writeDTD(dtd); } + @Override public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException { createStreamWriter(); streamWriter.writeDefaultNamespace(namespaceURI); } + @Override public void writeEmptyElement(String localName) throws XMLStreamException { createStreamWriter(); streamWriter.writeEmptyElement(localName); } + @Override public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException { createStreamWriter(); streamWriter.writeEmptyElement(namespaceURI, localName); } + @Override public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException { createStreamWriter(); streamWriter.writeEmptyElement(prefix, localName, namespaceURI); } + @Override public void writeEndDocument() throws XMLStreamException { createStreamWriter(); streamWriter.writeEndDocument(); } + @Override public void writeEndElement() throws XMLStreamException { createStreamWriter(); streamWriter.writeEndElement(); } + @Override public void writeEntityRef(String name) throws XMLStreamException { createStreamWriter(); streamWriter.writeEntityRef(name); } + @Override public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException { createStreamWriter(); streamWriter.writeNamespace(prefix, namespaceURI); } + @Override public void writeProcessingInstruction(String target) throws XMLStreamException { createStreamWriter(); streamWriter.writeProcessingInstruction(target); } + @Override public void writeProcessingInstruction(String target, String data) throws XMLStreamException { createStreamWriter(); streamWriter.writeProcessingInstruction(target, data); } + @Override public void writeStartDocument() throws XMLStreamException { createStreamWriter(); streamWriter.writeStartDocument(); } + @Override public void writeStartDocument(String version) throws XMLStreamException { createStreamWriter(); streamWriter.writeStartDocument(version); } + @Override public void writeStartDocument(String encoding, String version) throws XMLStreamException { createStreamWriter(); streamWriter.writeStartDocument(encoding, version); } + @Override public void writeStartElement(String localName) throws XMLStreamException { createStreamWriter(); streamWriter.writeStartElement(localName); } + @Override public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException { createStreamWriter(); streamWriter.writeStartElement(namespaceURI, localName); } + @Override public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException { createStreamWriter(); streamWriter.writeStartElement(prefix, localName, namespaceURI); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java index a0649aa0..8e8b091c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,11 +30,6 @@ import javax.xml.stream.XMLStreamReader; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; -import org.springframework.core.NestedRuntimeException; -import org.springframework.xml.namespace.QNameUtils; -import org.springframework.xml.transform.TransformerObjectSupport; -import org.springframework.xml.transform.TraxUtils; - import nu.xom.Attribute; import nu.xom.Builder; import nu.xom.Document; @@ -50,6 +45,11 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; +import org.springframework.core.NestedRuntimeException; +import org.springframework.xml.namespace.QNameUtils; +import org.springframework.xml.transform.TransformerObjectSupport; +import org.springframework.xml.transform.TraxUtils; + /** * Abstract base class for endpoints that handle the message payload as XOM elements. Offers the message payload as a * XOM Element, and allows subclasses to create a response by returning an Element. @@ -66,6 +66,7 @@ import org.xml.sax.XMLReader; @SuppressWarnings("Since15") public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSupport implements PayloadEndpoint { + @Override public final Source invoke(Source request) throws Exception { Element requestElement = null; if (request != null) { @@ -120,6 +121,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor private Element element; + @Override public void domSource(Node node) { if (node.getNodeType() == Node.ELEMENT_NODE) { element = DOMConverter.convert((org.w3c.dom.Element) node); @@ -133,6 +135,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor } } + @Override public void saxSource(XMLReader reader, InputSource inputSource) throws IOException, SAXException { try { Builder builder = new Builder(reader); @@ -157,15 +160,18 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor } } + @Override public void staxSource(XMLEventReader eventReader) throws XMLStreamException { throw new IllegalArgumentException("XMLEventReader not supported"); } + @Override public void staxSource(XMLStreamReader streamReader) throws XMLStreamException { Document document = StaxStreamConverter.convert(streamReader); element = document.getRootElement(); } + @Override public void streamSource(InputStream inputStream) throws IOException { try { Builder builder = new Builder(); @@ -177,6 +183,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor } } + @Override public void streamSource(Reader reader) throws IOException { try { Builder builder = new Builder(); @@ -188,6 +195,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor } } + @Override public void source(String systemId) throws Exception { try { Builder builder = new Builder(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/AbstractMethodEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/AbstractMethodEndpointAdapter.java index e5481962..45eaa984 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/AbstractMethodEndpointAdapter.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/AbstractMethodEndpointAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ public abstract class AbstractMethodEndpointAdapter extends TransformerObjectSup * @param endpoint endpoint object to check * @return whether or not this adapter can adapt the given endpoint */ + @Override public final boolean supports(Object endpoint) { return endpoint instanceof MethodEndpoint && supportsInternal((MethodEndpoint) endpoint); } @@ -49,6 +50,7 @@ public abstract class AbstractMethodEndpointAdapter extends TransformerObjectSup * true * @throws Exception in case of errors */ + @Override public final void invoke(MessageContext messageContext, Object endpoint) throws Exception { invokeInternal(messageContext, (MethodEndpoint) endpoint); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapter.java index ede1b2fb..d9cecfe6 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapter.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapter.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -143,10 +143,12 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter return this.classLoader != null ? this.classLoader : DefaultMethodEndpointAdapter.class.getClassLoader(); } + @Override public void setBeanClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } + @Override public void afterPropertiesSet() throws Exception { initDefaultStrategies(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapter.java index 153af0f0..0c3f306e 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapter.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapter.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -128,6 +128,7 @@ public class MarshallingMethodEndpointAdapter extends AbstractMethodEndpointAdap this.unmarshaller = unmarshaller; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(getMarshaller(), "marshaller is required"); Assert.notNull(getUnmarshaller(), "unmarshaller is required"); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageEndpointAdapter.java index eee06de8..c50210b0 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageEndpointAdapter.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageEndpointAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,10 +33,12 @@ import org.springframework.ws.soap.server.SoapMessageDispatcher; */ public class MessageEndpointAdapter implements EndpointAdapter { + @Override public boolean supports(Object endpoint) { return endpoint instanceof MessageEndpoint; } + @Override public void invoke(MessageContext messageContext, Object endpoint) throws Exception { ((MessageEndpoint) endpoint).invoke(messageContext); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapter.java index 7576d133..82b99561 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapter.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,10 +38,12 @@ import org.springframework.xml.transform.TransformerObjectSupport; */ public class PayloadEndpointAdapter extends TransformerObjectSupport implements EndpointAdapter { + @Override public boolean supports(Object endpoint) { return endpoint instanceof PayloadEndpoint; } + @Override public void invoke(MessageContext messageContext, Object endpoint) throws Exception { PayloadEndpoint payloadEndpoint = (PayloadEndpoint) endpoint; Source requestSource = messageContext.getRequest().getPayloadSource(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapter.java index 72e4f6fa..d752d4a8 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapter.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,11 @@ import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + import org.springframework.beans.factory.InitializingBean; import org.springframework.ws.WebServiceMessage; import org.springframework.ws.context.MessageContext; @@ -35,11 +40,6 @@ import org.springframework.ws.server.endpoint.MethodEndpoint; import org.springframework.ws.server.endpoint.annotation.XPathParam; import org.springframework.xml.namespace.SimpleNamespaceContext; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - /** * Adapter that supports endpoint methods that use XPath expressions. Supports methods with the following signature: *

@@ -74,6 +74,7 @@ public class XPathParamAnnotationMethodEndpointAdapter extends AbstractMethodEnd
         this.namespaces = namespaces;
     }
 
+    @Override
     public void afterPropertiesSet() throws Exception {
         xpathFactory = XPathFactory.newInstance();
     }
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessor.java
index 124be97b..6cf6569c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2010 the original author or authors.
+ * Copyright 2005-2014 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,6 +46,7 @@ public abstract class AbstractPayloadMethodProcessor extends TransformerObjectSu
      * This implementation gets checks if the given parameter is annotated with {@link RequestPayload}, and invokes
      * {@link #supportsRequestPayloadParameter(org.springframework.core.MethodParameter)} afterwards.
      */
+    @Override
     public final boolean supportsParameter(MethodParameter parameter) {
         Assert.isTrue(parameter.getParameterIndex() >= 0, "Parameter index larger smaller than 0");
         if (parameter.getParameterAnnotation(RequestPayload.class) == null) {
@@ -73,6 +74,7 @@ public abstract class AbstractPayloadMethodProcessor extends TransformerObjectSu
      * This implementation gets checks if the method of the given return type is annotated with {@link ResponsePayload},
      * and invokes {@link #supportsResponsePayloadReturnType(org.springframework.core.MethodParameter)} afterwards.
      */
+    @Override
     public final boolean supportsReturnType(MethodParameter returnType) {
         Assert.isTrue(returnType.getParameterIndex() == -1, "Parameter index is not -1");
         if (returnType.getMethodAnnotation(ResponsePayload.class) == null) {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadSourceMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadSourceMethodProcessor.java
index 68dd9550..d657926a 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadSourceMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadSourceMethodProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2010 the original author or authors.
+ * Copyright 2005-2014 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@ public abstract class AbstractPayloadSourceMethodProcessor extends AbstractPaylo
 
     // MethodArgumentResolver
 
+    @Override
     public final Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception {
         Source requestPayload = getRequestPayload(messageContext);
         return requestPayload != null ? resolveRequestPayloadArgument(parameter, requestPayload) : null;
@@ -58,6 +59,7 @@ public abstract class AbstractPayloadSourceMethodProcessor extends AbstractPaylo
 
     // MethodReturnValueHandler
 
+    @Override
     public final void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue)
             throws Exception {
         if (returnValue != null) {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessor.java
index fb89447b..52d8bcad 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessor.java
@@ -1,11 +1,11 @@
 /*
- * Copyright 2005-2010 the original author or authors.
+ * Copyright 2005-2014 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -122,6 +122,7 @@ public class MarshallingPayloadMethodProcessor extends AbstractPayloadMethodProc
         }
     }
 
+    @Override
     public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception {
         Unmarshaller unmarshaller = getUnmarshaller();
         Assert.state(unmarshaller != null, "unmarshaller must not be null");
@@ -149,6 +150,7 @@ public class MarshallingPayloadMethodProcessor extends AbstractPayloadMethodProc
         }
     }
 
+    @Override
     public void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue)
             throws Exception {
 	    if (returnValue == null) {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolver.java
index 2f1a585d..d86618b1 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2010 the original author or authors.
+ * Copyright 2005-2014 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,10 +27,12 @@ import org.springframework.ws.context.MessageContext;
  */
 public class MessageContextMethodArgumentResolver implements MethodArgumentResolver {
 
+    @Override
     public boolean supportsParameter(MethodParameter parameter) {
         return MessageContext.class.equals(parameter.getParameterType());
     }
 
+    @Override
     public MessageContext resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception {
         return messageContext;
     }
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolver.java
index 9c368138..9619a81c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2010 the original author or authors.
+ * Copyright 2005-2014 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,6 +43,7 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
 
     private final XMLInputFactory inputFactory = createXmlInputFactory();
 
+    @Override
     public boolean supportsParameter(MethodParameter parameter) {
         if (parameter.getParameterAnnotation(RequestPayload.class) == null) {
             return false;
@@ -53,6 +54,7 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
         }
     }
 
+    @Override
     public Object resolveArgument(MessageContext messageContext, MethodParameter parameter)
             throws TransformerException, XMLStreamException {
         Source source = messageContext.getRequest().getPayloadSource();
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java
index 09ca2de3..f264d626 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java
@@ -1,11 +1,11 @@
 /*
- * Copyright 2005-2010 the original author or authors.
+ * Copyright 2005-2014 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,6 +25,11 @@ import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
 
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
 import org.springframework.core.MethodParameter;
 import org.springframework.core.convert.ConversionService;
 import org.springframework.core.convert.support.ConversionServiceFactory;
@@ -33,11 +38,6 @@ import org.springframework.ws.server.endpoint.annotation.XPathParam;
 import org.springframework.ws.server.endpoint.support.NamespaceUtils;
 import org.springframework.xml.transform.TransformerHelper;
 
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
 /**
  * Implementation of {@link MethodArgumentResolver} that supports the {@link XPathParam @XPathParam} annotation.
  * 

@@ -71,6 +71,7 @@ public class XPathParamMethodArgumentResolver implements MethodArgumentResolver this.transformerHelper = transformerHelper; } + @Override public boolean supportsParameter(MethodParameter parameter) { if (parameter.getParameterAnnotation(XPathParam.class) == null) { return false; @@ -87,6 +88,7 @@ public class XPathParamMethodArgumentResolver implements MethodArgumentResolver } } + @Override public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws TransformerException, XPathExpressionException { Class parameterType = parameter.getParameterType(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java index e563347c..2ef5e3da 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -243,30 +243,37 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa this.unmarshaller = createUnmarshaller(clazz); } + @Override public void domSource(Node node) throws JAXBException { result = unmarshaller.unmarshal(node); } + @Override public void saxSource(XMLReader reader, InputSource inputSource) throws JAXBException { result = unmarshaller.unmarshal(inputSource); } + @Override public void staxSource(XMLEventReader eventReader) throws JAXBException { result = unmarshaller.unmarshal(eventReader); } + @Override public void staxSource(XMLStreamReader streamReader) throws JAXBException { result = unmarshaller.unmarshal(streamReader); } + @Override public void streamSource(InputStream inputStream) throws IOException, JAXBException { result = unmarshaller.unmarshal(inputStream); } + @Override public void streamSource(Reader reader) throws IOException, JAXBException { result = unmarshaller.unmarshal(reader); } + @Override public void source(String systemId) throws Exception { result = unmarshaller.unmarshal(new URL(systemId)); } @@ -285,30 +292,37 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa this.declaredType = declaredType; } + @Override public void domSource(Node node) throws JAXBException { result = unmarshaller.unmarshal(node, declaredType); } + @Override public void saxSource(XMLReader reader, InputSource inputSource) throws JAXBException { result = unmarshaller.unmarshal(new SAXSource(reader, inputSource), declaredType); } + @Override public void staxSource(XMLEventReader eventReader) throws JAXBException { result = unmarshaller.unmarshal(eventReader, declaredType); } + @Override public void staxSource(XMLStreamReader streamReader) throws JAXBException { result = unmarshaller.unmarshal(streamReader, declaredType); } + @Override public void streamSource(InputStream inputStream) throws IOException, JAXBException { result = unmarshaller.unmarshal(new StreamSource(inputStream), declaredType); } + @Override public void streamSource(Reader reader) throws IOException, JAXBException { result = unmarshaller.unmarshal(new StreamSource(reader), declaredType); } + @Override public void source(String systemId) throws Exception { result = unmarshaller.unmarshal(new StreamSource(systemId), declaredType); } @@ -325,30 +339,37 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa this.jaxbElement = jaxbElement; } + @Override public void domResult(Node node) throws JAXBException { marshaller.marshal(jaxbElement, node); } + @Override public void saxResult(ContentHandler contentHandler, LexicalHandler lexicalHandler) throws JAXBException { marshaller.marshal(jaxbElement, contentHandler); } + @Override public void staxResult(XMLEventWriter eventWriter) throws JAXBException { marshaller.marshal(jaxbElement, eventWriter); } + @Override public void staxResult(XMLStreamWriter streamWriter) throws JAXBException { marshaller.marshal(jaxbElement, streamWriter); } + @Override public void streamResult(OutputStream outputStream) throws JAXBException { marshaller.marshal(jaxbElement, outputStream); } + @Override public void streamResult(Writer writer) throws JAXBException { marshaller.marshal(jaxbElement, writer); } + @Override public void result(String systemId) throws Exception { marshaller.marshal(jaxbElement, new StreamResult(systemId)); } @@ -371,10 +392,12 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa this.name = introspector.getElementName(jaxbElement); } + @Override public QName getName() { return name; } + @Override public void writeTo(XMLStreamWriter streamWriter) throws XMLStreamException { try { marshaller.marshal(jaxbElement, streamWriter); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessor.java index e83b3347..10d22d90 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,7 @@ public class JaxbElementPayloadMethodProcessor extends AbstractJaxb2PayloadMetho return JAXBElement.class.equals(parameterType) && genericType instanceof ParameterizedType; } + @Override public JAXBElement resolveArgument(MessageContext messageContext, MethodParameter parameter) throws JAXBException { ParameterizedType parameterizedType = (ParameterizedType) parameter.getGenericParameterType(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessor.java index 4bf5c538..0d6bf6d4 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,6 +42,7 @@ public class XmlRootElementPayloadMethodProcessor extends AbstractJaxb2PayloadMe parameterType.isAnnotationPresent(XmlType.class); } + @Override public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws JAXBException { Class parameterType = parameter.getParameterType(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/AbstractValidatingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/AbstractValidatingInterceptor.java index 3ed18184..40fd737a 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/AbstractValidatingInterceptor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/AbstractValidatingInterceptor.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -153,6 +153,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup this.validateResponse = validateResponse; } + @Override public void afterPropertiesSet() throws Exception { if (validator == null && !ObjectUtils.isEmpty(schemas)) { Assert.hasLength(schemaLanguage, "schemaLanguage is required"); @@ -178,6 +179,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup * @return true if the message is valid; false otherwise * @see #setValidateRequest(boolean) */ + @Override public boolean handleRequest(MessageContext messageContext, Object endpoint) throws IOException, SAXException, TransformerException { if (validateRequest) { @@ -221,6 +223,7 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup * @return true if the response is valid; false otherwise * @see #setValidateResponse(boolean) */ + @Override public boolean handleResponse(MessageContext messageContext, Object endpoint) throws IOException, SAXException { if (validateResponse) { Source responseSource = getValidationResponseSource(messageContext.getResponse()); @@ -253,11 +256,13 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup } /** Does nothing by default. Faults are not validated. */ + @Override public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception { return true; } /** Does nothing by default.*/ + @Override public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) { } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/DelegatingSmartEndpointInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/DelegatingSmartEndpointInterceptor.java index 10cd53b8..6420699d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/DelegatingSmartEndpointInterceptor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/DelegatingSmartEndpointInterceptor.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -56,6 +56,7 @@ public class DelegatingSmartEndpointInterceptor implements SmartEndpointIntercep *

* This implementation delegates to {@link #shouldIntercept(WebServiceMessage, Object)}. */ + @Override public boolean shouldIntercept(MessageContext messageContext, Object endpoint) { WebServiceMessage request = messageContext.getRequest(); return request != null && shouldIntercept(request, endpoint); @@ -74,18 +75,22 @@ public class DelegatingSmartEndpointInterceptor implements SmartEndpointIntercep return true; } + @Override public boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception { return getDelegate().handleRequest(messageContext, endpoint); } + @Override public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception { return getDelegate().handleResponse(messageContext, endpoint); } + @Override public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception { return getDelegate().handleFault(messageContext, endpoint); } + @Override public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception { getDelegate().afterCompletion(messageContext, endpoint, ex); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/EndpointInterceptorAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/EndpointInterceptorAdapter.java index 779be746..da1bc52d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/EndpointInterceptorAdapter.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/EndpointInterceptorAdapter.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -16,13 +16,13 @@ package org.springframework.ws.server.endpoint.interceptor; -import org.springframework.ws.context.MessageContext; -import org.springframework.ws.server.EndpointInterceptor; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.w3c.dom.Element; +import org.springframework.ws.context.MessageContext; +import org.springframework.ws.server.EndpointInterceptor; + /** * Default implementation of the EndpointInterceptor interface, for simplified implementation of * pre-only/post-only interceptors. @@ -45,6 +45,7 @@ public class EndpointInterceptorAdapter implements EndpointInterceptor { * * @return true */ + @Override public boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception { return true; } @@ -54,6 +55,7 @@ public class EndpointInterceptorAdapter implements EndpointInterceptor { * * @return true */ + @Override public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception { return true; } @@ -63,6 +65,7 @@ public class EndpointInterceptorAdapter implements EndpointInterceptor { * * @return true */ + @Override public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception { return true; } @@ -70,6 +73,7 @@ public class EndpointInterceptorAdapter implements EndpointInterceptor { /** * Does nothing by default. */ + @Override public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception { } } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptor.java index f997a968..a505bf81 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptor.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -26,6 +26,11 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; + import org.springframework.beans.factory.InitializingBean; import org.springframework.core.io.Resource; import org.springframework.util.Assert; @@ -35,11 +40,6 @@ import org.springframework.ws.server.EndpointInterceptor; import org.springframework.xml.transform.ResourceSource; import org.springframework.xml.transform.TransformerObjectSupport; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; - /** * Interceptor that transforms the payload of WebServiceMessages using XSLT stylesheet. Allows for seperate * stylesheets for request and response. This interceptor is especially useful when supporting with multiple version of @@ -85,6 +85,7 @@ public class PayloadTransformingInterceptor extends TransformerObjectSupport * @return always returns true * @see #setRequestXslt(org.springframework.core.io.Resource) */ + @Override public boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception { if (requestTemplates != null) { WebServiceMessage request = messageContext.getRequest(); @@ -103,6 +104,7 @@ public class PayloadTransformingInterceptor extends TransformerObjectSupport * @return always returns true * @see #setResponseXslt(org.springframework.core.io.Resource) */ + @Override public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception { if (responseTemplates != null) { WebServiceMessage response = messageContext.getResponse(); @@ -121,14 +123,17 @@ public class PayloadTransformingInterceptor extends TransformerObjectSupport } /** Does nothing by default. Faults are not transformed. */ + @Override public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception { return true; } /** Does nothing by default.*/ + @Override public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) { } + @Override public void afterPropertiesSet() throws Exception { if (requestXslt == null && responseXslt == null) { throw new IllegalArgumentException("Setting either 'requestXslt' or 'responseXslt' is required"); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractEndpointMapping.java index dd8c7146..de25736d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractEndpointMapping.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractEndpointMapping.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -67,6 +67,7 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i this.interceptors = interceptors; } + @Override public final int getOrder() { return order; } @@ -113,6 +114,7 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i * @return the looked up endpoint instance, or the default endpoint * @see #getEndpointInternal(org.springframework.ws.context.MessageContext) */ + @Override public final EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception { Object endpoint = getEndpointInternal(messageContext); if (endpoint == null) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/SimpleMethodEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/SimpleMethodEndpointMapping.java index 1fae7ab2..fc3437d6 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/SimpleMethodEndpointMapping.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/SimpleMethodEndpointMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,6 +105,7 @@ public class SimpleMethodEndpointMapping extends AbstractMethodEndpointMappingEndpointMapping interface that maps to endpoint using an XPath expression. * Supports both mapping to bean instances and mapping to bean names: the latter is required for prototype endpoints. @@ -77,6 +77,7 @@ public class XPathPayloadEndpointMapping extends AbstractMapBasedEndpointMapping this.namespaces = namespaces; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(expressionString, "expression is required"); if (namespaces == null) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/support/PayloadRootUtils.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/support/PayloadRootUtils.java index f2145e66..2d70a28f 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/support/PayloadRootUtils.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/support/PayloadRootUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,15 +29,15 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; -import org.springframework.xml.namespace.QNameUtils; -import org.springframework.xml.transform.TransformerHelper; -import org.springframework.xml.transform.TraxUtils; - import org.w3c.dom.Document; import org.w3c.dom.Node; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; +import org.springframework.xml.namespace.QNameUtils; +import org.springframework.xml.transform.TransformerHelper; +import org.springframework.xml.transform.TraxUtils; + /** * Helper class for determining the root qualified name of a Web Service payload. * @@ -92,6 +92,7 @@ public abstract class PayloadRootUtils { private QName result; + @Override public void domSource(Node node) throws Exception { if (node.getNodeType() == Node.ELEMENT_NODE) { result = QNameUtils.getQNameForNode(node); @@ -102,6 +103,7 @@ public abstract class PayloadRootUtils { } } + @Override public void staxSource(XMLEventReader eventReader) throws Exception { XMLEvent event = eventReader.peek(); if (event != null && event.isStartDocument()) { @@ -117,6 +119,7 @@ public abstract class PayloadRootUtils { } } + @Override public void staxSource(XMLStreamReader streamReader) throws Exception { if (streamReader.getEventType() == XMLStreamConstants.START_DOCUMENT) { try { @@ -132,18 +135,22 @@ public abstract class PayloadRootUtils { } } + @Override public void saxSource(XMLReader reader, InputSource inputSource) throws Exception { // Do nothing } + @Override public void streamSource(InputStream inputStream) throws Exception { // Do nothing } + @Override public void streamSource(Reader reader) throws Exception { // Do nothing } + @Override public void source(String systemId) throws Exception { // Do nothing } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/AbstractSoapMessage.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/AbstractSoapMessage.java index 4f5d50a5..6d230a7a 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/AbstractSoapMessage.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/AbstractSoapMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,31 +32,37 @@ public abstract class AbstractSoapMessage extends AbstractMimeMessage implements private SoapVersion version; /** Returns getEnvelope().getBody(). */ + @Override public final SoapBody getSoapBody() { return getEnvelope().getBody(); } /** Returns getEnvelope().getHeader(). */ + @Override public final SoapHeader getSoapHeader() { return getEnvelope().getHeader(); } /** Returns getSoapBody().getPayloadSource(). */ + @Override public final Source getPayloadSource() { return getSoapBody().getPayloadSource(); } /** Returns getSoapBody().getPayloadResult(). */ + @Override public final Result getPayloadResult() { return getSoapBody().getPayloadResult(); } /** Returns getSoapBody().hasFault(). */ + @Override public final boolean hasFault() { return getSoapBody().hasFault(); } /** Returns getSoapBody().getFault().getFaultStringOrReason(). */ + @Override public final String getFaultReason() { if (hasFault()) { return getSoapBody().getFault().getFaultStringOrReason(); @@ -66,6 +72,7 @@ public abstract class AbstractSoapMessage extends AbstractMimeMessage implements } } + @Override public SoapVersion getVersion() { if (version == null) { String envelopeNamespace = getEnvelope().getName().getNamespaceURI(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageFactory.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageFactory.java index c01c91f7..2988de0c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageFactory.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/SoapMessageFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,7 @@ public interface SoapMessageFactory extends WebServiceMessageFactory { * * @return the empty message */ + @Override SoapMessage createWebServiceMessage(); /** @@ -58,6 +59,7 @@ public interface SoapMessageFactory extends WebServiceMessageFactory { * @return the created message * @throws java.io.IOException if an I/O exception occurs */ + @Override SoapMessage createWebServiceMessage(InputStream inputStream) throws IOException; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/client/ActionCallback.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/client/ActionCallback.java index 79f48997..369d71c1 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/client/ActionCallback.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/client/ActionCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -234,6 +234,7 @@ public class ActionCallback implements WebServiceMessageCallback { } } + @Override public void doWithMessage(WebServiceMessage message) throws IOException, TransformerException { Assert.isInstanceOf(SoapMessage.class, message); SoapMessage soapMessage = (SoapMessage) message; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/messageid/UuidMessageIdStrategy.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/messageid/UuidMessageIdStrategy.java index a57c4494..6d3093df 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/messageid/UuidMessageIdStrategy.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/messageid/UuidMessageIdStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,10 +35,12 @@ public class UuidMessageIdStrategy implements MessageIdStrategy { public static final String PREFIX = "urn:uuid:"; /** Returns false. */ + @Override public boolean isDuplicate(URI messageId) { return false; } + @Override public URI newMessageId(SoapMessage message) { return URI.create(PREFIX + UUID.randomUUID().toString()); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AbstractActionEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AbstractActionEndpointMapping.java index ff3fc082..fbcbcfb8 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AbstractActionEndpointMapping.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AbstractActionEndpointMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,6 +85,7 @@ public abstract class AbstractActionEndpointMapping extends AbstractAddressingEn this.faultActionSuffix = faultActionSuffix; } + @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AbstractAddressingEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AbstractAddressingEndpointMapping.java index 28a3dc4b..25b9bb5c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AbstractAddressingEndpointMapping.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AbstractAddressingEndpointMapping.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -98,20 +98,24 @@ public abstract class AbstractAddressingEndpointMapping extends TransformerObjec messageIdStrategy = new UuidMessageIdStrategy(); } + @Override public final void setActorOrRole(String actorOrRole) { Assert.notNull(actorOrRole, "actorOrRole must not be null"); actorsOrRoles = new String[]{actorOrRole}; } + @Override public final void setActorsOrRoles(String[] actorsOrRoles) { Assert.notEmpty(actorsOrRoles, "actorsOrRoles must not be empty"); this.actorsOrRoles = actorsOrRoles; } + @Override public final void setUltimateReceiver(boolean ultimateReceiver) { this.isUltimateReceiver = ultimateReceiver; } + @Override public final int getOrder() { return order; } @@ -206,12 +210,14 @@ public abstract class AbstractAddressingEndpointMapping extends TransformerObjec this.versions = versions; } + @Override public void afterPropertiesSet() throws Exception { if (logger.isInfoEnabled()) { logger.info("Supporting " + Arrays.asList(versions)); } } + @Override public final EndpointInvocationChain getEndpoint(MessageContext messageContext) throws TransformerException { Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest()); SoapMessage request = (SoapMessage) messageContext.getRequest(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AddressingEndpointInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AddressingEndpointInterceptor.java index 15ba4689..8f044356 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AddressingEndpointInterceptor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AddressingEndpointInterceptor.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -19,6 +19,9 @@ package org.springframework.ws.soap.addressing.server; import java.io.IOException; import java.net.URI; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.util.Assert; import org.springframework.ws.context.MessageContext; import org.springframework.ws.soap.SoapHeaderElement; @@ -31,9 +34,6 @@ import org.springframework.ws.soap.server.SoapEndpointInterceptor; import org.springframework.ws.transport.WebServiceConnection; import org.springframework.ws.transport.WebServiceMessageSender; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * {@link SoapEndpointInterceptor} implementation that deals with WS-Addressing headers. Stateful, and instantiated by * the {@link AbstractAddressingEndpointMapping}. @@ -70,6 +70,7 @@ class AddressingEndpointInterceptor implements SoapEndpointInterceptor { this.faultAction = faultAction; } + @Override public final boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception { Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest()); SoapMessage request = (SoapMessage) messageContext.getRequest(); @@ -85,10 +86,12 @@ class AddressingEndpointInterceptor implements SoapEndpointInterceptor { return true; } + @Override public final boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception { return handleResponseOrFault(messageContext, false); } + @Override public final boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception { return handleResponseOrFault(messageContext, true); } @@ -178,9 +181,11 @@ class AddressingEndpointInterceptor implements SoapEndpointInterceptor { return responseMessageId; } + @Override public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) { } + @Override public boolean understands(SoapHeaderElement header) { return version.understands(header); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AnnotationActionEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AnnotationActionEndpointMapping.java index dd9a3a87..b58804ad 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AnnotationActionEndpointMapping.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/server/AnnotationActionEndpointMapping.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -139,10 +139,12 @@ public class AnnotationActionEndpointMapping extends AbstractActionMethodEndpoin } } + @Override public final Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } + @Override public final Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (AopUtils.getTargetClass(bean).getAnnotation(getEndpointAnnotationType()) != null) { registerMethods(bean); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/AbstractAddressingVersion.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/AbstractAddressingVersion.java index 40eba81f..1fb19ca6 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/AbstractAddressingVersion.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/AbstractAddressingVersion.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,10 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; + import org.springframework.util.StringUtils; import org.springframework.ws.soap.SoapFault; import org.springframework.ws.soap.SoapHeader; @@ -49,10 +53,6 @@ import org.springframework.xml.transform.TransformerObjectSupport; import org.springframework.xml.xpath.XPathExpression; import org.springframework.xml.xpath.XPathExpressionFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - /** * Abstract base class for {@link AddressingVersion} implementations. Uses {@link XPathExpression}s to retrieve * addressing information. @@ -121,6 +121,7 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport return XPathExpressionFactory.createXPathExpression(expression, namespaces); } + @Override public MessageAddressingProperties getMessageAddressingProperties(SoapMessage message) { Element headerElement = getSoapHeaderElement(message); URI to = getUri(headerElement, toExpression); @@ -191,6 +192,7 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport return new EndpointReference(address, referenceProperties, referenceParameters); } + @Override public void addAddressingHeaders(SoapMessage message, MessageAddressingProperties map) { SoapHeader header = message.getSoapHeader(); header.addNamespaceDeclaration(getNamespacePrefix(), getNamespaceUri()); @@ -232,6 +234,7 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport addReferenceNodes(header.getResult(), map.getReferenceProperties()); } + @Override public final boolean understands(SoapHeaderElement headerElement) { return getNamespaceUri().equals(headerElement.getName().getNamespaceURI()); } @@ -280,11 +283,13 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport } } + @Override public final SoapFault addInvalidAddressingHeaderFault(SoapMessage message) { return addAddressingFault(message, getInvalidAddressingHeaderFaultSubcode(), getInvalidAddressingHeaderFaultReason()); } + @Override public final SoapFault addMessageAddressingHeaderRequiredFault(SoapMessage message) { return addAddressingFault(message, getMessageAddressingHeaderRequiredFaultSubcode(), getMessageAddressingHeaderRequiredFaultReason()); @@ -308,11 +313,13 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport * Address URIs */ + @Override public final boolean hasAnonymousAddress(EndpointReference epr) { URI anonymous = getAnonymous(); return anonymous != null && anonymous.equals(epr.getAddress()); } + @Override public final boolean hasNoneAddress(EndpointReference epr) { URI none = getNone(); return none != null && none.equals(epr.getAddress()); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing10.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing10.java index 144b1fd8..18921ec2 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing10.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing10.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,6 +44,7 @@ public class Addressing10 extends AbstractAddressingVersion { super.addAddressingHeaders(message, map); } + @Override public boolean hasRequiredProperties(MessageAddressingProperties map) { if (map.getAction() == null) { return false; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing200408.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing200408.java index 7e7a2f98..e7e57393 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing200408.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/addressing/version/Addressing200408.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,6 +45,7 @@ public class Addressing200408 extends AbstractAddressingVersion { super.addAddressingHeaders(message, map); } + @Override public boolean hasRequiredProperties(MessageAddressingProperties map) { if (map.getTo() == null) { return false; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomAttachment.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomAttachment.java index f7951b15..0eb8f119 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomAttachment.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomAttachment.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,23 +42,28 @@ class AxiomAttachment implements Attachment { this.dataHandler = dataHandler; } + @Override public String getContentId() { return contentId; } + @Override public String getContentType() { return dataHandler.getContentType(); } + @Override public InputStream getInputStream() throws IOException { return dataHandler.getInputStream(); } + @Override public long getSize() { // Axiom does not support getting the size of attachments. return -1; } + @Override public DataHandler getDataHandler() { return dataHandler; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomHandler.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomHandler.java index 20b3ea27..c33f051f 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomHandler.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomHandler.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -74,22 +74,27 @@ class AxiomHandler implements ContentHandler, LexicalHandler { } } + @Override public void startDocument() throws SAXException { removeAllNamespaceMappings(); newNamespaceMapping(); } + @Override public void endDocument() throws SAXException { removeAllNamespaceMappings(); } + @Override public void startPrefixMapping(String prefix, String uri) throws SAXException { currentNamespaceMapping().put(prefix, uri); } + @Override public void endPrefixMapping(String prefix) throws SAXException { } + @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { OMContainer parent = getParent(); @@ -134,18 +139,21 @@ class AxiomHandler implements ContentHandler, LexicalHandler { (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) && localPart.length() != 0); } + @Override public void endElement(String uri, String localName, String qName) throws SAXException { elements.remove(elements.size() - 1); removeNamespaceMapping(); } + @Override public void characters(char ch[], int start, int length) throws SAXException { String data = new String(ch, start, length); OMContainer parent = getParent(); factory.createOMText(parent, data, charactersType); } + @Override public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { charactersType = XMLStreamConstants.SPACE; @@ -153,31 +161,37 @@ class AxiomHandler implements ContentHandler, LexicalHandler { charactersType = XMLStreamConstants.CHARACTERS; } + @Override public void processingInstruction(String target, String data) throws SAXException { OMContainer parent = getParent(); factory.createOMProcessingInstruction(parent, target, data); } + @Override public void comment(char ch[], int start, int length) throws SAXException { String content = new String(ch, start, length); OMContainer parent = getParent(); factory.createOMComment(parent, content); } + @Override public void startCDATA() throws SAXException { charactersType = XMLStreamConstants.CDATA; } + @Override public void endCDATA() throws SAXException { charactersType = XMLStreamConstants.CHARACTERS; } + @Override public void startEntity(String name) throws SAXException { if (!isPredefinedEntityReference(name)) { charactersType = XMLStreamConstants.ENTITY_REFERENCE; } } + @Override public void endEntity(String name) throws SAXException { charactersType = XMLStreamConstants.CHARACTERS; } @@ -192,16 +206,20 @@ class AxiomHandler implements ContentHandler, LexicalHandler { * Unsupported */ + @Override public void setDocumentLocator(Locator locator) { } + @Override public void skippedEntity(String name) throws SAXException { } + @Override public void startDTD(String name, String publicId, String systemId) throws SAXException { } + @Override public void endDTD() throws SAXException { } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Body.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Body.java index 72ac403b..4061eeb8 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Body.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Body.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,6 @@ package org.springframework.ws.soap.axiom; import java.util.Locale; import javax.xml.namespace.QName; -import org.springframework.util.Assert; -import org.springframework.util.StringUtils; -import org.springframework.ws.soap.axiom.support.AxiomUtils; -import org.springframework.ws.soap.soap11.Soap11Body; -import org.springframework.ws.soap.soap11.Soap11Fault; -import org.springframework.xml.namespace.QNameUtils; - import org.apache.axiom.om.OMAttribute; import org.apache.axiom.om.OMNamespace; import org.apache.axiom.soap.SOAP11Constants; @@ -36,6 +29,13 @@ import org.apache.axiom.soap.SOAPFaultCode; import org.apache.axiom.soap.SOAPFaultReason; import org.apache.axiom.soap.SOAPProcessingException; +import org.springframework.util.Assert; +import org.springframework.util.StringUtils; +import org.springframework.ws.soap.axiom.support.AxiomUtils; +import org.springframework.ws.soap.soap11.Soap11Body; +import org.springframework.ws.soap.soap11.Soap11Fault; +import org.springframework.xml.namespace.QNameUtils; + /** * Axiom-specific version of org.springframework.ws.soap.Soap11Body. * @@ -54,26 +54,31 @@ class AxiomSoap11Body extends AxiomSoapBody implements Soap11Body { this.langAttributeOnSoap11FaultString = langAttributeOnSoap11FaultString; } + @Override public Soap11Fault addMustUnderstandFault(String faultString, Locale locale) { SOAPFault fault = addStandardFault(SOAP11Constants.FAULT_CODE_MUST_UNDERSTAND, faultString, locale); return new AxiomSoap11Fault(fault, getAxiomFactory()); } + @Override public Soap11Fault addClientOrSenderFault(String faultString, Locale locale) { SOAPFault fault = addStandardFault(SOAP11Constants.FAULT_CODE_SENDER, faultString, locale); return new AxiomSoap11Fault(fault, getAxiomFactory()); } + @Override public Soap11Fault addServerOrReceiverFault(String faultString, Locale locale) { SOAPFault fault = addStandardFault(SOAP11Constants.FAULT_CODE_RECEIVER, faultString, locale); return new AxiomSoap11Fault(fault, getAxiomFactory()); } + @Override public Soap11Fault addVersionMismatchFault(String faultString, Locale locale) { SOAPFault fault = addStandardFault(SOAP11Constants.FAULT_CODE_VERSION_MISMATCH, faultString, locale); return new AxiomSoap11Fault(fault, getAxiomFactory()); } + @Override public Soap11Fault addFault(QName code, String faultString, Locale faultStringLocale) { Assert.notNull(code, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); @@ -147,6 +152,7 @@ class AxiomSoap11Body extends AxiomSoapBody implements Soap11Body { faultReason.addAttribute(langAttribute); } + @Override public Soap11Fault getFault() { SOAPFault axiomFault = getAxiomBody().getFault(); return axiomFault != null ? new AxiomSoap11Fault(axiomFault, getAxiomFactory()) : null; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Fault.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Fault.java index f6b1ef11..9a65ff48 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Fault.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Fault.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import javax.xml.namespace.QName; import org.apache.axiom.om.OMAttribute; import org.apache.axiom.soap.SOAPFactory; import org.apache.axiom.soap.SOAPFault; + import org.springframework.ws.soap.axiom.support.AxiomUtils; import org.springframework.ws.soap.soap11.Soap11Fault; @@ -37,10 +38,12 @@ class AxiomSoap11Fault extends AxiomSoapFault implements Soap11Fault { super(axiomFault, axiomFactory); } + @Override public QName getFaultCode() { return getAxiomFault().getCode().getTextAsQName(); } + @Override public String getFaultStringOrReason() { if (getAxiomFault().getReason() != null) { return getAxiomFault().getReason().getText(); @@ -48,6 +51,7 @@ class AxiomSoap11Fault extends AxiomSoapFault implements Soap11Fault { return null; } + @Override public Locale getFaultStringLocale() { if (getAxiomFault().getReason() != null) { OMAttribute langAttribute = diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Header.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Header.java index d658894d..28301d37 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Header.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap11Header.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,15 +20,15 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; -import org.springframework.util.ObjectUtils; -import org.springframework.ws.soap.SoapHeaderElement; -import org.springframework.ws.soap.soap11.Soap11Header; - import org.apache.axiom.soap.RolePlayer; import org.apache.axiom.soap.SOAPFactory; import org.apache.axiom.soap.SOAPHeader; import org.apache.axiom.soap.SOAPHeaderBlock; +import org.springframework.util.ObjectUtils; +import org.springframework.ws.soap.SoapHeaderElement; +import org.springframework.ws.soap.soap11.Soap11Header; + /** * Axiom-specific version of org.springframework.ws.soap.Soap11Header. * @@ -41,6 +41,7 @@ class AxiomSoap11Header extends AxiomSoapHeader implements Soap11Header { super(axiomHeader, axiomFactory); } + @Override @SuppressWarnings("unchecked") public Iterator examineHeaderElementsToProcess(final String[] actors) { RolePlayer rolePlayer = null; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Body.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Body.java index ab6468e5..ac600084 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Body.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Body.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,6 @@ package org.springframework.ws.soap.axiom; import java.util.Locale; import javax.xml.namespace.QName; -import org.springframework.util.Assert; -import org.springframework.ws.soap.axiom.support.AxiomUtils; -import org.springframework.ws.soap.soap12.Soap12Body; -import org.springframework.ws.soap.soap12.Soap12Fault; - import org.apache.axiom.soap.SOAP12Constants; import org.apache.axiom.soap.SOAPBody; import org.apache.axiom.soap.SOAPFactory; @@ -34,6 +29,11 @@ import org.apache.axiom.soap.SOAPFaultText; import org.apache.axiom.soap.SOAPFaultValue; import org.apache.axiom.soap.SOAPProcessingException; +import org.springframework.util.Assert; +import org.springframework.ws.soap.axiom.support.AxiomUtils; +import org.springframework.ws.soap.soap12.Soap12Body; +import org.springframework.ws.soap.soap12.Soap12Fault; + /** * Axiom-specific version of org.springframework.ws.soap.Soap12Body. * @@ -46,30 +46,35 @@ class AxiomSoap12Body extends AxiomSoapBody implements Soap12Body { super(axiomBody, axiomFactory, payloadCaching); } + @Override public Soap12Fault addMustUnderstandFault(String reason, Locale locale) { Assert.notNull(locale, "No locale given"); SOAPFault fault = addStandardFault(SOAP12Constants.FAULT_CODE_MUST_UNDERSTAND, reason, locale); return new AxiomSoap12Fault(fault, getAxiomFactory()); } + @Override public Soap12Fault addClientOrSenderFault(String reason, Locale locale) { Assert.notNull(locale, "No locale given"); SOAPFault fault = addStandardFault(SOAP12Constants.FAULT_CODE_SENDER, reason, locale); return new AxiomSoap12Fault(fault, getAxiomFactory()); } + @Override public Soap12Fault addServerOrReceiverFault(String reason, Locale locale) { Assert.notNull(locale, "No locale given"); SOAPFault fault = addStandardFault(SOAP12Constants.FAULT_CODE_RECEIVER, reason, locale); return new AxiomSoap12Fault(fault, getAxiomFactory()); } + @Override public Soap12Fault addVersionMismatchFault(String reason, Locale locale) { Assert.notNull(locale, "No locale given"); SOAPFault fault = addStandardFault(SOAP12Constants.FAULT_CODE_VERSION_MISMATCH, reason, locale); return new AxiomSoap12Fault(fault, getAxiomFactory()); } + @Override public Soap12Fault addDataEncodingUnknownFault(QName[] subcodes, String reason, Locale locale) { Assert.notNull(locale, "No locale given"); SOAPFault fault = addStandardFault(SOAP12Constants.FAULT_CODE_DATA_ENCODING_UNKNOWN, reason, locale); @@ -97,6 +102,7 @@ class AxiomSoap12Body extends AxiomSoapBody implements Soap12Body { } } + @Override public Soap12Fault getFault() { SOAPFault axiomFault = getAxiomBody().getFault(); return axiomFault != null ? new AxiomSoap12Fault(axiomFault, getAxiomFactory()) : null; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Fault.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Fault.java index 4ea46dea..3bbe9996 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Fault.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Fault.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,11 +22,6 @@ import java.util.List; import java.util.Locale; import javax.xml.namespace.QName; -import org.springframework.util.StringUtils; -import org.springframework.ws.soap.axiom.support.AxiomUtils; -import org.springframework.ws.soap.soap12.Soap12Fault; -import org.springframework.xml.namespace.QNameUtils; - import org.apache.axiom.om.OMNamespace; import org.apache.axiom.soap.SOAPFactory; import org.apache.axiom.soap.SOAPFault; @@ -38,6 +33,11 @@ import org.apache.axiom.soap.SOAPFaultText; import org.apache.axiom.soap.SOAPFaultValue; import org.apache.axiom.soap.SOAPProcessingException; +import org.springframework.util.StringUtils; +import org.springframework.ws.soap.axiom.support.AxiomUtils; +import org.springframework.ws.soap.soap12.Soap12Fault; +import org.springframework.xml.namespace.QNameUtils; + /** Axiom-specific version of org.springframework.ws.soap.Soap12Fault. */ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault { @@ -45,10 +45,12 @@ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault { super(axiomFault, axiomFactory); } + @Override public QName getFaultCode() { return getAxiomFault().getCode().getValue().getTextAsQName(); } + @Override public Iterator getFaultSubcodes() { List subcodes = new ArrayList(); SOAPFaultSubCode subcode = getAxiomFault().getCode().getSubCode(); @@ -59,6 +61,7 @@ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault { return subcodes.iterator(); } + @Override public void addFaultSubcode(QName subcode) { SOAPFaultCode faultCode = getAxiomFault().getCode(); SOAPFaultSubCode faultSubCode = null; @@ -99,6 +102,7 @@ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault { faultValue.setText(prefix + ":" + code.getLocalPart()); } + @Override public String getFaultNode() { SOAPFaultNode faultNode = getAxiomFault().getNode(); if (faultNode == null) { @@ -109,6 +113,7 @@ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault { } } + @Override public void setFaultNode(String uri) { try { SOAPFaultNode faultNode = getAxiomFactory().createSOAPFaultNode(getAxiomFault()); @@ -120,10 +125,12 @@ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault { } } + @Override public String getFaultStringOrReason() { return getFaultReasonText(Locale.getDefault()); } + @Override public String getFaultReasonText(Locale locale) { SOAPFaultReason faultReason = getAxiomFault().getReason(); String language = AxiomUtils.toLanguage(locale); @@ -131,6 +138,7 @@ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault { return faultText != null ? faultText.getText() : null; } + @Override public void setFaultReasonText(Locale locale, String text) { SOAPFaultReason faultReason = getAxiomFault().getReason(); String language = AxiomUtils.toLanguage(locale); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Header.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Header.java index 3db7ef7c..ff8b5cd2 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Header.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoap12Header.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,12 +21,6 @@ import java.util.Iterator; import java.util.List; import javax.xml.namespace.QName; -import org.springframework.util.ObjectUtils; -import org.springframework.ws.soap.SoapHeaderElement; -import org.springframework.ws.soap.SoapHeaderException; -import org.springframework.ws.soap.soap12.Soap12Header; -import org.springframework.xml.namespace.QNameUtils; - import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; import org.apache.axiom.om.OMNamespace; @@ -36,6 +30,12 @@ import org.apache.axiom.soap.SOAPHeader; import org.apache.axiom.soap.SOAPHeaderBlock; import org.apache.axiom.soap.SOAPProcessingException; +import org.springframework.util.ObjectUtils; +import org.springframework.ws.soap.SoapHeaderElement; +import org.springframework.ws.soap.SoapHeaderException; +import org.springframework.ws.soap.soap12.Soap12Header; +import org.springframework.xml.namespace.QNameUtils; + /** * Axiom-specific version of org.springframework.ws.soap.Soap12Header. * @@ -48,6 +48,7 @@ class AxiomSoap12Header extends AxiomSoapHeader implements Soap12Header { super(axiomHeader, axiomFactory); } + @Override public SoapHeaderElement addNotUnderstoodHeaderElement(QName headerName) { try { SOAPHeaderBlock notUnderstood = @@ -62,6 +63,7 @@ class AxiomSoap12Header extends AxiomSoapHeader implements Soap12Header { } } + @Override public SoapHeaderElement addUpgradeHeaderElement(String[] supportedSoapUris) { try { SOAPHeaderBlock upgrade = getAxiomHeader().addHeaderBlock("Upgrade", getAxiomHeader().getNamespace()); @@ -78,6 +80,7 @@ class AxiomSoap12Header extends AxiomSoapHeader implements Soap12Header { } } + @Override @SuppressWarnings("unchecked") public Iterator examineHeaderElementsToProcess(final String[] roles, final boolean isUltimateDestination) throws SoapHeaderException { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapBody.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapBody.java index 52a3155f..d0862f99 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapBody.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapBody.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,16 +19,16 @@ package org.springframework.ws.soap.axiom; import javax.xml.transform.Result; import javax.xml.transform.Source; -import org.springframework.util.Assert; -import org.springframework.ws.soap.SoapBody; -import org.springframework.ws.soap.axiom.support.AxiomUtils; -import org.springframework.ws.stream.StreamingPayload; - import org.apache.axiom.om.OMDataSource; import org.apache.axiom.om.OMElement; import org.apache.axiom.soap.SOAPBody; import org.apache.axiom.soap.SOAPFactory; +import org.springframework.util.Assert; +import org.springframework.ws.soap.SoapBody; +import org.springframework.ws.soap.axiom.support.AxiomUtils; +import org.springframework.ws.stream.StreamingPayload; + /** * Axiom-specific version of org.springframework.ws.soap.Soap11Body. * @@ -49,14 +49,17 @@ abstract class AxiomSoapBody extends AxiomSoapElement implements SoapBody { } } + @Override public Source getPayloadSource() { return payload.getSource(); } + @Override public Result getPayloadResult() { return payload.getResult(); } + @Override public boolean hasFault() { return getAxiomBody().hasFault(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapElement.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapElement.java index 4999f4e2..c2aeb61e 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapElement.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,6 +52,7 @@ class AxiomSoapElement implements SoapElement { this.axiomFactory = axiomFactory; } + @Override public final QName getName() { try { return axiomElement.getQName(); @@ -61,6 +62,7 @@ class AxiomSoapElement implements SoapElement { } } + @Override public final Source getSource() { try { return StaxUtils.createCustomStaxSource(axiomElement.getXMLStreamReader()); @@ -70,6 +72,7 @@ class AxiomSoapElement implements SoapElement { } } + @Override public final void addAttribute(QName name, String value) { try { String namespaceUri = name.getNamespaceURI(); @@ -87,6 +90,7 @@ class AxiomSoapElement implements SoapElement { } } + @Override public void removeAttribute(QName name) { try { OMAttribute attribute = getAxiomElement().getAttribute(name); @@ -99,6 +103,7 @@ class AxiomSoapElement implements SoapElement { } } + @Override public final String getAttributeValue(QName name) { try { return getAxiomElement().getAttributeValue(name); @@ -108,6 +113,7 @@ class AxiomSoapElement implements SoapElement { } } + @Override public final Iterator getAllAttributes() { try { List results = new ArrayList(); @@ -123,6 +129,7 @@ class AxiomSoapElement implements SoapElement { } } + @Override public void addNamespaceDeclaration(String prefix, String namespaceUri) { try { if (StringUtils.hasLength(prefix)) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapEnvelope.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapEnvelope.java index a1abd4c2..5a38b5ef 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapEnvelope.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapEnvelope.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,6 +51,7 @@ class AxiomSoapEnvelope extends AxiomSoapElement implements SoapEnvelope { this.langAttributeOnSoap11FaultString = langAttributeOnSoap11FaultString; } + @Override public SoapHeader getHeader() { try { if (getAxiomEnvelope().getHeader() == null) { @@ -75,6 +76,7 @@ class AxiomSoapEnvelope extends AxiomSoapElement implements SoapEnvelope { } } + @Override public SoapBody getBody() { if (body == null) { try { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFault.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFault.java index 37257bbb..11cc8c69 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFault.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFault.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.apache.axiom.soap.SOAPFault; import org.apache.axiom.soap.SOAPFaultDetail; import org.apache.axiom.soap.SOAPFaultRole; import org.apache.axiom.soap.SOAPProcessingException; + import org.springframework.ws.soap.SoapFault; import org.springframework.ws.soap.SoapFaultDetail; @@ -32,11 +33,13 @@ abstract class AxiomSoapFault extends AxiomSoapElement implements SoapFault { super(axiomFault, axiomFactory); } + @Override public String getFaultActorOrRole() { SOAPFaultRole faultRole = getAxiomFault().getRole(); return faultRole != null ? faultRole.getRoleValue() : null; } + @Override public void setFaultActorOrRole(String actor) { try { SOAPFaultRole axiomFaultRole = getAxiomFactory().createSOAPFaultRole(getAxiomFault()); @@ -48,6 +51,7 @@ abstract class AxiomSoapFault extends AxiomSoapElement implements SoapFault { } + @Override public SoapFaultDetail getFaultDetail() { try { SOAPFaultDetail axiomFaultDetail = getAxiomFault().getDetail(); @@ -59,6 +63,7 @@ abstract class AxiomSoapFault extends AxiomSoapElement implements SoapFault { } + @Override public SoapFaultDetail addFaultDetail() { try { SOAPFaultDetail axiomFaultDetail = getAxiomFactory().createSOAPFaultDetail(getAxiomFault()); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetail.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetail.java index b66efe1d..3605a98d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetail.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetail.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,14 +20,14 @@ import java.util.Iterator; import javax.xml.namespace.QName; import javax.xml.transform.Result; -import org.springframework.ws.soap.SoapFaultDetail; -import org.springframework.ws.soap.SoapFaultDetailElement; - import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; import org.apache.axiom.soap.SOAPFactory; import org.apache.axiom.soap.SOAPFaultDetail; +import org.springframework.ws.soap.SoapFaultDetail; +import org.springframework.ws.soap.SoapFaultDetailElement; + /** * Axiom-specific version of org.springframework.ws.soap.SoapFaultDetail. * @@ -40,6 +40,7 @@ class AxiomSoapFaultDetail extends AxiomSoapElement implements SoapFaultDetail { super(axiomFaultDetail, axiomFactory); } + @Override public SoapFaultDetailElement addFaultDetailElement(QName name) { try { OMElement element = getAxiomFactory().createOMElement(name, getAxiomFaultDetail()); @@ -51,10 +52,12 @@ class AxiomSoapFaultDetail extends AxiomSoapElement implements SoapFaultDetail { } + @Override public Iterator getDetailEntries() { return new AxiomSoapFaultDetailElementIterator(getAxiomFaultDetail().getChildElements()); } + @Override public Result getResult() { return new AxiomResult(getAxiomFaultDetail(), getAxiomFactory()); } @@ -71,10 +74,12 @@ class AxiomSoapFaultDetail extends AxiomSoapElement implements SoapFaultDetail { this.axiomIterator = axiomIterator; } + @Override public boolean hasNext() { return axiomIterator.hasNext(); } + @Override public SoapFaultDetailElement next() { try { OMElement axiomElement = axiomIterator.next(); @@ -86,6 +91,7 @@ class AxiomSoapFaultDetail extends AxiomSoapElement implements SoapFaultDetail { } + @Override public void remove() { axiomIterator.remove(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetailElement.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetailElement.java index b494b4f6..27f7d685 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetailElement.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapFaultDetailElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ class AxiomSoapFaultDetailElement extends AxiomSoapElement implements SoapFaultD super(axiomElement, soapFactory); } + @Override public Result getResult() { try { return new AxiomResult(getAxiomElement(), getAxiomFactory()); @@ -46,6 +47,7 @@ class AxiomSoapFaultDetailElement extends AxiomSoapElement implements SoapFaultD } + @Override public void addText(String text) { try { getAxiomElement().setText(text); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeader.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeader.java index f74962bb..77e5f9a6 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeader.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeader.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,11 +20,6 @@ import java.util.Iterator; import javax.xml.namespace.QName; import javax.xml.transform.Result; -import org.springframework.ws.soap.SoapHeader; -import org.springframework.ws.soap.SoapHeaderElement; -import org.springframework.ws.soap.SoapHeaderException; -import org.springframework.xml.namespace.QNameUtils; - import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; import org.apache.axiom.om.OMNamespace; @@ -32,6 +27,11 @@ import org.apache.axiom.soap.SOAPFactory; import org.apache.axiom.soap.SOAPHeader; import org.apache.axiom.soap.SOAPHeaderBlock; +import org.springframework.ws.soap.SoapHeader; +import org.springframework.ws.soap.SoapHeaderElement; +import org.springframework.ws.soap.SoapHeaderException; +import org.springframework.xml.namespace.QNameUtils; + /** * Axiom-specific version of org.springframework.ws.soap.SoapHeader. * @@ -44,10 +44,12 @@ abstract class AxiomSoapHeader extends AxiomSoapElement implements SoapHeader { super(axiomHeader, axiomFactory); } + @Override public Result getResult() { return new AxiomResult(getAxiomHeader(), getAxiomFactory()); } + @Override public SoapHeaderElement addHeaderElement(QName name) { try { OMNamespace namespace = @@ -60,6 +62,7 @@ abstract class AxiomSoapHeader extends AxiomSoapElement implements SoapHeader { } } + @Override public void removeHeaderElement(QName name) throws SoapHeaderException { try { OMElement element = getAxiomHeader().getFirstChildWithName(name); @@ -72,6 +75,7 @@ abstract class AxiomSoapHeader extends AxiomSoapElement implements SoapHeader { } } + @Override @SuppressWarnings("unchecked") public Iterator examineMustUnderstandHeaderElements(String role) { try { @@ -82,6 +86,7 @@ abstract class AxiomSoapHeader extends AxiomSoapElement implements SoapHeader { } } + @Override @SuppressWarnings("unchecked") public Iterator examineAllHeaderElements() { try { @@ -92,6 +97,7 @@ abstract class AxiomSoapHeader extends AxiomSoapElement implements SoapHeader { } } + @Override @SuppressWarnings("unchecked") public Iterator examineHeaderElements(QName name) throws SoapHeaderException { try { @@ -114,10 +120,12 @@ abstract class AxiomSoapHeader extends AxiomSoapElement implements SoapHeader { this.axiomIterator = axiomIterator; } + @Override public boolean hasNext() { return axiomIterator.hasNext(); } + @Override public SoapHeaderElement next() { try { SOAPHeaderBlock axiomHeaderBlock = axiomIterator.next(); @@ -128,6 +136,7 @@ abstract class AxiomSoapHeader extends AxiomSoapElement implements SoapHeader { } } + @Override public void remove() { axiomIterator.remove(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeaderElement.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeaderElement.java index b6ae1aa5..a51b08e5 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeaderElement.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapHeaderElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,22 +31,27 @@ class AxiomSoapHeaderElement extends AxiomSoapElement implements SoapHeaderEleme super(axiomHeaderBlock, axiomFactory); } + @Override public String getActorOrRole() { return getAxiomHeaderBlock().getRole(); } + @Override public void setActorOrRole(String role) { getAxiomHeaderBlock().setRole(role); } + @Override public boolean getMustUnderstand() { return getAxiomHeaderBlock().getMustUnderstand(); } + @Override public void setMustUnderstand(boolean mustUnderstand) { getAxiomHeaderBlock().setMustUnderstand(mustUnderstand); } + @Override public Result getResult() { try { return new AxiomResult(getAxiomHeaderBlock(), getAxiomFactory()); @@ -57,10 +62,12 @@ class AxiomSoapHeaderElement extends AxiomSoapElement implements SoapHeaderEleme } + @Override public String getText() { return getAxiomHeaderBlock().getText(); } + @Override public void setText(String content) { getAxiomHeaderBlock().setText(content); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessage.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessage.java index 2432662c..291e0d71 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessage.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessage.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -172,11 +172,13 @@ public class AxiomSoapMessage extends AbstractSoapMessage implements StreamingWe this.outputFormat = outputFormat; } + @Override public void setStreamingPayload(StreamingPayload payload) { AxiomSoapBody soapBody = (AxiomSoapBody) getSoapBody(); soapBody.setStreamingPayload(payload); } + @Override public SoapEnvelope getEnvelope() { if (envelope == null) { try { @@ -190,19 +192,23 @@ public class AxiomSoapMessage extends AbstractSoapMessage implements StreamingWe return envelope; } + @Override public String getSoapAction() { return soapAction; } + @Override public void setSoapAction(String soapAction) { soapAction = SoapUtils.escapeAction(soapAction); this.soapAction = soapAction; } + @Override public Document getDocument() { return AxiomUtils.toDocument(axiomMessage.getSOAPEnvelope()); } + @Override public void setDocument(Document document) { // save the Soap Action String soapAction = getSoapAction(); @@ -216,6 +222,7 @@ public class AxiomSoapMessage extends AbstractSoapMessage implements StreamingWe setSoapAction(soapAction); } + @Override public boolean isXopPackage() { try { return MTOMConstants.MTOM_TYPE.equals(attachments.getAttachmentSpecType()); @@ -229,10 +236,12 @@ public class AxiomSoapMessage extends AbstractSoapMessage implements StreamingWe } } + @Override public boolean convertToXopPackage() { return false; } + @Override public Attachment getAttachment(String contentId) { Assert.hasLength(contentId, "contentId must not be empty"); if (contentId.startsWith("<") && contentId.endsWith(">")) { @@ -242,10 +251,12 @@ public class AxiomSoapMessage extends AbstractSoapMessage implements StreamingWe return dataHandler != null ? new AxiomAttachment(contentId, dataHandler) : null; } + @Override public Iterator getAttachments() { return new AxiomAttachmentIterator(); } + @Override public Attachment addAttachment(String contentId, DataHandler dataHandler) { Assert.hasLength(contentId, "contentId must not be empty"); Assert.notNull(dataHandler, "dataHandler must not be null"); @@ -253,6 +264,7 @@ public class AxiomSoapMessage extends AbstractSoapMessage implements StreamingWe return new AxiomAttachment(contentId, dataHandler); } + @Override public void writeTo(OutputStream outputStream) throws IOException { try { @@ -380,16 +392,19 @@ public class AxiomSoapMessage extends AbstractSoapMessage implements StreamingWe iterator = attachments.getContentIDSet().iterator(); } + @Override public boolean hasNext() { return iterator.hasNext(); } + @Override public Attachment next() { String contentId = iterator.next(); DataHandler dataHandler = attachments.getDataHandler(contentId); return new AxiomAttachment(contentId, dataHandler); } + @Override public void remove() { iterator.remove(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java index 0d8449ce..d03cb488 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -25,19 +25,6 @@ import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.util.Assert; -import org.springframework.util.StringUtils; -import org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor; -import org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping; -import org.springframework.ws.soap.SoapMessageFactory; -import org.springframework.ws.soap.SoapVersion; -import org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor; -import org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping; -import org.springframework.ws.soap.support.SoapUtils; -import org.springframework.ws.transport.TransportConstants; -import org.springframework.ws.transport.TransportInputStream; - import org.apache.axiom.attachments.Attachments; import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMException; @@ -53,6 +40,19 @@ import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.util.Assert; +import org.springframework.util.StringUtils; +import org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor; +import org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping; +import org.springframework.ws.soap.SoapMessageFactory; +import org.springframework.ws.soap.SoapVersion; +import org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor; +import org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping; +import org.springframework.ws.soap.support.SoapUtils; +import org.springframework.ws.transport.TransportConstants; +import org.springframework.ws.transport.TransportInputStream; + /** * Axiom-specific implementation of the {@link org.springframework.ws.WebServiceMessageFactory WebServiceMessageFactory} * interface. Creates {@link org.springframework.ws.soap.axiom.AxiomSoapMessage AxiomSoapMessages}. @@ -151,6 +151,7 @@ public class AxiomSoapMessageFactory implements SoapMessageFactory, Initializing this.attachmentCacheThreshold = attachmentCacheThreshold; } + @Override public void setSoapVersion(SoapVersion version) { if (SoapVersion.SOAP_11 == version) { soapFactory = OMAbstractFactory.getSOAP11Factory(); @@ -176,6 +177,7 @@ public class AxiomSoapMessageFactory implements SoapMessageFactory, Initializing this.langAttributeOnSoap11FaultString = langAttributeOnSoap11FaultString; } + @Override public void afterPropertiesSet() throws Exception { if (logger.isInfoEnabled()) { logger.info(payloadCaching ? "Enabled payload caching" : "Disabled payload caching"); @@ -186,10 +188,12 @@ public class AxiomSoapMessageFactory implements SoapMessageFactory, Initializing } } + @Override public AxiomSoapMessage createWebServiceMessage() { return new AxiomSoapMessage(soapFactory, payloadCaching, langAttributeOnSoap11FaultString); } + @Override public AxiomSoapMessage createWebServiceMessage(InputStream inputStream) throws IOException { Assert.isInstanceOf(TransportInputStream.class, inputStream, "AxiomSoapMessageFactory requires a TransportInputStream"); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/NonCachingPayload.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/NonCachingPayload.java index b83b6f2a..e7968b2d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/NonCachingPayload.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/NonCachingPayload.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,6 @@ import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; import javax.xml.transform.Result; -import org.springframework.util.xml.StaxUtils; - import org.apache.axiom.om.OMDataSource; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMNamespace; @@ -34,6 +32,8 @@ import org.apache.axiom.om.util.StAXUtils; import org.apache.axiom.soap.SOAPBody; import org.apache.axiom.soap.SOAPFactory; +import org.springframework.util.xml.StaxUtils; + /** * Non-caching payload in Axiom. * @@ -82,18 +82,22 @@ class NonCachingPayload extends AbstractPayload { } } + @Override public void writeStartDocument() throws XMLStreamException { // ignored } + @Override public void writeStartDocument(String version) throws XMLStreamException { // ignored } + @Override public void writeStartDocument(String encoding, String version) throws XMLStreamException { this.encoding = encoding; } + @Override public void writeStartElement(String localName) throws XMLStreamException { if (name == null) { name = new QName(localName); @@ -102,6 +106,7 @@ class NonCachingPayload extends AbstractPayload { delegate.writeStartElement(localName); } + @Override public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException { if (name == null) { name = new QName(namespaceURI, localName); @@ -110,6 +115,7 @@ class NonCachingPayload extends AbstractPayload { delegate.writeStartElement(namespaceURI, localName); } + @Override public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException { if (name == null) { name = new QName(namespaceURI, localName, prefix); @@ -118,6 +124,7 @@ class NonCachingPayload extends AbstractPayload { delegate.writeStartElement(prefix, localName, namespaceURI); } + @Override public void writeEndElement() throws XMLStreamException { elementDepth--; delegate.writeEndElement(); @@ -140,6 +147,7 @@ class NonCachingPayload extends AbstractPayload { } } + @Override public void writeEmptyElement(String localName) throws XMLStreamException { if (name == null) { name = new QName(localName); @@ -148,6 +156,7 @@ class NonCachingPayload extends AbstractPayload { addPayload(); } + @Override public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException { if (name == null) { name = new QName(namespaceURI, localName); @@ -156,6 +165,7 @@ class NonCachingPayload extends AbstractPayload { addPayload(); } + @Override public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException { if (name == null) { name = new QName(namespaceURI, localName, prefix); @@ -164,6 +174,7 @@ class NonCachingPayload extends AbstractPayload { addPayload(); } + @Override public void writeEndDocument() throws XMLStreamException { elementDepth = 0; delegate.writeEndDocument(); @@ -172,88 +183,109 @@ class NonCachingPayload extends AbstractPayload { // Delegation + @Override public void close() throws XMLStreamException { addPayload(); delegate.close(); } + @Override public void flush() throws XMLStreamException { delegate.flush(); } + @Override public NamespaceContext getNamespaceContext() { return delegate.getNamespaceContext(); } + @Override public String getPrefix(String uri) throws XMLStreamException { return delegate.getPrefix(uri); } + @Override public Object getProperty(String name) throws IllegalArgumentException { return delegate.getProperty(name); } + @Override public void setDefaultNamespace(String uri) throws XMLStreamException { delegate.setDefaultNamespace(uri); } + @Override public void setNamespaceContext(NamespaceContext context) throws XMLStreamException { delegate.setNamespaceContext(context); } + @Override public void setPrefix(String prefix, String uri) throws XMLStreamException { delegate.setPrefix(prefix, uri); } + @Override public void writeAttribute(String localName, String value) throws XMLStreamException { delegate.writeAttribute(localName, value); } + @Override public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException { delegate.writeAttribute(namespaceURI, localName, value); } + @Override public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException { delegate.writeAttribute(prefix, namespaceURI, localName, value); } + @Override public void writeCData(String data) throws XMLStreamException { delegate.writeCData(data); } + @Override public void writeCharacters(char[] text, int start, int len) throws XMLStreamException { delegate.writeCharacters(text, start, len); } + @Override public void writeCharacters(String text) throws XMLStreamException { delegate.writeCharacters(text); } + @Override public void writeComment(String data) throws XMLStreamException { delegate.writeComment(data); } + @Override public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException { delegate.writeDefaultNamespace(namespaceURI); } + @Override public void writeDTD(String dtd) throws XMLStreamException { delegate.writeDTD(dtd); } + @Override public void writeEntityRef(String name) throws XMLStreamException { delegate.writeEntityRef(name); } + @Override public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException { delegate.writeNamespace(prefix, namespaceURI); } + @Override public void writeProcessingInstruction(String target) throws XMLStreamException { delegate.writeProcessingInstruction(target); } + @Override public void writeProcessingInstruction(String target, String data) throws XMLStreamException { delegate.writeProcessingInstruction(target, data); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/StreamingOMDataSource.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/StreamingOMDataSource.java index 87627d58..7b786357 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/StreamingOMDataSource.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/axiom/StreamingOMDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +24,14 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; -import org.springframework.util.Assert; -import org.springframework.util.StringUtils; -import org.springframework.ws.stream.StreamingPayload; - import org.apache.axiom.om.OMDataSource; import org.apache.axiom.om.OMOutputFormat; import org.apache.axiom.om.util.StAXUtils; +import org.springframework.util.Assert; +import org.springframework.util.StringUtils; +import org.springframework.ws.stream.StreamingPayload; + /** * Implementation of {@link OMDataSource} that wraps a {@link StreamingPayload}. * @@ -47,6 +47,7 @@ class StreamingOMDataSource implements OMDataSource { this.payload = payload; } + @Override public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException { XMLStreamWriter streamWriter; if (format != null && StringUtils.hasLength(format.getCharSetEncoding())) { @@ -58,16 +59,19 @@ class StreamingOMDataSource implements OMDataSource { serialize(streamWriter); } + @Override public void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException { XMLStreamWriter streamWriter = StAXUtils.createXMLStreamWriter(writer); serialize(streamWriter); } + @Override public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException { payload.writeTo(xmlWriter); xmlWriter.flush(); } + @Override public XMLStreamReader getReader() throws XMLStreamException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); serialize(bos, null); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/client/core/SoapActionCallback.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/client/core/SoapActionCallback.java index 5c1cc23f..31a0cff7 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/client/core/SoapActionCallback.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/client/core/SoapActionCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,6 +52,7 @@ public class SoapActionCallback implements WebServiceMessageCallback { this.soapAction = soapAction; } + @Override public void doWithMessage(WebServiceMessage message) throws IOException { Assert.isInstanceOf(SoapMessage.class, message); SoapMessage soapMessage = (SoapMessage) message; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/client/core/SoapFaultMessageResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/client/core/SoapFaultMessageResolver.java index 84f9cdd5..762da0ff 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/client/core/SoapFaultMessageResolver.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/client/core/SoapFaultMessageResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ import org.springframework.ws.soap.client.SoapFaultClientException; */ public class SoapFaultMessageResolver implements FaultMessageResolver { + @Override public void resolveFault(WebServiceMessage message) throws IOException { SoapMessage soapMessage = (SoapMessage) message; throw new SoapFaultClientException(soapMessage); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajAttachment.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajAttachment.java index 707f2f99..c42fee13 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajAttachment.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajAttachment.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,14 +41,17 @@ class SaajAttachment implements Attachment { this.saajAttachment = saajAttachment; } + @Override public String getContentId() { return saajAttachment.getContentId(); } + @Override public String getContentType() { return saajAttachment.getContentType(); } + @Override public InputStream getInputStream() throws IOException { try { return saajAttachment.getDataHandler().getInputStream(); @@ -58,6 +61,7 @@ class SaajAttachment implements Attachment { } } + @Override public long getSize() { try { return saajAttachment.getSize(); @@ -67,6 +71,7 @@ class SaajAttachment implements Attachment { } } + @Override public DataHandler getDataHandler() { try { return saajAttachment.getDataHandler(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Body.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Body.java index cecfce09..f1dc65dd 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Body.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Body.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,11 +42,13 @@ class SaajSoap11Body extends SaajSoapBody implements Soap11Body { this.langAttributeOnSoap11FaultString = langAttributeOnSoap11FaultString; } + @Override public Soap11Fault getFault() { SOAPFault fault = getSaajBody().getFault(); return fault != null ? new SaajSoap11Fault(fault) : null; } + @Override public Soap11Fault addFault(QName faultCode, String faultString, Locale faultStringLocale) { Assert.notNull(faultCode, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); @@ -73,18 +75,22 @@ class SaajSoap11Body extends SaajSoapBody implements Soap11Body { } } + @Override public Soap11Fault addClientOrSenderFault(String faultString, Locale locale) { return addFault(SoapVersion.SOAP_11.getClientOrSenderFaultName(), faultString, locale); } + @Override public Soap11Fault addMustUnderstandFault(String faultString, Locale locale) { return addFault(SoapVersion.SOAP_11.getMustUnderstandFaultName(), faultString, locale); } + @Override public Soap11Fault addServerOrReceiverFault(String faultString, Locale locale) { return addFault(SoapVersion.SOAP_11.getServerOrReceiverFaultName(), faultString, locale); } + @Override public Soap11Fault addVersionMismatchFault(String faultString, Locale locale) { return addFault(SoapVersion.SOAP_11.getVersionMismatchFaultName(), faultString, locale); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Fault.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Fault.java index bed10345..12d89b1a 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Fault.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Fault.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,10 +34,12 @@ class SaajSoap11Fault extends SaajSoapFault implements Soap11Fault { super(fault); } + @Override public String getFaultActorOrRole() { return getSaajFault().getFaultActor(); } + @Override public void setFaultActorOrRole(String faultActor) { try { getSaajFault().setFaultActor(faultActor); @@ -47,10 +49,12 @@ class SaajSoap11Fault extends SaajSoapFault implements Soap11Fault { } } + @Override public String getFaultStringOrReason() { return getSaajFault().getFaultString(); } + @Override public Locale getFaultStringLocale() { return getSaajFault().getFaultStringLocale(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Header.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Header.java index 860ddb45..ad2d0ada 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Header.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Header.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,7 @@ class SaajSoap11Header extends SaajSoapHeader implements Soap11Header { super(header); } + @Override public Iterator examineHeaderElementsToProcess(String[] actors) { List result = new ArrayList(); Iterator iterator = getSaajHeader().examineAllHeaderElements(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Body.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Body.java index 76553e7c..b0508471 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Body.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Body.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,27 +39,33 @@ class SaajSoap12Body extends SaajSoapBody implements Soap12Body { super(body); } + @Override public Soap12Fault getFault() { SOAPFault fault = getSaajBody().getFault(); return fault != null ? new SaajSoap12Fault(fault) : null; } + @Override public Soap12Fault addClientOrSenderFault(String faultString, Locale locale) { return addFault(SoapVersion.SOAP_12.getClientOrSenderFaultName(), faultString, locale); } + @Override public Soap12Fault addMustUnderstandFault(String faultString, Locale locale) { return addFault(SoapVersion.SOAP_12.getMustUnderstandFaultName(), faultString, locale); } + @Override public Soap12Fault addServerOrReceiverFault(String faultString, Locale locale) { return addFault(SoapVersion.SOAP_12.getServerOrReceiverFaultName(), faultString, locale); } + @Override public Soap12Fault addVersionMismatchFault(String faultString, Locale locale) { return addFault(SoapVersion.SOAP_12.getVersionMismatchFaultName(), faultString, locale); } + @Override public Soap12Fault addDataEncodingUnknownFault(QName[] subcodes, String reason, Locale locale) { QName name = new QName(SoapVersion.SOAP_12.getEnvelopeNamespaceUri(), "DataEncodingUnknown"); Soap12Fault fault = addFault(name, reason, locale); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Fault.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Fault.java index 4bc90447..e609de23 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Fault.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Fault.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,10 +34,12 @@ class SaajSoap12Fault extends SaajSoapFault implements Soap12Fault { super(fault); } + @Override public String getFaultActorOrRole() { return getSaajFault().getFaultRole(); } + @Override public void setFaultActorOrRole(String faultRole) { try { getSaajFault().setFaultRole(faultRole); @@ -47,10 +49,12 @@ class SaajSoap12Fault extends SaajSoapFault implements Soap12Fault { } } + @Override public Iterator getFaultSubcodes() { return getSaajFault().getFaultSubcodes(); } + @Override public void addFaultSubcode(QName subcode) { try { getSaajFault().appendFaultSubcode(subcode); @@ -60,10 +64,12 @@ class SaajSoap12Fault extends SaajSoapFault implements Soap12Fault { } } + @Override public String getFaultNode() { return getSaajFault().getFaultNode(); } + @Override public void setFaultNode(String uri) { try { getSaajFault().setFaultNode(uri); @@ -74,6 +80,7 @@ class SaajSoap12Fault extends SaajSoapFault implements Soap12Fault { } + @Override public void setFaultReasonText(Locale locale, String text) { try { getSaajFault().addFaultReasonText(text, locale); @@ -84,6 +91,7 @@ class SaajSoap12Fault extends SaajSoapFault implements Soap12Fault { } + @Override public String getFaultReasonText(Locale locale) { try { return getSaajFault().getFaultReasonText(locale); @@ -93,6 +101,7 @@ class SaajSoap12Fault extends SaajSoapFault implements Soap12Fault { } } + @Override public String getFaultStringOrReason() { return getSaajFault().getFaultString(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Header.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Header.java index 669e1cb4..6660c4cc 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Header.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Header.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,6 +43,7 @@ class SaajSoap12Header extends SaajSoapHeader implements Soap12Header { super(header); } + @Override public SoapHeaderElement addNotUnderstoodHeaderElement(QName headerName) { try { SOAPHeaderElement headerElement = @@ -54,6 +55,7 @@ class SaajSoap12Header extends SaajSoapHeader implements Soap12Header { } } + @Override public SoapHeaderElement addUpgradeHeaderElement(String[] supportedSoapUris) { try { SOAPHeaderElement headerElement = @@ -65,6 +67,7 @@ class SaajSoap12Header extends SaajSoapHeader implements Soap12Header { } } + @Override public Iterator examineHeaderElementsToProcess(String[] roles, boolean isUltimateDestination) throws SoapHeaderException { List result = new ArrayList(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapEnvelope.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapEnvelope.java index 5295477a..e6fc0ff9 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapEnvelope.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapEnvelope.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,7 @@ class SaajSoapEnvelope extends SaajSoapElement implements SoapEnve this.langAttributeOnSoap11FaultString = langAttributeOnSoap11FaultString; } + @Override public SoapBody getBody() { if (body == null) { try { @@ -65,6 +66,7 @@ class SaajSoapEnvelope extends SaajSoapElement implements SoapEnve return body; } + @Override public SoapHeader getHeader() { if (header == null) { try { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetail.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetail.java index 971ab178..dca90a9d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetail.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetail.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,10 +42,12 @@ class SaajSoapFaultDetail extends SaajSoapElement implements S super(faultElement); } + @Override public Result getResult() { return new DOMResult(getSaajDetail()); } + @Override public SoapFaultDetailElement addFaultDetailElement(QName name) { try { DetailEntry detailEntry = getSaajDetail().addDetailEntry(name); @@ -56,6 +58,7 @@ class SaajSoapFaultDetail extends SaajSoapElement implements S } } + @Override public Iterator getDetailEntries() { Iterator iterator = getSaajDetail().getDetailEntries(); return new SaajSoapFaultDetailElementIterator(iterator); @@ -74,15 +77,18 @@ class SaajSoapFaultDetail extends SaajSoapElement implements S this.iterator = iterator; } + @Override public boolean hasNext() { return iterator.hasNext(); } + @Override public SoapFaultDetailElement next() { DetailEntry saajDetailEntry = iterator.next(); return new SaajSoapFaultDetailElement(saajDetailEntry); } + @Override public void remove() { iterator.remove(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetailElement.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetailElement.java index 3d4b082c..1fbff0b6 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetailElement.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapFaultDetailElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,10 +36,12 @@ class SaajSoapFaultDetailElement extends SaajSoapElement implements super(entry); } + @Override public Result getResult() { return new DOMResult(getSaajDetailEntry()); } + @Override public void addText(String text) { try { getSaajDetailEntry().addTextNode(text); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageFactory.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageFactory.java index df76c00a..1b5742df 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageFactory.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageFactory.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -108,6 +108,7 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB this.langAttributeOnSoap11FaultString = langAttributeOnSoap11FaultString; } + @Override public void setSoapVersion(SoapVersion version) { if (SaajUtils.getSaajVersion() >= SaajUtils.SAAJ_13) { if (SoapVersion.SOAP_11 == version) { @@ -126,6 +127,7 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB } } + @Override public void afterPropertiesSet() { if (messageFactory == null) { try { @@ -166,6 +168,7 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB } } + @Override public SaajSoapMessage createWebServiceMessage() { try { SOAPMessage saajMessage = messageFactory.createMessage(); @@ -177,6 +180,7 @@ public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingB } } + @Override public SaajSoapMessage createWebServiceMessage(InputStream inputStream) throws IOException { MimeHeaders mimeHeaders = parseMimeHeaders(inputStream); try { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajContentHandler.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajContentHandler.java index 0c72938f..b6dc66e4 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajContentHandler.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,14 +23,14 @@ import javax.xml.soap.SOAPElement; import javax.xml.soap.SOAPEnvelope; import javax.xml.soap.SOAPException; -import org.springframework.util.Assert; -import org.springframework.util.StringUtils; - import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.Locator; import org.xml.sax.SAXException; +import org.springframework.util.Assert; +import org.springframework.util.StringUtils; + /** * SAX ContentHandler that transforms callback calls to the creation of SAAJ Nodes and * SOAPElements. @@ -65,6 +65,7 @@ public class SaajContentHandler implements ContentHandler { this.element = element; } + @Override public void characters(char ch[], int start, int length) throws SAXException { try { String text = new String(ch, start, length); @@ -75,6 +76,7 @@ public class SaajContentHandler implements ContentHandler { } } + @Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { try { String childPrefix = getPrefix(qName); @@ -120,35 +122,44 @@ public class SaajContentHandler implements ContentHandler { } } + @Override public void endElement(String uri, String localName, String qName) throws SAXException { Assert.isTrue(localName.equals(element.getElementName().getLocalName()), "Invalid element on stack"); Assert.isTrue(uri.equals(element.getElementName().getURI()), "Invalid element on stack"); element = element.getParentElement(); } + @Override public void startPrefixMapping(String prefix, String uri) throws SAXException { namespaces.put(prefix, uri); } + @Override public void endPrefixMapping(String prefix) throws SAXException { namespaces.remove(prefix); } + @Override public void setDocumentLocator(Locator locator) { } + @Override public void startDocument() throws SAXException { } + @Override public void endDocument() throws SAXException { } + @Override public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { } + @Override public void processingInstruction(String target, String data) throws SAXException { } + @Override public void skippedEntity(String name) throws SAXException { } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajXmlReader.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajXmlReader.java index 0e961ffa..5fbbb522 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajXmlReader.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/support/SaajXmlReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,9 +22,6 @@ import javax.xml.soap.Node; import javax.xml.soap.SOAPElement; import javax.xml.soap.Text; -import org.springframework.util.StringUtils; -import org.springframework.xml.sax.AbstractXmlReader; - import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -32,6 +29,9 @@ import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; import org.xml.sax.helpers.AttributesImpl; +import org.springframework.util.StringUtils; +import org.springframework.xml.sax.AbstractXmlReader; + /** * SAX XMLReader that reads from a SAAJ Node. Consumes XMLEvents from an * XMLEventReader, and calls the corresponding methods on the SAX callback interfaces. @@ -96,6 +96,7 @@ public class SaajXmlReader extends AbstractXmlReader { * @param ignored is ignored * @throws org.xml.sax.SAXException A SAX exception, possibly wrapping a XMLStreamException */ + @Override public final void parse(InputSource ignored) throws SAXException { parse(); } @@ -108,6 +109,7 @@ public class SaajXmlReader extends AbstractXmlReader { * @param ignored is ignored * @throws SAXException A SAX exception, possibly wrapping a XMLStreamException */ + @Override public final void parse(String ignored) throws SAXException { parse(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractFaultCreatingValidatingMarshallingPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractFaultCreatingValidatingMarshallingPayloadEndpoint.java index 65084884..a8e75f8b 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractFaultCreatingValidatingMarshallingPayloadEndpoint.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/AbstractFaultCreatingValidatingMarshallingPayloadEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -141,6 +141,7 @@ public abstract class AbstractFaultCreatingValidatingMarshallingPayloadEndpoint this.faultStringOrReasonLocale = faultStringOrReasonLocale; } + @Override public final void setMessageSource(MessageSource messageSource) { this.messageSource = messageSource; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapHeaderElementMethodArgumentResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapHeaderElementMethodArgumentResolver.java index 1bea223c..7b0df037 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapHeaderElementMethodArgumentResolver.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapHeaderElementMethodArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,6 +52,7 @@ import org.springframework.xml.namespace.QNameUtils; */ public class SoapHeaderElementMethodArgumentResolver implements MethodArgumentResolver { + @Override public boolean supportsParameter(MethodParameter parameter) { SoapHeader soapHeader = parameter.getParameterAnnotation(SoapHeader.class); if (soapHeader == null) { @@ -79,6 +80,7 @@ public class SoapHeaderElementMethodArgumentResolver implements MethodArgumentRe return false; } + @Override public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception { Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest()); SoapMessage request = (SoapMessage) messageContext.getRequest(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolver.java index fdb98ec3..a65f6996 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolver.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,12 +34,14 @@ import org.springframework.ws.soap.SoapMessage; */ public class SoapMethodArgumentResolver implements MethodArgumentResolver { + @Override public boolean supportsParameter(MethodParameter parameter) { Class parameterType = parameter.getParameterType(); return SoapMessage.class.equals(parameterType) || SoapBody.class.equals(parameterType) || SoapEnvelope.class.equals(parameterType) || SoapHeader.class.equals(parameterType); } + @Override public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) { Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest()); SoapMessage request = (SoapMessage) messageContext.getRequest(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/DelegatingSmartSoapEndpointInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/DelegatingSmartSoapEndpointInterceptor.java index 310eb957..742e5ed2 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/DelegatingSmartSoapEndpointInterceptor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/DelegatingSmartSoapEndpointInterceptor.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -41,6 +41,7 @@ public class DelegatingSmartSoapEndpointInterceptor extends DelegatingSmartEndpo super(delegate); } + @Override public boolean understands(SoapHeaderElement header) { EndpointInterceptor delegate = getDelegate(); if (delegate instanceof SoapEndpointInterceptor) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptor.java index 63a47ee3..e9facfdd 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptor.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,6 +53,7 @@ public class SoapEnvelopeLoggingInterceptor extends AbstractLoggingInterceptor i return true; } + @Override public boolean understands(SoapHeaderElement header) { return false; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMapping.java index 3ed55f35..2d674fdc 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMapping.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,16 +54,19 @@ public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndp this.delegate = delegate; } + @Override public final void setActorOrRole(String actorOrRole) { Assert.notNull(actorOrRole, "actorOrRole must not be null"); actorsOrRoles = new String[]{actorOrRole}; } + @Override public final void setActorsOrRoles(String[] actorsOrRoles) { Assert.notEmpty(actorsOrRoles, "actorsOrRoles must not be empty"); this.actorsOrRoles = actorsOrRoles; } + @Override public final void setUltimateReceiver(boolean ultimateReceiver) { isUltimateReceiver = ultimateReceiver; } @@ -74,6 +77,7 @@ public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndp * * @see #setActorsOrRoles(String[]) */ + @Override public EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception { EndpointInvocationChain delegateChain = delegate.getEndpoint(messageContext); if (delegateChain != null) { @@ -85,6 +89,7 @@ public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndp } } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(delegate, "delegate is required"); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMapping.java index 2b6b54c3..9aa32738 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMapping.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMapping.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -55,16 +55,19 @@ public class SoapActionAnnotationMethodEndpointMapping extends AbstractAnnotatio private boolean isUltimateReceiver = true; + @Override public final void setActorOrRole(String actorOrRole) { Assert.notNull(actorOrRole, "actorOrRole must not be null"); actorsOrRoles = new String[]{actorOrRole}; } + @Override public final void setActorsOrRoles(String[] actorsOrRoles) { Assert.notEmpty(actorsOrRoles, "actorsOrRoles must not be empty"); this.actorsOrRoles = actorsOrRoles; } + @Override public final void setUltimateReceiver(boolean ultimateReceiver) { isUltimateReceiver = ultimateReceiver; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMapping.java index 4813459d..b28dc16a 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMapping.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMapping.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -58,16 +58,19 @@ public class SoapActionEndpointMapping extends AbstractMapBasedEndpointMapping i private boolean isUltimateReceiver = true; + @Override public final void setActorOrRole(String actorOrRole) { Assert.notNull(actorOrRole, "actorOrRole must not be null"); actorsOrRoles = new String[]{actorOrRole}; } + @Override public final void setActorsOrRoles(String[] actorsOrRoles) { Assert.notEmpty(actorsOrRoles, "actorsOrRoles must not be empty"); this.actorsOrRoles = actorsOrRoles; } + @Override public final void setUltimateReceiver(boolean ultimateReceiver) { isUltimateReceiver = ultimateReceiver; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Body.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Body.java index 2bb2f5d6..6bb10389 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Body.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Body.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,13 +44,18 @@ public interface Soap11Body extends SoapBody { */ Soap11Fault addFault(QName faultCode, String faultString, Locale faultStringLocale) throws SoapFaultException; + @Override Soap11Fault getFault(); + @Override Soap11Fault addMustUnderstandFault(String faultStringOrReason, Locale locale) throws SoapFaultException; + @Override Soap11Fault addClientOrSenderFault(String faultStringOrReason, Locale locale) throws SoapFaultException; + @Override Soap11Fault addServerOrReceiverFault(String faultStringOrReason, Locale locale) throws SoapFaultException; + @Override Soap11Fault addVersionMismatchFault(String faultStringOrReason, Locale locale) throws SoapFaultException; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Body.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Body.java index 83d08034..857e4911 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Body.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Body.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,14 +43,19 @@ public interface Soap12Body extends SoapBody { */ Soap12Fault addDataEncodingUnknownFault(QName[] subcodes, String reason, Locale locale) throws SoapFaultException; + @Override Soap12Fault getFault(); + @Override Soap12Fault addMustUnderstandFault(String faultStringOrReason, Locale locale) throws SoapFaultException; + @Override Soap12Fault addClientOrSenderFault(String faultStringOrReason, Locale locale) throws SoapFaultException; + @Override Soap12Fault addServerOrReceiverFault(String faultStringOrReason, Locale locale) throws SoapFaultException; + @Override Soap12Fault addVersionMismatchFault(String faultStringOrReason, Locale locale) throws SoapFaultException; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/support/MarshallingUtils.java b/spring-ws-core/src/main/java/org/springframework/ws/support/MarshallingUtils.java index 12c4be54..a9f37ad4 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/support/MarshallingUtils.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/support/MarshallingUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -93,18 +93,22 @@ public abstract class MarshallingUtils { this.mimeMessage = mimeMessage; } + @Override public boolean isXopPackage() { return mimeMessage.isXopPackage(); } + @Override public boolean convertToXopPackage() { return mimeMessage.convertToXopPackage(); } + @Override public void addAttachment(String contentId, DataHandler dataHandler) { mimeMessage.addAttachment(contentId, dataHandler); } + @Override public DataHandler getAttachment(String contentId) { Attachment attachment = mimeMessage.getAttachment(contentId); return attachment != null ? attachment.getDataHandler() : null; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractWebServiceConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractWebServiceConnection.java index 6bab2bc8..b7dbc7b9 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractWebServiceConnection.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractWebServiceConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ public abstract class AbstractWebServiceConnection implements WebServiceConnecti private boolean closed = false; + @Override public final void send(WebServiceMessage message) throws IOException { checkClosed(); onSendBeforeWrite(message); @@ -80,6 +81,7 @@ public abstract class AbstractWebServiceConnection implements WebServiceConnecti protected void onSendAfterWrite(WebServiceMessage message) throws IOException { } + @Override public final WebServiceMessage receive(WebServiceMessageFactory messageFactory) throws IOException { checkClosed(); onReceiveBeforeRead(); @@ -123,6 +125,7 @@ public abstract class AbstractWebServiceConnection implements WebServiceConnecti protected void onReceiveAfterRead(WebServiceMessage message) throws IOException { } + @Override public final void close() throws IOException { IOException ioex = null; if (tis != null) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/context/DefaultTransportContext.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/context/DefaultTransportContext.java index edfc7a6c..e401c547 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/context/DefaultTransportContext.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/context/DefaultTransportContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ public class DefaultTransportContext implements TransportContext { this.connection = connection; } + @Override public WebServiceConnection getConnection() { return connection; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java index 655a827b..e783aa32 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,10 +40,12 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect /** Buffer used for reading the response, when the content length is invalid. */ private byte[] responseBuffer; + @Override public final boolean hasError() throws IOException { return getResponseCode() / 100 != 2; } + @Override public final String getErrorMessage() throws IOException { StringBuilder builder = new StringBuilder(); String responseMessage = getResponseMessage(); @@ -115,6 +117,7 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect * Faults */ + @Override public final boolean hasFault() throws IOException { return HttpTransportConstants.STATUS_INTERNAL_SERVER_ERROR == getResponseCode() && isXmlResponse(); } @@ -129,6 +132,7 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect return false; } + @Override public final void setFault(boolean fault) { } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSender.java index 71d6ac0d..139b2951 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSender.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,6 +58,7 @@ public abstract class AbstractHttpWebServiceMessageSender implements WebServiceM this.acceptGzipEncoding = acceptGzipEncoding; } + @Override public boolean supports(URI uri) { return uri.getScheme().equals(HttpTransportConstants.HTTP_URI_SCHEME) || uri.getScheme().equals(HttpTransportConstants.HTTPS_URI_SCHEME); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestConnection.java index 91466357..11211216 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestConnection.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestConnection.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -25,8 +25,6 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -import org.apache.http.entity.ByteArrayEntity; - import org.springframework.http.client.ClientHttpRequest; import org.springframework.http.client.ClientHttpResponse; import org.springframework.util.Assert; @@ -61,6 +59,7 @@ public class ClientHttpRequestConnection extends AbstractHttpSenderConnection { // URI + @Override public URI getUri() throws URISyntaxException { return request.getURI(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestMessageSender.java index d3a51089..2d450953 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestMessageSender.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestMessageSender.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -55,6 +55,7 @@ public class ClientHttpRequestMessageSender extends AbstractHttpWebServiceMessag this.requestFactory = requestFactory; } + @Override public WebServiceConnection createConnection(URI uri) throws IOException { ClientHttpRequest request = requestFactory.createRequest(uri, HttpMethod.POST); if (isAcceptGzipEncoding()) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpConnection.java index 56ef7db5..2fbbc5a7 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpConnection.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpConnection.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -25,10 +25,6 @@ import java.net.URISyntaxException; import java.util.Arrays; import java.util.Iterator; -import org.springframework.util.Assert; -import org.springframework.ws.WebServiceMessage; -import org.springframework.ws.transport.WebServiceConnection; - import org.apache.commons.httpclient.Header; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; @@ -36,6 +32,10 @@ import org.apache.commons.httpclient.URIException; import org.apache.commons.httpclient.methods.ByteArrayRequestEntity; import org.apache.commons.httpclient.methods.PostMethod; +import org.springframework.util.Assert; +import org.springframework.ws.WebServiceMessage; +import org.springframework.ws.transport.WebServiceConnection; + /** * Implementation of {@link WebServiceConnection} that is based on Jakarta Commons HttpClient. Exposes a {@link * PostMethod}. @@ -78,6 +78,7 @@ public class CommonsHttpConnection extends AbstractHttpSenderConnection { * URI */ + @Override public URI getUri() throws URISyntaxException { try { return new URI(postMethod.getURI().toString()); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpMessageSender.java index 0e864e12..b13b3c52 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpMessageSender.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpMessageSender.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -20,11 +20,6 @@ import java.io.IOException; import java.net.URI; import java.util.Map; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.util.Assert; -import org.springframework.ws.transport.WebServiceConnection; - import org.apache.commons.httpclient.Credentials; import org.apache.commons.httpclient.HostConfiguration; import org.apache.commons.httpclient.HttpClient; @@ -38,6 +33,11 @@ import org.apache.commons.httpclient.UsernamePasswordCredentials; import org.apache.commons.httpclient.auth.AuthScope; import org.apache.commons.httpclient.methods.PostMethod; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.util.Assert; +import org.springframework.ws.transport.WebServiceConnection; + /** * WebServiceMessageSender implementation that uses Jakarta * Commons HttpClient to execute POST requests. @@ -210,6 +210,7 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende this.authScope = authScope; } + @Override public void afterPropertiesSet() throws Exception { if (getCredentials() != null) { getHttpClient().getState().setCredentials(getAuthScope(), getCredentials()); @@ -217,6 +218,7 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende } } + @Override public void destroy() throws Exception { HttpConnectionManager connectionManager = getHttpClient().getHttpConnectionManager(); if (connectionManager instanceof MultiThreadedHttpConnectionManager) { @@ -224,6 +226,7 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende } } + @Override public WebServiceConnection createConnection(URI uri) throws IOException { PostMethod postMethod = new PostMethod(uri.toString()); if (isAcceptGzipEncoding()) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsConnection.java index f3d1990f..70a8f920 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsConnection.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsConnection.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -25,10 +25,6 @@ import java.net.URISyntaxException; import java.util.Arrays; import java.util.Iterator; -import org.springframework.util.Assert; -import org.springframework.ws.WebServiceMessage; -import org.springframework.ws.transport.WebServiceConnection; - import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; @@ -38,6 +34,10 @@ import org.apache.http.entity.ByteArrayEntity; import org.apache.http.protocol.HttpContext; import org.apache.http.util.EntityUtils; +import org.springframework.util.Assert; +import org.springframework.ws.WebServiceMessage; +import org.springframework.ws.transport.WebServiceConnection; + /** * Implementation of {@link WebServiceConnection} that is based on Apache HttpClient. Exposes a {@link HttpPost} and * {@link HttpResponse}. @@ -85,6 +85,7 @@ public class HttpComponentsConnection extends AbstractHttpSenderConnection { /* * URI */ + @Override public URI getUri() throws URISyntaxException { return new URI(httpPost.getURI().toString()); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsMessageSender.java index db1db8ed..d21ae253 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsMessageSender.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsMessageSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -216,12 +216,14 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe this.authScope = authScope; } + @Override public void afterPropertiesSet() throws Exception { if (credentials != null && getHttpClient() instanceof DefaultHttpClient) { ((DefaultHttpClient) getHttpClient()).getCredentialsProvider().setCredentials(authScope, credentials); } } + @Override public WebServiceConnection createConnection(URI uri) throws IOException { HttpPost httpPost = new HttpPost(uri); if (isAcceptGzipEncoding()) { @@ -243,6 +245,7 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe return null; } + @Override public void destroy() throws Exception { getHttpClient().getConnectionManager().shutdown(); } @@ -254,6 +257,7 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe */ public static class RemoveSoapHeadersInterceptor implements HttpRequestInterceptor { + @Override public void process(HttpRequest request, HttpContext context) throws HttpException, IOException { if (request instanceof HttpEntityEnclosingRequest) { if (request.containsHeader(HTTP.TRANSFER_ENCODING)) { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java index be50cf62..2dbcd63d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,6 +66,7 @@ public class HttpServletConnection extends AbstractReceiverConnection return httpServletResponse; } + @Override public void endpointNotFound() { getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_NOT_FOUND); statusCodeSet = true; @@ -75,10 +76,12 @@ public class HttpServletConnection extends AbstractReceiverConnection * Errors */ + @Override public boolean hasError() throws IOException { return false; } + @Override public String getErrorMessage() throws IOException { return null; } @@ -87,6 +90,7 @@ public class HttpServletConnection extends AbstractReceiverConnection * URI */ + @Override public URI getUri() throws URISyntaxException { return new URI(httpServletRequest.getScheme(), null, httpServletRequest.getServerName(), httpServletRequest.getServerPort(), httpServletRequest.getRequestURI(), @@ -144,10 +148,12 @@ public class HttpServletConnection extends AbstractReceiverConnection * Faults */ + @Override public boolean hasFault() throws IOException { return false; } + @Override public void setFault(boolean fault) throws IOException { if (fault) { getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_INTERNAL_SERVER_ERROR); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnection.java index 68dc369b..68885d8f 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnection.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,6 +66,7 @@ public class HttpUrlConnection extends AbstractHttpSenderConnection { * URI */ + @Override public URI getUri() throws URISyntaxException { return new URI(StringUtils.replace(connection.getURL().toString(), " ", "%20")); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnectionMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnectionMessageSender.java index 7e1daa71..e38630b8 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnectionMessageSender.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnectionMessageSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ import org.springframework.ws.transport.WebServiceConnection; */ public class HttpUrlConnectionMessageSender extends AbstractHttpWebServiceMessageSender { + @Override public WebServiceConnection createConnection(URI uri) throws IOException { URL url = uri.toURL(); URLConnection connection = url.openConnection(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHandlerAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHandlerAdapter.java index 61ab715e..a8b09283 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHandlerAdapter.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHandlerAdapter.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -46,10 +46,12 @@ import org.springframework.ws.transport.support.WebServiceMessageReceiverObjectS public class WebServiceMessageReceiverHandlerAdapter extends WebServiceMessageReceiverObjectSupport implements HandlerAdapter { + @Override public long getLastModified(HttpServletRequest request, Object handler) { return -1L; } + @Override public ModelAndView handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler) throws Exception { @@ -68,6 +70,7 @@ public class WebServiceMessageReceiverHandlerAdapter extends WebServiceMessageRe return null; } + @Override public boolean supports(Object handler) { return handler instanceof WebServiceMessageReceiver; } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHandlerAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHandlerAdapter.java index aec08d7b..7dd68ece 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHandlerAdapter.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHandlerAdapter.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -26,6 +26,8 @@ import javax.xml.transform.dom.DOMResult; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.w3c.dom.Document; + import org.springframework.beans.factory.InitializingBean; import org.springframework.web.servlet.HandlerAdapter; import org.springframework.web.servlet.ModelAndView; @@ -33,8 +35,6 @@ import org.springframework.ws.wsdl.WsdlDefinition; import org.springframework.xml.xpath.XPathExpression; import org.springframework.xml.xpath.XPathExpressionFactory; -import org.w3c.dom.Document; - /** * Adapter to use the {@code WsdlDefinition} interface with the generic {@code DispatcherServlet}. *

@@ -124,11 +124,13 @@ public class WsdlDefinitionHandlerAdapter extends LocationTransformerObjectSuppo this.transformSchemaLocations = transformSchemaLocations; } + @Override public long getLastModified(HttpServletRequest request, Object handler) { Source definitionSource = ((WsdlDefinition) handler).getSource(); return LastModifiedHelper.getLastModified(definitionSource); } + @Override public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (HttpTransportConstants.METHOD_GET.equals(request.getMethod())) { @@ -160,10 +162,12 @@ public class WsdlDefinitionHandlerAdapter extends LocationTransformerObjectSuppo return null; } + @Override public boolean supports(Object handler) { return handler instanceof WsdlDefinition; } + @Override public void afterPropertiesSet() throws Exception { locationXPathExpression = XPathExpressionFactory.createXPathExpression(locationExpression, expressionNamespaces); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java index e8c84cb2..23ea3e50 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -26,6 +26,8 @@ import javax.xml.transform.dom.DOMResult; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.w3c.dom.Document; + import org.springframework.beans.factory.InitializingBean; import org.springframework.web.servlet.HandlerAdapter; import org.springframework.web.servlet.ModelAndView; @@ -33,8 +35,6 @@ import org.springframework.xml.xpath.XPathExpression; import org.springframework.xml.xpath.XPathExpressionFactory; import org.springframework.xml.xsd.XsdSchema; -import org.w3c.dom.Document; - /** * Adapter to use the {@link XsdSchema} interface with the generic DispatcherServlet. *

@@ -81,11 +81,13 @@ public class XsdSchemaHandlerAdapter extends LocationTransformerObjectSupport this.transformSchemaLocations = transformSchemaLocations; } + @Override public long getLastModified(HttpServletRequest request, Object handler) { Source schemaSource = ((XsdSchema) handler).getSource(); return LastModifiedHelper.getLastModified(schemaSource); } + @Override public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (HttpTransportConstants.METHOD_GET.equals(request.getMethod())) { @@ -110,10 +112,12 @@ public class XsdSchemaHandlerAdapter extends LocationTransformerObjectSupport return null; } + @Override public boolean supports(Object handler) { return handler instanceof XsdSchema; } + @Override public void afterPropertiesSet() throws Exception { schemaLocationXPathExpression = XPathExpressionFactory.createXPathExpression(schemaLocationExpression, expressionNamespaces); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/support/EnumerationIterator.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/support/EnumerationIterator.java index 4d5c3151..1b758251 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/support/EnumerationIterator.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/support/EnumerationIterator.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,14 +33,17 @@ public class EnumerationIterator implements Iterator { this.enumeration = enumeration; } + @Override public boolean hasNext() { return enumeration.hasMoreElements(); } + @Override public T next() { return enumeration.nextElement(); } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/support/WebServiceMessageReceiverObjectSupport.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/support/WebServiceMessageReceiverObjectSupport.java index e465ad69..0afa7a2d 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/support/WebServiceMessageReceiverObjectSupport.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/support/WebServiceMessageReceiverObjectSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,9 @@ package org.springframework.ws.transport.support; import java.net.URISyntaxException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; import org.springframework.ws.FaultAwareWebServiceMessage; @@ -34,9 +37,6 @@ import org.springframework.ws.transport.context.DefaultTransportContext; import org.springframework.ws.transport.context.TransportContext; import org.springframework.ws.transport.context.TransportContextHolder; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Convenience base class for server-side transport objects. Contains a {@link WebServiceMessageFactory}, and has * methods for handling incoming {@link WebServiceConnection}s. @@ -62,6 +62,7 @@ public abstract class WebServiceMessageReceiverObjectSupport implements Initiali this.messageFactory = messageFactory; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(messageFactory, "messageFactory is required"); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/DefaultWsdl11Definition.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/DefaultWsdl11Definition.java index b057e84b..26420cf3 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/DefaultWsdl11Definition.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/DefaultWsdl11Definition.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -170,6 +170,7 @@ public class DefaultWsdl11Definition implements Wsdl11Definition, InitializingBe this.serviceName = serviceName; } + @Override public void afterPropertiesSet() throws Exception { if (!StringUtils.hasText(delegate.getTargetNamespace()) && typesProvider.getSchemaCollection() != null && typesProvider.getSchemaCollection().getXsdSchemas().length > 0) { @@ -182,6 +183,7 @@ public class DefaultWsdl11Definition implements Wsdl11Definition, InitializingBe delegate.afterPropertiesSet(); } + @Override public Source getSource() { return delegate.getSource(); } diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/ProviderBasedWsdl4jDefinition.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/ProviderBasedWsdl4jDefinition.java index 546c1e7a..c18efd16 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/ProviderBasedWsdl4jDefinition.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/ProviderBasedWsdl4jDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -220,6 +220,7 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I this.targetNamespace = targetNamespace; } + @Override public void afterPropertiesSet() throws WSDLException { Assert.notNull(getTargetNamespace(), "'targetNamespace' is required"); WSDLFactory wsdlFactory = WSDLFactory.newInstance(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/SimpleWsdl11Definition.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/SimpleWsdl11Definition.java index 3a87888d..057a89d0 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/SimpleWsdl11Definition.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/SimpleWsdl11Definition.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,11 +61,13 @@ public class SimpleWsdl11Definition implements Wsdl11Definition, InitializingBea this.wsdlResource = wsdlResource; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(this.wsdlResource, "wsdl is required"); Assert.isTrue(this.wsdlResource.exists(), "wsdl '" + this.wsdlResource + "' does not exist"); } + @Override public Source getSource() { try { XMLReader xmlReader = XMLReaderFactory.createXMLReader(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinition.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinition.java index 07bcfeab..5f4f9184 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinition.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,12 +23,12 @@ import javax.wsdl.xml.WSDLWriter; import javax.xml.transform.Source; import javax.xml.transform.dom.DOMSource; +import org.w3c.dom.Document; + import org.springframework.util.Assert; import org.springframework.util.StringUtils; import org.springframework.ws.wsdl.WsdlDefinitionException; -import org.w3c.dom.Document; - /** * Implementation of the Wsdl11Definition based on WSDL4J. A {@link javax.wsdl.Definition} can be given as * as constructor argument, or set using a property. @@ -80,6 +80,7 @@ public class Wsdl4jDefinition implements Wsdl11Definition { } } + @Override public Source getSource() { synchronized (monitor) { Assert.notNull(definition, "definition must not be null"); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/AbstractPortTypesProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/AbstractPortTypesProvider.java index 32cd53b9..21f527bc 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/AbstractPortTypesProvider.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/AbstractPortTypesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,14 +29,14 @@ import javax.wsdl.PortType; import javax.wsdl.WSDLException; import javax.xml.namespace.QName; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.util.Assert; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.util.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Abstract base class for {@link PortTypesProvider} implementations. * @@ -66,6 +66,7 @@ public abstract class AbstractPortTypesProvider implements PortTypesProvider { * @param definition the WSDL4J Definition * @throws WSDLException in case of errors */ + @Override public void addPortTypes(Definition definition) throws WSDLException { Assert.notNull(getPortTypeName(), "'portTypeName' is required"); PortType portType = definition.createPortType(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultConcretePartProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultConcretePartProvider.java index 56e62274..7e60f18e 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultConcretePartProvider.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultConcretePartProvider.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -34,12 +34,12 @@ import javax.wsdl.Service; import javax.wsdl.WSDLException; import javax.xml.namespace.QName; -import org.springframework.util.Assert; -import org.springframework.util.StringUtils; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.util.Assert; +import org.springframework.util.StringUtils; + /** * Default implementation of the {@link BindingsProvider} and {@link ServicesProvider} interfaces. *

@@ -95,6 +95,7 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr * @see #populateBindingOutput(Definition,javax.wsdl.BindingOutput,javax.wsdl.Output) * @see #populateBindingFault(Definition,javax.wsdl.BindingFault,javax.wsdl.Fault) */ + @Override public void addBindings(Definition definition) throws WSDLException { for (Iterator iterator = definition.getPortTypes().values().iterator(); iterator.hasNext();) { PortType portType = (PortType) iterator.next(); @@ -248,6 +249,7 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr * @param definition the WSDL4J Definition * @throws WSDLException in case of errors */ + @Override public void addServices(Definition definition) throws WSDLException { Assert.notNull(getServiceName(), "'serviceName' is required"); Service service; diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultMessagesProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultMessagesProvider.java index 381766e3..77f0a91a 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultMessagesProvider.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultMessagesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,14 +26,14 @@ import javax.wsdl.extensions.ExtensibilityElement; import javax.wsdl.extensions.schema.Schema; import javax.xml.namespace.QName; -import org.springframework.util.Assert; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.springframework.util.Assert; + /** * Default implementation of the {@link MessagesProvider}. *

@@ -46,6 +46,7 @@ public class DefaultMessagesProvider implements MessagesProvider { private static final Log logger = LogFactory.getLog(DefaultMessagesProvider.class); + @Override public void addMessages(Definition definition) throws WSDLException { Types types = definition.getTypes(); Assert.notNull(types, "No types element present in definition"); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/InliningXsdSchemaTypesProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/InliningXsdSchemaTypesProvider.java index 76354fa3..d5204408 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/InliningXsdSchemaTypesProvider.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/InliningXsdSchemaTypesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,6 +82,7 @@ public class InliningXsdSchemaTypesProvider extends TransformerObjectSupport imp this.schemaCollection = schemaCollection; } + @Override public void addTypes(Definition definition) throws WSDLException { Assert.notNull(getSchemaCollection(), "setting 'schema' or 'schemaCollection' is required"); Types types = definition.createTypes(); diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SoapProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SoapProvider.java index 23802332..c49cb80c 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SoapProvider.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SoapProvider.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -92,6 +92,7 @@ public class SoapProvider implements BindingsProvider, ServicesProvider { soap12BindingProvider.setServiceName(serviceName); } + @Override public void addBindings(Definition definition) throws WSDLException { if (createSoap11Binding) { soap11BindingProvider.addBindings(definition); @@ -101,6 +102,7 @@ public class SoapProvider implements BindingsProvider, ServicesProvider { } } + @Override public void addServices(Definition definition) throws WSDLException { if (createSoap11Binding) { soap11BindingProvider.addServices(definition); diff --git a/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessage.java b/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessage.java index 28b31376..99f42810 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessage.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,16 +105,19 @@ public class MockWebServiceMessage implements FaultAwareWebServiceMessage { } } + @Override public Result getPayloadResult() { checkContent(); content.setLength(0); return new StreamResult(new StringBufferWriter()); } + @Override public Source getPayloadSource() { return content != null ? new StringSource(content.toString()) : null; } + @Override public boolean hasFault() { return fault; } @@ -123,6 +126,7 @@ public class MockWebServiceMessage implements FaultAwareWebServiceMessage { this.fault = fault; } + @Override public String getFaultReason() { return faultReason; } @@ -131,6 +135,7 @@ public class MockWebServiceMessage implements FaultAwareWebServiceMessage { this.faultReason = faultReason; } + @Override public void writeTo(OutputStream outputStream) throws IOException { if (content != null) { PrintWriter writer = new PrintWriter(outputStream); diff --git a/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java b/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java index 41a4bba7..3bd41ff9 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,10 +23,12 @@ import javax.xml.transform.stream.StreamSource; public class MockWebServiceMessageFactory implements WebServiceMessageFactory { + @Override public MockWebServiceMessage createWebServiceMessage() { return new MockWebServiceMessage(); } + @Override public MockWebServiceMessage createWebServiceMessage(InputStream inputStream) throws IOException { try { return new MockWebServiceMessage(new StreamSource(inputStream)); diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/DummyInterceptor.java b/spring-ws-core/src/test/java/org/springframework/ws/config/DummyInterceptor.java index 4ced0386..75cad738 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/config/DummyInterceptor.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/config/DummyInterceptor.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2013 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -39,21 +39,25 @@ public class DummyInterceptor implements EndpointInterceptor { return autowiredDependency; } + @Override public boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception { return true; } + @Override public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception { return true; } + @Override public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception { return true; } + @Override public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception { } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/DummyMarshaller.java b/spring-ws-core/src/test/java/org/springframework/ws/config/DummyMarshaller.java index dba8e9c1..babd5206 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/config/DummyMarshaller.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/config/DummyMarshaller.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,14 +26,17 @@ import org.springframework.oxm.XmlMappingException; public class DummyMarshaller implements Marshaller, Unmarshaller { + @Override public void marshal(Object graph, Result result) throws XmlMappingException, IOException { throw new UnsupportedOperationException(); } + @Override public boolean supports(Class clazz) { throw new UnsupportedOperationException(); } + @Override public Object unmarshal(Source source) throws XmlMappingException, IOException { throw new UnsupportedOperationException(); } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/MyInterceptor.java b/spring-ws-core/src/test/java/org/springframework/ws/config/MyInterceptor.java index 22b83cc2..913d4314 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/config/MyInterceptor.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/config/MyInterceptor.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -34,18 +34,22 @@ public class MyInterceptor implements EndpointInterceptor { this.order = order; } + @Override public boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception { return true; } + @Override public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception { return true; } + @Override public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception { return true; } + @Override public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) { } } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java index f14f27ae..eb7f7896 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,13 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; +import static org.easymock.EasyMock.*; +import org.junit.Assert; +import static org.junit.Assert.fail; +import org.junit.Before; +import org.junit.Test; + import org.springframework.oxm.Marshaller; import org.springframework.oxm.Unmarshaller; import org.springframework.oxm.XmlMappingException; @@ -41,14 +48,6 @@ import org.springframework.ws.mime.MimeMessage; import org.springframework.xml.transform.StringResult; import org.springframework.xml.transform.StringSource; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; -import static org.easymock.EasyMock.*; -import static org.junit.Assert.fail; - public class MarshallingPayloadEndpointTest { private Transformer transformer; @@ -214,15 +213,18 @@ public class MarshallingPayloadEndpointTest { private static class SimpleMarshaller implements Marshaller, Unmarshaller { + @Override public void marshal(Object graph, Result result) throws XmlMappingException, IOException { fail("Not expected"); } + @Override public Object unmarshal(Source source) throws XmlMappingException, IOException { fail("Not expected"); return null; } + @Override public boolean supports(Class clazz) { return false; } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadLoggingInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadLoggingInterceptorTest.java index 5153ffef..40c9eea0 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadLoggingInterceptorTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadLoggingInterceptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,6 @@ package org.springframework.ws.server.endpoint.interceptor; -import org.springframework.core.io.ClassPathResource; -import org.springframework.ws.MockWebServiceMessage; -import org.springframework.ws.MockWebServiceMessageFactory; -import org.springframework.ws.context.DefaultMessageContext; -import org.springframework.ws.context.MessageContext; - import org.apache.log4j.AppenderSkeleton; import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Level; @@ -33,6 +27,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.springframework.core.io.ClassPathResource; +import org.springframework.ws.MockWebServiceMessage; +import org.springframework.ws.MockWebServiceMessageFactory; +import org.springframework.ws.context.DefaultMessageContext; +import org.springframework.ws.context.MessageContext; + public class PayloadLoggingInterceptorTest { private PayloadLoggingInterceptor interceptor; @@ -110,10 +110,12 @@ public class PayloadLoggingInterceptorTest { count++; } + @Override public boolean requiresLayout() { return false; } + @Override public void close() { } } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/JdkProxyRegistrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/JdkProxyRegistrationTest.java index c5076b2f..ac01123a 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/JdkProxyRegistrationTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/JdkProxyRegistrationTest.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -20,6 +20,11 @@ import java.lang.reflect.Method; import javax.xml.namespace.QName; import javax.xml.transform.Source; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import org.junit.Test; +import org.junit.runner.RunWith; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; @@ -29,12 +34,6 @@ import org.springframework.ws.server.endpoint.annotation.Endpoint; import org.springframework.ws.server.endpoint.annotation.PayloadRoot; import org.springframework.ws.server.endpoint.annotation.RequestPayload; -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("jdk-proxy-registration.xml") public class JdkProxyRegistrationTest { @@ -64,6 +63,7 @@ public class JdkProxyRegistrationTest { public static class MyEndpointImpl implements MyEndpoint { + @Override public void doIt(@RequestPayload Source payload) { } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/FaultCreatingValidatingMarshallingPayloadEndpointTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/FaultCreatingValidatingMarshallingPayloadEndpointTest.java index 8109a221..728d475b 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/FaultCreatingValidatingMarshallingPayloadEndpointTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/FaultCreatingValidatingMarshallingPayloadEndpointTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,10 @@ import javax.xml.soap.SOAPMessage; import javax.xml.transform.Result; import javax.xml.transform.Source; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + import org.springframework.context.support.ResourceBundleMessageSource; import org.springframework.oxm.Marshaller; import org.springframework.oxm.Unmarshaller; @@ -39,10 +43,6 @@ import org.springframework.ws.context.MessageContext; import org.springframework.ws.soap.saaj.SaajSoapMessage; import org.springframework.ws.soap.saaj.SaajSoapMessageFactory; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - public class FaultCreatingValidatingMarshallingPayloadEndpointTest { private MessageContext messageContext; @@ -128,10 +128,12 @@ public class FaultCreatingValidatingMarshallingPayloadEndpointTest { private static class PersonValidator implements Validator { + @Override public boolean supports(Class clazz) { return Person.class.equals(clazz); } + @Override public void validate(Object obj, Errors e) { ValidationUtils.rejectIfEmpty(e, "name", "name.empty"); Person p = (Person) obj; @@ -184,14 +186,17 @@ public class FaultCreatingValidatingMarshallingPayloadEndpointTest { this.person = person; } + @Override public Object unmarshal(Source source) throws XmlMappingException, IOException { return person; } + @Override public boolean supports(Class clazz) { return Person.class.equals(clazz); } + @Override public void marshal(Object graph, Result result) throws XmlMappingException, IOException { } } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptorTest.java index de6d69ea..bfd5d405 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptorTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,6 @@ package org.springframework.ws.soap.server.endpoint.interceptor; -import org.springframework.core.io.ClassPathResource; -import org.springframework.ws.context.DefaultMessageContext; -import org.springframework.ws.context.MessageContext; -import org.springframework.ws.soap.saaj.SaajSoapMessageFactory; - import org.apache.log4j.AppenderSkeleton; import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Level; @@ -32,6 +27,11 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.springframework.core.io.ClassPathResource; +import org.springframework.ws.context.DefaultMessageContext; +import org.springframework.ws.context.MessageContext; +import org.springframework.ws.soap.saaj.SaajSoapMessageFactory; + public class SoapEnvelopeLoggingInterceptorTest { private SoapEnvelopeLoggingInterceptor interceptor; @@ -125,10 +125,12 @@ public class SoapEnvelopeLoggingInterceptorTest { count++; } + @Override public boolean requiresLayout() { return false; } + @Override public void close() { } } diff --git a/spring-ws-core/src/test/java/org/springframework/ws/support/DefaultStrategiesHelperTest.java b/spring-ws-core/src/test/java/org/springframework/ws/support/DefaultStrategiesHelperTest.java index b0c3c967..945052ee 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/support/DefaultStrategiesHelperTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/support/DefaultStrategiesHelperTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,9 @@ package org.springframework.ws.support; import java.util.List; import java.util.Properties; +import org.junit.Assert; +import org.junit.Test; + import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanInitializationException; import org.springframework.context.ApplicationContext; @@ -27,9 +30,6 @@ import org.springframework.context.support.StaticApplicationContext; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; -import org.junit.Assert; -import org.junit.Test; - public class DefaultStrategiesHelperTest { @Test @@ -113,6 +113,7 @@ public class DefaultStrategiesHelperTest { return applicationContext; } + @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; } diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/AbstractWsSecurityInterceptor.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/AbstractWsSecurityInterceptor.java index 8a72d078..66fe8966 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/AbstractWsSecurityInterceptor.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/AbstractWsSecurityInterceptor.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -20,6 +20,9 @@ import java.util.Iterator; import java.util.Locale; import javax.xml.namespace.QName; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.util.Assert; import org.springframework.ws.client.WebServiceClientException; import org.springframework.ws.client.support.interceptor.ClientInterceptor; @@ -33,9 +36,6 @@ import org.springframework.ws.soap.SoapMessage; import org.springframework.ws.soap.server.SoapEndpointInterceptor; import org.springframework.ws.soap.soap11.Soap11Body; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Interceptor base class for interceptors that handle WS-Security. Can be used on the server side, registered in a * {@link org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping#setInterceptors(org.springframework.ws.server.EndpointInterceptor[]) @@ -113,6 +113,7 @@ public abstract class AbstractWsSecurityInterceptor implements SoapEndpointInter * @throws Exception in case of errors * @see #validateMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext) */ + @Override public final boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception { if (validateRequest) { Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest()); @@ -145,6 +146,7 @@ public abstract class AbstractWsSecurityInterceptor implements SoapEndpointInter * @throws Exception in case of errors * @see #secureMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext) */ + @Override public final boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception { boolean result = true; try { @@ -171,15 +173,18 @@ public abstract class AbstractWsSecurityInterceptor implements SoapEndpointInter } /** Returns true, i.e. fault responses are not secured. */ + @Override public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception { return true; } + @Override public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) { cleanUp(); } + @Override public boolean understands(SoapHeaderElement headerElement) { return WS_SECURITY_NAME.equals(headerElement.getName()); } @@ -197,6 +202,7 @@ public abstract class AbstractWsSecurityInterceptor implements SoapEndpointInter * @throws Exception in case of errors * @see #secureMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext) */ + @Override public final boolean handleRequest(MessageContext messageContext) throws WebServiceClientException { if (secureRequest) { Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest()); @@ -225,6 +231,7 @@ public abstract class AbstractWsSecurityInterceptor implements SoapEndpointInter * @throws Exception in case of errors * @see #validateMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext) */ + @Override public final boolean handleResponse(MessageContext messageContext) throws WebServiceClientException { if (validateResponse) { Assert.isTrue(messageContext.hasResponse(), "MessageContext contains no response"); @@ -249,6 +256,7 @@ public abstract class AbstractWsSecurityInterceptor implements SoapEndpointInter } /** Returns true, i.e. fault responses are not validated. */ + @Override public boolean handleFault(MessageContext messageContext) throws WebServiceClientException { return true; } diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/callback/AbstractCallbackHandler.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/callback/AbstractCallbackHandler.java index e21ee806..8de9805c 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/callback/AbstractCallbackHandler.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/callback/AbstractCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,6 +44,7 @@ public abstract class AbstractCallbackHandler implements CallbackHandler { * @param callbacks the callbacks * @see #handleInternal(javax.security.auth.callback.Callback) */ + @Override public final void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (Callback callback : callbacks) { handleInternal(callback); diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/KeyManagersFactoryBean.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/KeyManagersFactoryBean.java index fbd7b6ca..a5bab3bf 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/KeyManagersFactoryBean.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/KeyManagersFactoryBean.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -82,18 +82,22 @@ public class KeyManagersFactoryBean implements FactoryBean, Initia this.keyStore = keyStore; } + @Override public KeyManager[] getObject() throws Exception { return keyManagers; } + @Override public Class getObjectType() { return KeyManager[].class; } + @Override public boolean isSingleton() { return true; } + @Override public void afterPropertiesSet() throws Exception { String algorithm = StringUtils.hasLength(this.algorithm) ? this.algorithm : KeyManagerFactory.getDefaultAlgorithm(); diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/KeyStoreFactoryBean.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/KeyStoreFactoryBean.java index 901fc8f4..0b81e364 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/KeyStoreFactoryBean.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/support/KeyStoreFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,14 +21,14 @@ import java.io.InputStream; import java.security.GeneralSecurityException; import java.security.KeyStore; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.core.io.Resource; import org.springframework.util.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Spring factory bean for a {@link KeyStore}. *

@@ -87,18 +87,22 @@ public class KeyStoreFactoryBean implements FactoryBean, InitializingB this.type = type; } + @Override public KeyStore getObject() { return keyStore; } + @Override public Class getObjectType() { return KeyStore.class; } + @Override public boolean isSingleton() { return true; } + @Override public final void afterPropertiesSet() throws GeneralSecurityException, IOException { if (StringUtils.hasLength(provider) && StringUtils.hasLength(type)) { keyStore = KeyStore.getInstance(type, provider); diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityInterceptor.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityInterceptor.java index 66c6aff0..1952e4ce 100755 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityInterceptor.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/Wss4jSecurityInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -490,6 +490,7 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl this.futureTimeToLive = futureTimeToLive; } + @Override public void afterPropertiesSet() throws Exception { Assert.isTrue(validationActions != null || securementActions != null, "validationActions or securementActions are required"); diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/KeyStoreCallbackHandler.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/KeyStoreCallbackHandler.java index 9de42a06..f3e80927 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/KeyStoreCallbackHandler.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/KeyStoreCallbackHandler.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,11 +23,11 @@ import java.security.KeyStore; import javax.crypto.SecretKey; import javax.security.auth.callback.UnsupportedCallbackException; +import org.apache.ws.security.WSPasswordCallback; + import org.springframework.beans.factory.InitializingBean; import org.springframework.ws.soap.security.support.KeyStoreUtils; -import org.apache.ws.security.WSPasswordCallback; - /** * Callback handler that uses Java Security KeyStores to handle cryptographic callbacks. Allows for * specific key stores to be set for various cryptographic operations. @@ -72,6 +72,7 @@ public class KeyStoreCallbackHandler extends AbstractWsPasswordCallbackHandler i } } + @Override public void afterPropertiesSet() throws Exception { if (keyStore == null) { loadDefaultKeyStore(); diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/SimplePasswordValidationCallbackHandler.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/SimplePasswordValidationCallbackHandler.java index a991594d..95dec4b1 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/SimplePasswordValidationCallbackHandler.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/SimplePasswordValidationCallbackHandler.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -22,11 +22,11 @@ import java.util.Map; import java.util.Properties; import javax.security.auth.callback.UnsupportedCallbackException; +import org.apache.ws.security.WSPasswordCallback; + import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; -import org.apache.ws.security.WSPasswordCallback; - /** * Simple callback handler that validates passwords against a in-memory Properties object. Password * validation is done on a case-sensitive basis. @@ -54,6 +54,7 @@ public class SimplePasswordValidationCallbackHandler extends AbstractWsPasswordC this.users = users; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(users, "users is required"); } diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/SpringSecurityPasswordValidationCallbackHandler.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/SpringSecurityPasswordValidationCallbackHandler.java index 2d39c64b..6aed24b7 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/SpringSecurityPasswordValidationCallbackHandler.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/callback/SpringSecurityPasswordValidationCallbackHandler.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -19,6 +19,9 @@ package org.springframework.ws.soap.security.wss4j.callback; import java.io.IOException; import javax.security.auth.callback.UnsupportedCallbackException; +import org.apache.ws.security.WSPasswordCallback; +import org.apache.ws.security.WSUsernameTokenPrincipal; + import org.springframework.beans.factory.InitializingBean; import org.springframework.dao.DataAccessException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @@ -32,9 +35,6 @@ import org.springframework.util.Assert; import org.springframework.ws.soap.security.callback.CleanupCallback; import org.springframework.ws.soap.security.support.SpringSecurityUtils; -import org.apache.ws.security.WSPasswordCallback; -import org.apache.ws.security.WSUsernameTokenPrincipal; - /** * Callback handler that validates a plain text or digest password using an Spring Security {@code UserDetailsService}. *

@@ -61,6 +61,7 @@ public class SpringSecurityPasswordValidationCallbackHandler extends AbstractWsP this.userDetailsService = userDetailsService; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(userDetailsService, "userDetailsService is required"); } diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/support/CryptoFactoryBean.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/support/CryptoFactoryBean.java index 98b82905..fd8381b8 100755 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/support/CryptoFactoryBean.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j/support/CryptoFactoryBean.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -19,6 +19,10 @@ package org.springframework.ws.soap.security.wss4j.support; import java.io.IOException; import java.util.Properties; +import org.apache.ws.security.components.crypto.Crypto; +import org.apache.ws.security.components.crypto.CryptoFactory; +import org.apache.ws.security.components.crypto.Merlin; + import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; @@ -26,10 +30,6 @@ import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.util.Assert; -import org.apache.ws.security.components.crypto.Crypto; -import org.apache.ws.security.components.crypto.CryptoFactory; -import org.apache.ws.security.components.crypto.Merlin; - /** * Spring factory bean for a WSS4J {@link Crypto}. Allows for strong-typed property configuration, or configuration * through {@link Properties}. @@ -164,10 +164,12 @@ public class CryptoFactoryBean implements FactoryBean, BeanClassLoaderAw this.configuration.setProperty("org.apache.ws.security.crypto.merlin.keystore.alias", defaultX509Alias); } + @Override public void setBeanClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } + @Override public void afterPropertiesSet() throws Exception { if (!configuration.containsKey(CRYPTO_PROVIDER_PROPERTY)) { configuration.setProperty(CRYPTO_PROVIDER_PROPERTY, Merlin.class.getName()); @@ -175,14 +177,17 @@ public class CryptoFactoryBean implements FactoryBean, BeanClassLoaderAw this.crypto = CryptoFactory.getInstance(configuration, classLoader); } + @Override public Class getObjectType() { return Crypto.class; } + @Override public boolean isSingleton() { return true; } + @Override public Crypto getObject() throws Exception { return crypto; } diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationProvider.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationProvider.java index 42137723..70b64634 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationProvider.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,9 @@ package org.springframework.ws.soap.security.x509; import java.security.cert.X509Certificate; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.beans.factory.InitializingBean; import org.springframework.context.MessageSource; import org.springframework.context.MessageSourceAware; @@ -32,9 +35,6 @@ import org.springframework.util.Assert; import org.springframework.ws.soap.security.x509.cache.NullX509UserCache; import org.springframework.ws.soap.security.x509.cache.X509UserCache; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Processes an X.509 authentication request. @@ -56,6 +56,7 @@ public class X509AuthenticationProvider implements AuthenticationProvider, Initi //~ Methods ======================================================================================================== + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(userCache, "An x509UserCache must be set"); Assert.notNull(x509AuthoritiesPopulator, "An X509AuthoritiesPopulator must be set"); @@ -76,6 +77,7 @@ public class X509AuthenticationProvider implements AuthenticationProvider, Initi * @throws AuthenticationException if the {@link X509AuthoritiesPopulator} rejects the certficate. * @throws BadCredentialsException if no certificate was presented in the authentication request. */ + @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (!supports(authentication.getClass())) { @@ -110,6 +112,7 @@ public class X509AuthenticationProvider implements AuthenticationProvider, Initi return result; } + @Override public void setMessageSource(MessageSource messageSource) { this.messages = new MessageSourceAccessor(messageSource); } @@ -122,6 +125,7 @@ public class X509AuthenticationProvider implements AuthenticationProvider, Initi this.userCache = cache; } + @Override public boolean supports(Class authentication) { return X509AuthenticationToken.class.isAssignableFrom(authentication); } diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationToken.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationToken.java index 1e6bec1f..d58810aa 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationToken.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/X509AuthenticationToken.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -67,10 +67,12 @@ public class X509AuthenticationToken extends AbstractAuthenticationToken { //~ Methods ======================================================================================================== + @Override public Object getCredentials() { return credentials; } + @Override public Object getPrincipal() { return principal; } diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/cache/EhCacheBasedX509UserCache.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/cache/EhCacheBasedX509UserCache.java index b90cdb50..edc8c038 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/cache/EhCacheBasedX509UserCache.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/x509/cache/EhCacheBasedX509UserCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,17 +18,17 @@ package org.springframework.ws.soap.security.x509.cache; import java.security.cert.X509Certificate; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.dao.DataRetrievalFailureException; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.util.Assert; - import net.sf.ehcache.CacheException; import net.sf.ehcache.Ehcache; import net.sf.ehcache.Element; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.dao.DataRetrievalFailureException; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.util.Assert; + /** * Caches User objects using a Spring IoC defined Properties object. Password * validation is done on a case-sensitive basis. @@ -58,6 +58,7 @@ public class SimplePasswordValidationCallbackHandler extends AbstractCallbackHan this.users = users; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(users, "users is required"); } @@ -88,6 +89,7 @@ public class SimplePasswordValidationCallbackHandler extends AbstractCallbackHan private class SimplePlainTextPasswordValidator implements PasswordValidationCallback.PasswordValidator { + @Override public boolean validate(PasswordValidationCallback.Request request) throws PasswordValidationCallback.PasswordValidationException { PasswordValidationCallback.PlainTextPasswordRequest plainTextPasswordRequest = diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SimpleUsernamePasswordCallbackHandler.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SimpleUsernamePasswordCallbackHandler.java index 82c714fa..7623b838 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SimpleUsernamePasswordCallbackHandler.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SimpleUsernamePasswordCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,13 +20,13 @@ import java.io.IOException; import javax.security.auth.callback.Callback; import javax.security.auth.callback.UnsupportedCallbackException; +import com.sun.xml.wss.impl.callback.PasswordCallback; +import com.sun.xml.wss.impl.callback.UsernameCallback; + import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; import org.springframework.ws.soap.security.callback.AbstractCallbackHandler; -import com.sun.xml.wss.impl.callback.PasswordCallback; -import com.sun.xml.wss.impl.callback.UsernameCallback; - /** * Simple callback handler that supplies a username and password to a username token at runtime. *

@@ -67,6 +67,7 @@ public class SimpleUsernamePasswordCallbackHandler extends AbstractCallbackHandl this.username = username; } + @Override public void afterPropertiesSet() throws Exception { Assert.hasLength(username, "username must be set"); Assert.hasLength(password, "password must be set"); diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringCertificateValidationCallbackHandler.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringCertificateValidationCallbackHandler.java index 0859ce1d..bfcd7fae 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringCertificateValidationCallbackHandler.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringCertificateValidationCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +24,14 @@ import javax.security.auth.callback.UnsupportedCallbackException; import com.sun.xml.wss.impl.callback.CertificateValidationCallback; import org.springframework.beans.factory.InitializingBean; +import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; -import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.ws.soap.security.x509.X509AuthenticationToken; import org.springframework.util.Assert; import org.springframework.ws.soap.security.callback.AbstractCallbackHandler; import org.springframework.ws.soap.security.callback.CleanupCallback; +import org.springframework.ws.soap.security.x509.X509AuthenticationToken; /** * Callback handler that validates a certificate using an Spring Security AuthenticationManager. Logic @@ -64,6 +64,7 @@ public class SpringCertificateValidationCallbackHandler extends AbstractCallback this.ignoreFailure = ignoreFailure; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(authenticationManager, "authenticationManager is required"); } @@ -90,6 +91,7 @@ public class SpringCertificateValidationCallbackHandler extends AbstractCallback private class SpringSecurityCertificateValidator implements CertificateValidationCallback.CertificateValidator { + @Override public boolean validate(X509Certificate certificate) throws CertificateValidationCallback.CertificateValidationException { boolean result; diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringDigestPasswordValidationCallbackHandler.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringDigestPasswordValidationCallbackHandler.java index 338c58a2..b4e44f96 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringDigestPasswordValidationCallbackHandler.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringDigestPasswordValidationCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,13 +25,13 @@ import com.sun.xml.wss.impl.callback.TimestampValidationCallback; import org.springframework.beans.factory.InitializingBean; import org.springframework.dao.DataAccessException; -import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserCache; -import org.springframework.security.core.userdetails.cache.NullUserCache; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.core.userdetails.cache.NullUserCache; import org.springframework.util.Assert; import org.springframework.ws.soap.security.callback.AbstractCallbackHandler; import org.springframework.ws.soap.security.callback.CleanupCallback; @@ -69,6 +69,7 @@ public class SpringDigestPasswordValidationCallbackHandler extends AbstractCallb this.userDetailsService = userDetailsService; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(userDetailsService, "userDetailsService is required"); } diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringPlainTextPasswordValidationCallbackHandler.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringPlainTextPasswordValidationCallbackHandler.java index 20017dce..76bfc1b4 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringPlainTextPasswordValidationCallbackHandler.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/SpringPlainTextPasswordValidationCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,11 +23,11 @@ import javax.security.auth.callback.UnsupportedCallbackException; import com.sun.xml.wss.impl.callback.PasswordValidationCallback; import org.springframework.beans.factory.InitializingBean; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; -import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.util.Assert; import org.springframework.ws.soap.security.callback.AbstractCallbackHandler; import org.springframework.ws.soap.security.callback.CleanupCallback; @@ -65,6 +65,7 @@ public class SpringPlainTextPasswordValidationCallbackHandler extends AbstractCa this.ignoreFailure = ignoreFailure; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(authenticationManager, "authenticationManager is required"); } @@ -94,6 +95,7 @@ public class SpringPlainTextPasswordValidationCallbackHandler extends AbstractCa private class SpringSecurityPlainTextPasswordValidator implements PasswordValidationCallback.PasswordValidator { + @Override public boolean validate(PasswordValidationCallback.Request request) throws PasswordValidationCallback.PasswordValidationException { PasswordValidationCallback.PlainTextPasswordRequest plainTextRequest = diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/XwssCallbackHandlerChain.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/XwssCallbackHandlerChain.java index ecac5a52..a567b6ec 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/XwssCallbackHandlerChain.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/XwssCallbackHandlerChain.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,6 +77,7 @@ public class XwssCallbackHandlerChain extends CallbackHandlerChain { this.callback = callback; } + @Override public void validate(TimestampValidationCallback.Request request) throws TimestampValidationCallback.TimestampValidationException { for (int i = 0; i < getCallbackHandlers().length; i++) { @@ -103,6 +104,7 @@ public class XwssCallbackHandlerChain extends CallbackHandlerChain { this.callback = callback; } + @Override public boolean validate(PasswordValidationCallback.Request request) throws PasswordValidationCallback.PasswordValidationException { boolean allUnsupported = true; @@ -134,6 +136,7 @@ public class XwssCallbackHandlerChain extends CallbackHandlerChain { this.callback = callback; } + @Override public boolean validate(X509Certificate certificate) throws CertificateValidationCallback.CertificateValidationException { boolean allUnsupported = true; diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/AbstractJaasValidationCallbackHandler.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/AbstractJaasValidationCallbackHandler.java index e02ab9b6..38d19821 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/AbstractJaasValidationCallbackHandler.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/AbstractJaasValidationCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,6 +44,7 @@ public abstract class AbstractJaasValidationCallbackHandler extends AbstractCall this.loginContextName = loginContextName; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(loginContextName, "loginContextName is required"); } diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/JaasCertificateValidationCallbackHandler.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/JaasCertificateValidationCallbackHandler.java index 3ff4b969..57945550 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/JaasCertificateValidationCallbackHandler.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/JaasCertificateValidationCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,6 +57,7 @@ public class JaasCertificateValidationCallbackHandler extends AbstractJaasValida private class JaasCertificateValidator implements CertificateValidationCallback.CertificateValidator { + @Override public boolean validate(X509Certificate certificate) throws CertificateValidationCallback.CertificateValidationException { Subject subject = new Subject(); diff --git a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/JaasPlainTextPasswordValidationCallbackHandler.java b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/JaasPlainTextPasswordValidationCallbackHandler.java index e0be9be7..1597591c 100644 --- a/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/JaasPlainTextPasswordValidationCallbackHandler.java +++ b/spring-ws-security/src/main/java/org/springframework/ws/soap/security/xwss/callback/jaas/JaasPlainTextPasswordValidationCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,6 +60,7 @@ public class JaasPlainTextPasswordValidationCallbackHandler extends AbstractJaas private class JaasPlainTextPasswordValidator implements PasswordValidationCallback.PasswordValidator { + @Override public boolean validate(PasswordValidationCallback.Request request) throws PasswordValidationCallback.PasswordValidationException { PasswordValidationCallback.PlainTextPasswordRequest plainTextRequest = diff --git a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/CertificateLoginModule.java b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/CertificateLoginModule.java index 1957f565..a2055137 100644 --- a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/CertificateLoginModule.java +++ b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/CertificateLoginModule.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,10 +30,12 @@ public class CertificateLoginModule implements LoginModule { private boolean loginSuccessful = false; + @Override public boolean abort() { return true; } + @Override public boolean commit() { if (!loginSuccessful) { subject.getPrincipals().clear(); @@ -43,6 +45,7 @@ public class CertificateLoginModule implements LoginModule { return true; } + @Override public void initialize(Subject subject, CallbackHandler callbackHandler, java.util.Map sharedState, @@ -50,6 +53,7 @@ public class CertificateLoginModule implements LoginModule { this.subject = subject; } + @Override public boolean login() throws LoginException { if (subject == null) { return false; @@ -61,6 +65,7 @@ public class CertificateLoginModule implements LoginModule { return loginSuccessful; } + @Override public boolean logout() { subject.getPrincipals().clear(); subject.getPrivateCredentials().clear(); diff --git a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/PlainTextLoginModule.java b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/PlainTextLoginModule.java index ce112bbc..91cd8df9 100644 --- a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/PlainTextLoginModule.java +++ b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/PlainTextLoginModule.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.ws.soap.security.xwss.callback.jaas; import java.util.ArrayList; import java.util.Iterator; import java.util.List; - import javax.security.auth.Subject; import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; @@ -38,12 +37,14 @@ public class PlainTextLoginModule implements LoginModule { private List principals = new ArrayList(); + @Override public boolean abort() { success = false; logout(); return true; } + @Override public boolean commit() throws LoginException { if (success) { if (subject.isReadOnly()) { @@ -64,6 +65,7 @@ public class PlainTextLoginModule implements LoginModule { return true; } + @Override public void initialize(Subject subject, CallbackHandler callbackHandler, java.util.Map sharedState, @@ -72,6 +74,7 @@ public class PlainTextLoginModule implements LoginModule { this.callbackHandler = callbackHandler; } + @Override public boolean login() throws LoginException { if (callbackHandler == null) { return false; @@ -118,6 +121,7 @@ public class PlainTextLoginModule implements LoginModule { } } + @Override public boolean logout() { principals.clear(); diff --git a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/SimplePrincipal.java b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/SimplePrincipal.java index 2441280f..4fc2144a 100644 --- a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/SimplePrincipal.java +++ b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/xwss/callback/jaas/SimplePrincipal.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ public final class SimplePrincipal implements Principal { this.name = name; } + @Override public String getName() { return name; } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpExchangeConnection.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpExchangeConnection.java index e91a3f79..dfd0f109 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpExchangeConnection.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpExchangeConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,8 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; +import com.sun.net.httpserver.HttpExchange; + import org.springframework.util.Assert; import org.springframework.util.FileCopyUtils; import org.springframework.ws.WebServiceMessage; @@ -34,8 +36,6 @@ import org.springframework.ws.transport.EndpointAwareWebServiceConnection; import org.springframework.ws.transport.FaultAwareWebServiceConnection; import org.springframework.ws.transport.WebServiceConnection; -import com.sun.net.httpserver.HttpExchange; - /** * Implementation of {@link WebServiceConnection} that is based on the Java 6 HttpServer {@link HttpExchange}. * @@ -64,6 +64,7 @@ public class HttpExchangeConnection extends AbstractReceiverConnection return httpExchange; } + @Override public URI getUri() throws URISyntaxException { return httpExchange.getRequestURI(); } @@ -72,6 +73,7 @@ public class HttpExchangeConnection extends AbstractReceiverConnection this.chunkedEncoding = chunkedEncoding; } + @Override public void endpointNotFound() { responseStatusCode = HttpTransportConstants.STATUS_NOT_FOUND; } @@ -80,10 +82,12 @@ public class HttpExchangeConnection extends AbstractReceiverConnection * Errors */ + @Override public boolean hasError() throws IOException { return false; } + @Override public String getErrorMessage() throws IOException { return null; } @@ -155,10 +159,12 @@ public class HttpExchangeConnection extends AbstractReceiverConnection * Faults */ + @Override public boolean hasFault() throws IOException { return responseStatusCode == HttpTransportConstants.STATUS_INTERNAL_SERVER_ERROR; } + @Override public void setFault(boolean fault) throws IOException { if (fault) { responseStatusCode = HttpTransportConstants.STATUS_INTERNAL_SERVER_ERROR; diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpsUrlConnectionMessageSender.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpsUrlConnectionMessageSender.java index 01452cf4..416cee43 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpsUrlConnectionMessageSender.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/HttpsUrlConnectionMessageSender.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -128,6 +128,7 @@ public class HttpsUrlConnectionMessageSender extends HttpUrlConnectionMessageSen this.sslSocketFactory = sslSocketFactory; } + @Override public void afterPropertiesSet() throws Exception { Assert.isTrue( !(ObjectUtils.isEmpty(keyManagers) && ObjectUtils.isEmpty(trustManagers) && (sslSocketFactory == null)), diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHttpHandler.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHttpHandler.java index d498aabd..6a769703 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHttpHandler.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHttpHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,7 @@ public class WebServiceMessageReceiverHttpHandler extends SimpleWebServiceMessag this.chunkedEncoding = chunkedEncoding; } + @Override public void handle(HttpExchange httpExchange) throws IOException { if (HttpTransportConstants.METHOD_POST.equals(httpExchange.getRequestMethod())) { HttpExchangeConnection connection = new HttpExchangeConnection(httpExchange); diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHttpHandler.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHttpHandler.java index ae44e946..047fe950 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHttpHandler.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHttpHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,10 +52,12 @@ public class WsdlDefinitionHttpHandler extends TransformerObjectSupport implemen this.definition = definition; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(definition, "'definition' is required"); } + @Override public void handle(HttpExchange httpExchange) throws IOException { try { if (HttpTransportConstants.METHOD_GET.equals(httpExchange.getRequestMethod())) { diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsMessageSender.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsMessageSender.java index a8f22539..dedf9a01 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsMessageSender.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsMessageSender.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -151,6 +151,7 @@ public class JmsMessageSender extends JmsDestinationAccessor implements WebServi this.postProcessor = postProcessor; } + @Override public WebServiceConnection createConnection(URI uri) throws IOException { Connection jmsConnection = null; Session jmsSession = null; @@ -179,6 +180,7 @@ public class JmsMessageSender extends JmsDestinationAccessor implements WebServi } } + @Override public boolean supports(URI uri) { return uri.getScheme().equals(JmsTransportConstants.JMS_URI_SCHEME); } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsReceiverConnection.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsReceiverConnection.java index 00386075..03431c81 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsReceiverConnection.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsReceiverConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,6 +111,7 @@ public class JmsReceiverConnection extends AbstractReceiverConnection { * URI */ + @Override public URI getUri() throws URISyntaxException { try { return JmsTransportUtils.toUri(requestMessage.getJMSDestination()); @@ -124,10 +125,12 @@ public class JmsReceiverConnection extends AbstractReceiverConnection { * Errors */ + @Override public String getErrorMessage() throws IOException { return null; } + @Override public boolean hasError() throws IOException { return false; } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsSenderConnection.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsSenderConnection.java index fdf8b933..ce8632ef 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsSenderConnection.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/JmsSenderConnection.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -153,6 +153,7 @@ public class JmsSenderConnection extends AbstractSenderConnection { * URI */ + @Override public URI getUri() throws URISyntaxException { try { return JmsTransportUtils.toUri(requestDestination); @@ -166,10 +167,12 @@ public class JmsSenderConnection extends AbstractSenderConnection { * Errors */ + @Override public boolean hasError() throws IOException { return false; } + @Override public String getErrorMessage() throws IOException { return null; } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/WebServiceMessageListener.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/WebServiceMessageListener.java index 6b98ac8b..a6532e8c 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/WebServiceMessageListener.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/jms/WebServiceMessageListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,7 @@ import org.springframework.ws.transport.WebServiceMessageReceiver; */ public class WebServiceMessageListener extends JmsMessageReceiver implements SessionAwareMessageListener { + @Override public void onMessage(Message message, Session session) throws JMSException { try { handleMessage(message, session); diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailMessageReceiver.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailMessageReceiver.java index 8a2e7475..fe8bcef3 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailMessageReceiver.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailMessageReceiver.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -214,6 +214,7 @@ public class MailMessageReceiver extends AbstractAsyncStandaloneMessageReceiver private class MonitoringRunnable implements SchedulingAwareRunnable { + @Override public void run() { try { openFolder(); @@ -245,6 +246,7 @@ public class MailMessageReceiver extends AbstractAsyncStandaloneMessageReceiver } } + @Override public boolean isLongLived() { return true; } @@ -258,6 +260,7 @@ public class MailMessageReceiver extends AbstractAsyncStandaloneMessageReceiver this.message = message; } + @Override public void run() { MailReceiverConnection connection = new MailReceiverConnection(message, session); connection.setTransportUri(transportUri); @@ -270,6 +273,7 @@ public class MailMessageReceiver extends AbstractAsyncStandaloneMessageReceiver } } + @Override public boolean isLongLived() { return false; } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailMessageSender.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailMessageSender.java index b337b675..239e2f74 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailMessageSender.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailMessageSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -143,11 +143,13 @@ public class MailMessageSender implements WebServiceMessageSender, InitializingB this.transportUri = new URLName(transportUri); } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(transportUri, "'transportUri' is required"); Assert.notNull(storeUri, "'storeUri' is required"); } + @Override public WebServiceConnection createConnection(URI uri) throws IOException { InternetAddress to = MailTransportUtils.getTo(uri); MailSenderConnection connection = @@ -162,6 +164,7 @@ public class MailMessageSender implements WebServiceMessageSender, InitializingB return connection; } + @Override public boolean supports(URI uri) { return uri.getScheme().equals(MailTransportConstants.MAIL_URI_SCHEME); } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailReceiverConnection.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailReceiverConnection.java index 2cf5a068..a6fbdac6 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailReceiverConnection.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailReceiverConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -103,6 +103,7 @@ public class MailReceiverConnection extends AbstractReceiverConnection { * URI */ + @Override public URI getUri() throws URISyntaxException { try { Address[] recipients = requestMessage.getRecipients(Message.RecipientType.TO); @@ -121,10 +122,12 @@ public class MailReceiverConnection extends AbstractReceiverConnection { * Errors */ + @Override public String getErrorMessage() throws IOException { return null; } + @Override public boolean hasError() throws IOException { return false; } @@ -235,18 +238,22 @@ public class MailReceiverConnection extends AbstractReceiverConnection { this.contentType = contentType; } + @Override public String getContentType() { return contentType; } + @Override public InputStream getInputStream() throws IOException { return new ByteArrayInputStream(data); } + @Override public String getName() { return "ByteArrayDataSource"; } + @Override public OutputStream getOutputStream() throws IOException { throw new UnsupportedOperationException(); } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailSenderConnection.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailSenderConnection.java index 1aa69294..b1d8e401 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailSenderConnection.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/MailSenderConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,6 +45,9 @@ import javax.mail.internet.MimeMessage; import javax.mail.search.HeaderTerm; import javax.mail.search.SearchTerm; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.util.Assert; import org.springframework.ws.WebServiceMessage; import org.springframework.ws.transport.AbstractSenderConnection; @@ -52,9 +55,6 @@ import org.springframework.ws.transport.TransportConstants; import org.springframework.ws.transport.WebServiceConnection; import org.springframework.ws.transport.mail.support.MailTransportUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Implementation of {@link WebServiceConnection} that is used for client-side Mail access. Exposes a {@link Message} * request and response message. @@ -137,6 +137,7 @@ public class MailSenderConnection extends AbstractSenderConnection { /* * URI */ + @Override public URI getUri() throws URISyntaxException { return MailTransportUtils.toUri(to, subject); } @@ -292,10 +293,12 @@ public class MailSenderConnection extends AbstractSenderConnection { } } + @Override public boolean hasError() throws IOException { return false; } + @Override public String getErrorMessage() throws IOException { return null; } @@ -317,18 +320,22 @@ public class MailSenderConnection extends AbstractSenderConnection { this.contentType = contentType; } + @Override public InputStream getInputStream() throws IOException { return new ByteArrayInputStream(data); } + @Override public OutputStream getOutputStream() throws IOException { throw new UnsupportedOperationException(); } + @Override public String getContentType() { return contentType; } + @Override public String getName() { return "ByteArrayDataSource"; } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/monitor/AbstractMonitoringStrategy.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/monitor/AbstractMonitoringStrategy.java index d152891f..8c76f6b0 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/monitor/AbstractMonitoringStrategy.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/mail/monitor/AbstractMonitoringStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,6 +50,7 @@ public abstract class AbstractMonitoringStrategy implements MonitoringStrategy { this.deleteMessages = deleteMessages; } + @Override public int getFolderOpenMode() { return deleteMessages ? Folder.READ_WRITE : Folder.READ_ONLY; } @@ -65,6 +66,7 @@ public abstract class AbstractMonitoringStrategy implements MonitoringStrategy { * @throws MessagingException in case of JavaMail errors * @throws InterruptedException when a thread is interrupted */ + @Override public final Message[] monitor(Folder folder) throws MessagingException, InterruptedException { waitForNewMessages(folder); Message[] messages = searchForNewMessages(folder); diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/support/AbstractAsyncStandaloneMessageReceiver.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/support/AbstractAsyncStandaloneMessageReceiver.java index 88681606..b5af0941 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/support/AbstractAsyncStandaloneMessageReceiver.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/support/AbstractAsyncStandaloneMessageReceiver.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,6 +48,7 @@ public abstract class AbstractAsyncStandaloneMessageReceiver extends AbstractSta this.taskExecutor = taskExecutor; } + @Override public void setBeanName(String beanName) { this.beanName = beanName; } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/support/AbstractStandaloneMessageReceiver.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/support/AbstractStandaloneMessageReceiver.java index 9389f27a..9120c490 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/support/AbstractStandaloneMessageReceiver.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/support/AbstractStandaloneMessageReceiver.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,6 +45,7 @@ public abstract class AbstractStandaloneMessageReceiver extends SimpleWebService } /** Return whether this server is currently running, that is, whether it has been started and not stopped yet. */ + @Override public final boolean isRunning() { synchronized (lifecycleMonitor) { return running; @@ -67,6 +68,7 @@ public abstract class AbstractStandaloneMessageReceiver extends SimpleWebService } /** Calls {@link #shutdown()} when the BeanFactory destroys the receiver instance. */ + @Override public void destroy() { shutdown(); } @@ -86,6 +88,7 @@ public abstract class AbstractStandaloneMessageReceiver extends SimpleWebService } /** Start this server. */ + @Override public final void start() { synchronized (lifecycleMonitor) { running = true; @@ -94,6 +97,7 @@ public abstract class AbstractStandaloneMessageReceiver extends SimpleWebService } /** Stop this server. */ + @Override public final void stop() { synchronized (lifecycleMonitor) { running = false; diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppMessageReceiver.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppMessageReceiver.java index f29be219..e4939e19 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppMessageReceiver.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppMessageReceiver.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,6 @@ package org.springframework.ws.transport.xmpp; -import org.springframework.ws.transport.support.AbstractStandaloneMessageReceiver; - import org.jivesoftware.smack.PacketListener; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException; @@ -26,6 +24,8 @@ import org.jivesoftware.smack.filter.PacketTypeFilter; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Packet; +import org.springframework.ws.transport.support.AbstractStandaloneMessageReceiver; + /** * Server-side component for receiving XMPP (Jabber) messages. Requires a {@linkplain #setConnection(XMPPConnection) * connection} to be set, in addition to the {@link #setMessageFactory(org.springframework.ws.WebServiceMessageFactory) @@ -94,6 +94,7 @@ public class XmppMessageReceiver extends AbstractStandaloneMessageReceiver { private class WebServicePacketListener implements PacketListener { + @Override public void processPacket(Packet packet) { logger.info("Received " + packet); if (packet instanceof Message) { diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppMessageSender.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppMessageSender.java index fa65b888..b9332c8a 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppMessageSender.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppMessageSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,14 +20,14 @@ import java.io.IOException; import java.net.URI; import java.util.UUID; +import org.jivesoftware.smack.XMPPConnection; + import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; import org.springframework.ws.transport.WebServiceConnection; import org.springframework.ws.transport.WebServiceMessageSender; import org.springframework.ws.transport.xmpp.support.XmppTransportUtils; -import org.jivesoftware.smack.XMPPConnection; - /** * {@link WebServiceMessageSender} implementation that uses XMPP {@link org.jivesoftware.smack.packet.Message}s. * Requires a {@link #setConnection(org.jivesoftware.smack.XMPPConnection) connection}to be set. @@ -75,10 +75,12 @@ public class XmppMessageSender implements WebServiceMessageSender, InitializingB this.messageEncoding = messageEncoding; } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(connection, "'connection' is required"); } + @Override public WebServiceConnection createConnection(URI uri) throws IOException { String to = XmppTransportUtils.getTo(uri); String thread = createThread(); @@ -88,6 +90,7 @@ public class XmppMessageSender implements WebServiceMessageSender, InitializingB return connection; } + @Override public boolean supports(URI uri) { return uri.getScheme().equals(XmppTransportConstants.XMPP_URI_SCHEME); } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppReceiverConnection.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppReceiverConnection.java index cf622035..3263a05b 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppReceiverConnection.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppReceiverConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,14 +23,14 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.Iterator; +import org.jivesoftware.smack.XMPPConnection; +import org.jivesoftware.smack.packet.Message; + import org.springframework.util.Assert; import org.springframework.ws.WebServiceMessage; import org.springframework.ws.transport.AbstractReceiverConnection; import org.springframework.ws.transport.xmpp.support.XmppTransportUtils; -import org.jivesoftware.smack.XMPPConnection; -import org.jivesoftware.smack.packet.Message; - /** * Implementation of {@link org.springframework.ws.transport.WebServiceConnection} that is used for server-side XMPP * access. Exposes a {@link Message} request and response message. @@ -78,6 +78,7 @@ public class XmppReceiverConnection extends AbstractReceiverConnection { * URI */ + @Override public URI getUri() throws URISyntaxException { return XmppTransportUtils.toUri(requestMessage); } @@ -86,10 +87,12 @@ public class XmppReceiverConnection extends AbstractReceiverConnection { * Errors */ + @Override public boolean hasError() { return XmppTransportUtils.hasError(responseMessage); } + @Override public String getErrorMessage() { return XmppTransportUtils.getErrorMessage(responseMessage); } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppSenderConnection.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppSenderConnection.java index d7c75ae0..0818e2ba 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppSenderConnection.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/XmppSenderConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,11 +23,6 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.Iterator; -import org.springframework.util.Assert; -import org.springframework.ws.WebServiceMessage; -import org.springframework.ws.transport.AbstractSenderConnection; -import org.springframework.ws.transport.xmpp.support.XmppTransportUtils; - import org.jivesoftware.smack.PacketCollector; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.filter.AndFilter; @@ -37,6 +32,11 @@ import org.jivesoftware.smack.filter.ThreadFilter; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Packet; +import org.springframework.util.Assert; +import org.springframework.ws.WebServiceMessage; +import org.springframework.ws.transport.AbstractSenderConnection; +import org.springframework.ws.transport.xmpp.support.XmppTransportUtils; + /** * Implementation of {@link org.springframework.ws.transport.WebServiceConnection} that is used for client-side XMPP * access. Exposes a {@link Message} request and response message. @@ -92,6 +92,7 @@ public class XmppSenderConnection extends AbstractSenderConnection { * URI */ + @Override public URI getUri() throws URISyntaxException { return XmppTransportUtils.toUri(requestMessage); } @@ -100,10 +101,12 @@ public class XmppSenderConnection extends AbstractSenderConnection { * Errors */ + @Override public boolean hasError() { return XmppTransportUtils.hasError(responseMessage); } + @Override public String getErrorMessage() { return XmppTransportUtils.getErrorMessage(responseMessage); } diff --git a/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/support/XmppConnectionFactoryBean.java b/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/support/XmppConnectionFactoryBean.java index 14e98573..0b1fd848 100644 --- a/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/support/XmppConnectionFactoryBean.java +++ b/spring-ws-support/src/main/java/org/springframework/ws/transport/xmpp/support/XmppConnectionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,16 +16,16 @@ package org.springframework.ws.transport.xmpp.support; +import org.jivesoftware.smack.ConnectionConfiguration; +import org.jivesoftware.smack.XMPPConnection; +import org.jivesoftware.smack.XMPPException; + import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; import org.springframework.util.StringUtils; -import org.jivesoftware.smack.ConnectionConfiguration; -import org.jivesoftware.smack.XMPPConnection; -import org.jivesoftware.smack.XMPPException; - /** * Factory to make {@link org.jivesoftware.smack.XMPPConnection} and perform connection and login on the XMPP server * @@ -83,6 +83,7 @@ public class XmppConnectionFactoryBean implements FactoryBean, I this.resource = resource; } + @Override public void afterPropertiesSet() throws XMPPException { ConnectionConfiguration configuration = createConnectionConfiguration(host, port, serviceName); Assert.notNull(configuration, "'configuration' must not be null"); @@ -99,18 +100,22 @@ public class XmppConnectionFactoryBean implements FactoryBean, I } } + @Override public void destroy() { connection.disconnect(); } + @Override public XMPPConnection getObject() { return connection; } + @Override public Class getObjectType() { return XMPPConnection.class; } + @Override public boolean isSingleton() { return true; } diff --git a/spring-ws-support/src/test/java/org/springframework/ws/transport/SimpleTestingMessageReceiver.java b/spring-ws-support/src/test/java/org/springframework/ws/transport/SimpleTestingMessageReceiver.java index 5615573a..fe6f9664 100644 --- a/spring-ws-support/src/test/java/org/springframework/ws/transport/SimpleTestingMessageReceiver.java +++ b/spring-ws-support/src/test/java/org/springframework/ws/transport/SimpleTestingMessageReceiver.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.xml.transform.TransformerObjectSupport; public class SimpleTestingMessageReceiver extends TransformerObjectSupport implements WebServiceMessageReceiver { + @Override public void receive(MessageContext messageContext) throws Exception { Assert.notNull(messageContext, "MessageContext is null"); logger.info("Received " + messageContext.getRequest()); diff --git a/spring-ws-support/src/test/java/org/springframework/ws/transport/http/FaultEndpoint.java b/spring-ws-support/src/test/java/org/springframework/ws/transport/http/FaultEndpoint.java index c7dc5523..3086996c 100644 --- a/spring-ws-support/src/test/java/org/springframework/ws/transport/http/FaultEndpoint.java +++ b/spring-ws-support/src/test/java/org/springframework/ws/transport/http/FaultEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import org.springframework.ws.soap.SoapMessage; public class FaultEndpoint implements MessageEndpoint { + @Override public void invoke(MessageContext messageContext) throws Exception { SoapMessage response = (SoapMessage) messageContext.getResponse(); response.getSoapBody().addServerOrReceiverFault("Something went wrong", Locale.ENGLISH); diff --git a/spring-ws-support/src/test/java/org/springframework/ws/transport/http/NoResponseEndpoint.java b/spring-ws-support/src/test/java/org/springframework/ws/transport/http/NoResponseEndpoint.java index d7746f68..d462238f 100644 --- a/spring-ws-support/src/test/java/org/springframework/ws/transport/http/NoResponseEndpoint.java +++ b/spring-ws-support/src/test/java/org/springframework/ws/transport/http/NoResponseEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.server.endpoint.MessageEndpoint; /** @author Arjen Poutsma */ public class NoResponseEndpoint implements MessageEndpoint { + @Override public void invoke(MessageContext messageContext) throws Exception { } } \ No newline at end of file diff --git a/spring-ws-support/src/test/java/org/springframework/ws/transport/http/ResponseEndpoint.java b/spring-ws-support/src/test/java/org/springframework/ws/transport/http/ResponseEndpoint.java index 672bf43d..a05ba31f 100644 --- a/spring-ws-support/src/test/java/org/springframework/ws/transport/http/ResponseEndpoint.java +++ b/spring-ws-support/src/test/java/org/springframework/ws/transport/http/ResponseEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.server.endpoint.MessageEndpoint; /** @author Arjen Poutsma */ public class ResponseEndpoint implements MessageEndpoint { + @Override public void invoke(MessageContext messageContext) throws Exception { messageContext.getResponse(); } diff --git a/spring-ws-support/src/test/java/org/springframework/ws/transport/support/EchoPayloadEndpoint.java b/spring-ws-support/src/test/java/org/springframework/ws/transport/support/EchoPayloadEndpoint.java index a1754c84..200e0f7e 100644 --- a/spring-ws-support/src/test/java/org/springframework/ws/transport/support/EchoPayloadEndpoint.java +++ b/spring-ws-support/src/test/java/org/springframework/ws/transport/support/EchoPayloadEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.springframework.ws.server.endpoint.PayloadEndpoint; public class EchoPayloadEndpoint implements PayloadEndpoint { + @Override public Source invoke(Source request) throws Exception { return request; } diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/client/AbstractResponseCreator.java b/spring-ws-test/src/main/java/org/springframework/ws/test/client/AbstractResponseCreator.java index d5f72455..43072a67 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/client/AbstractResponseCreator.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/client/AbstractResponseCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ import org.springframework.ws.WebServiceMessageFactory; */ abstract class AbstractResponseCreator implements ResponseCreator { + @Override public final WebServiceMessage createResponse(URI uri, WebServiceMessage request, WebServiceMessageFactory messageFactory) throws IOException { diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/client/ErrorResponseCreator.java b/spring-ws-test/src/main/java/org/springframework/ws/test/client/ErrorResponseCreator.java index ccc56343..c300ad8a 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/client/ErrorResponseCreator.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/client/ErrorResponseCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ class ErrorResponseCreator implements ResponseCreator { this.errorMessage = errorMessage; } + @Override public WebServiceMessage createResponse(URI uri, WebServiceMessage request, WebServiceMessageFactory factory) throws IOException { diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/client/ExceptionResponseCreator.java b/spring-ws-test/src/main/java/org/springframework/ws/test/client/ExceptionResponseCreator.java index e7a0a8f3..109325a9 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/client/ExceptionResponseCreator.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/client/ExceptionResponseCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,7 @@ class ExceptionResponseCreator implements ResponseCreator { this.exception = exception; } + @Override public WebServiceMessage createResponse(URI uri, WebServiceMessage request, WebServiceMessageFactory factory) throws IOException { diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/client/MockSenderConnection.java b/spring-ws-test/src/main/java/org/springframework/ws/test/client/MockSenderConnection.java index be61ae35..b8a4e513 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/client/MockSenderConnection.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/client/MockSenderConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,11 +55,13 @@ class MockSenderConnection implements WebServiceConnection, ResponseActions { // ResponseActions implementation + @Override public ResponseActions andExpect(RequestMatcher requestMatcher) { addRequestMatcher(requestMatcher); return this; } + @Override public void andRespond(ResponseCreator responseCreator) { Assert.notNull(responseCreator, "'responseCreator' must not be null"); this.responseCreator = responseCreator; @@ -67,6 +69,7 @@ class MockSenderConnection implements WebServiceConnection, ResponseActions { // FaultAwareWebServiceConnection implementation + @Override @SuppressWarnings("unchecked") public void send(WebServiceMessage message) throws IOException { if (!requestMatchers.isEmpty()) { @@ -80,6 +83,7 @@ class MockSenderConnection implements WebServiceConnection, ResponseActions { this.request = message; } + @Override @SuppressWarnings("unchecked") public WebServiceMessage receive(WebServiceMessageFactory messageFactory) throws IOException { if (responseCreator != null) { @@ -90,14 +94,17 @@ class MockSenderConnection implements WebServiceConnection, ResponseActions { } } + @Override public URI getUri() { return uri; } + @Override public boolean hasError() throws IOException { return responseCreator instanceof ErrorResponseCreator; } + @Override public String getErrorMessage() throws IOException { if (responseCreator instanceof ErrorResponseCreator) { return ((ErrorResponseCreator) responseCreator).getErrorMessage(); @@ -107,6 +114,7 @@ class MockSenderConnection implements WebServiceConnection, ResponseActions { } } + @Override public void close() throws IOException { requestMatchers.clear(); request = null; diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/client/MockWebServiceMessageSender.java b/spring-ws-test/src/main/java/org/springframework/ws/test/client/MockWebServiceMessageSender.java index 3937cdde..1bbc6846 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/client/MockWebServiceMessageSender.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/client/MockWebServiceMessageSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,7 @@ class MockWebServiceMessageSender implements WebServiceMessageSender { private Iterator connectionIterator; + @Override public MockSenderConnection createConnection(URI uri) throws IOException { Assert.notNull(uri, "'uri' must not be null"); if (connectionIterator == null) { @@ -56,6 +57,7 @@ class MockWebServiceMessageSender implements WebServiceMessageSender { /** * Always returns {@code true}. */ + @Override public boolean supports(URI uri) { return true; } diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/client/ResponseCreators.java b/spring-ws-test/src/main/java/org/springframework/ws/test/client/ResponseCreators.java index bfbd68a2..ce1f83dd 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/client/ResponseCreators.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/client/ResponseCreators.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -210,6 +210,7 @@ public abstract class ResponseCreators { this.adaptee = adaptee; } + @Override public WebServiceMessage createResponse(URI uri, WebServiceMessage request, WebServiceMessageFactory messageFactory) throws IOException { diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/client/UriMatcher.java b/spring-ws-test/src/main/java/org/springframework/ws/test/client/UriMatcher.java index dcbedebf..1fe7838a 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/client/UriMatcher.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/client/UriMatcher.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -18,10 +18,10 @@ package org.springframework.ws.test.client; import java.net.URI; -import org.springframework.ws.WebServiceMessage; - import static org.springframework.ws.test.support.AssertionErrors.assertEquals; +import org.springframework.ws.WebServiceMessage; + /** * Matches {@link URI}s. * @@ -36,6 +36,7 @@ class UriMatcher implements RequestMatcher { this.expected = expected; } + @Override public void match(URI actual, WebServiceMessage request) { assertEquals("Unexpected connection", expected, actual, "Payload", request.getPayloadSource()); } diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/client/WebServiceMessageMatcherAdapter.java b/spring-ws-test/src/main/java/org/springframework/ws/test/client/WebServiceMessageMatcherAdapter.java index a6528943..8edc4939 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/client/WebServiceMessageMatcherAdapter.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/client/WebServiceMessageMatcherAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ class WebServiceMessageMatcherAdapter implements RequestMatcher { this.adaptee = adaptee; } + @Override public void match(URI uri, WebServiceMessage request) throws IOException, AssertionError { adaptee.match(request); } diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/client/XPathExpectationsHelperAdapter.java b/spring-ws-test/src/main/java/org/springframework/ws/test/client/XPathExpectationsHelperAdapter.java index 21a5fdd2..ff949a0b 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/client/XPathExpectationsHelperAdapter.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/client/XPathExpectationsHelperAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,26 +34,32 @@ class XPathExpectationsHelperAdapter implements RequestXPathExpectations { helper = new XPathExpectationsHelper(expression, namespaces); } + @Override public RequestMatcher exists() { return new WebServiceMessageMatcherAdapter(helper.exists()); } + @Override public RequestMatcher doesNotExist() { return new WebServiceMessageMatcherAdapter(helper.doesNotExist()); } + @Override public RequestMatcher evaluatesTo(boolean expectedValue) { return new WebServiceMessageMatcherAdapter(helper.evaluatesTo(expectedValue)); } + @Override public RequestMatcher evaluatesTo(int expectedValue) { return new WebServiceMessageMatcherAdapter(helper.evaluatesTo(expectedValue)); } + @Override public RequestMatcher evaluatesTo(double expectedValue) { return new WebServiceMessageMatcherAdapter(helper.evaluatesTo(expectedValue)); } + @Override public RequestMatcher evaluatesTo(String expectedValue) { return new WebServiceMessageMatcherAdapter(helper.evaluatesTo(expectedValue)); } diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/server/MockWebServiceClient.java b/spring-ws-test/src/main/java/org/springframework/ws/test/server/MockWebServiceClient.java index 4cbb4060..16240cb2 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/server/MockWebServiceClient.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/server/MockWebServiceClient.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -18,6 +18,10 @@ package org.springframework.ws.test.server; import java.io.IOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import static org.springframework.ws.test.support.AssertionErrors.fail; + import org.springframework.context.ApplicationContext; import org.springframework.util.Assert; import org.springframework.ws.WebServiceMessage; @@ -29,11 +33,6 @@ import org.springframework.ws.soap.server.SoapMessageDispatcher; import org.springframework.ws.test.support.MockStrategiesHelper; import org.springframework.ws.transport.WebServiceMessageReceiver; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import static org.springframework.ws.test.support.AssertionErrors.fail; - /** * Main entry point for server-side Web service testing. Typically used to test a {@link * org.springframework.ws.server.MessageDispatcher MessageDispatcher} (including its endpoints, mappings, etc) by @@ -198,6 +197,7 @@ public class MockWebServiceClient { this.messageContext = messageContext; } + @Override public ResponseActions andExpect(ResponseMatcher responseMatcher) { WebServiceMessage request = messageContext.getRequest(); WebServiceMessage response = messageContext.getResponse(); diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/server/RequestCreators.java b/spring-ws-test/src/main/java/org/springframework/ws/test/server/RequestCreators.java index adee5123..57f34ab3 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/server/RequestCreators.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/server/RequestCreators.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -101,6 +101,7 @@ public abstract class RequestCreators { this.adaptee = adaptee; } + @Override public WebServiceMessage createRequest(WebServiceMessageFactory messageFactory) throws IOException { return adaptee.createMessage(messageFactory); } diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/server/SoapFaultResponseMatcher.java b/spring-ws-test/src/main/java/org/springframework/ws/test/server/SoapFaultResponseMatcher.java index 75bf53fa..cd95accd 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/server/SoapFaultResponseMatcher.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/server/SoapFaultResponseMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,15 +19,15 @@ package org.springframework.ws.test.server; import java.io.IOException; import javax.xml.namespace.QName; +import static org.springframework.ws.test.support.AssertionErrors.assertEquals; +import static org.springframework.ws.test.support.AssertionErrors.assertTrue; + import org.springframework.ws.WebServiceMessage; import org.springframework.ws.soap.SoapBody; import org.springframework.ws.soap.SoapFault; import org.springframework.ws.soap.SoapMessage; import org.springframework.ws.soap.SoapVersion; -import static org.springframework.ws.test.support.AssertionErrors.assertEquals; -import static org.springframework.ws.test.support.AssertionErrors.assertTrue; - /** * Abstract Implementation of {@link ResponseMatcher} that checks for a SOAP fault. * @@ -42,6 +42,7 @@ abstract class SoapFaultResponseMatcher implements ResponseMatcher { this.expectedFaultStringOrReason = expectedFaultStringOrReason; } + @Override public void match(WebServiceMessage request, WebServiceMessage response) throws IOException, AssertionError { assertTrue("Response is not a SOAP message", response instanceof SoapMessage); SoapMessage soapResponse = (SoapMessage) response; diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/server/WebServiceMessageMatcherAdapter.java b/spring-ws-test/src/main/java/org/springframework/ws/test/server/WebServiceMessageMatcherAdapter.java index 782197d7..37c26b65 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/server/WebServiceMessageMatcherAdapter.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/server/WebServiceMessageMatcherAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ class WebServiceMessageMatcherAdapter implements ResponseMatcher { this.adaptee = adaptee; } + @Override public void match(WebServiceMessage request, WebServiceMessage response) throws IOException, AssertionError { adaptee.match(response); } diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/server/XPathExpectationsHelperAdapter.java b/spring-ws-test/src/main/java/org/springframework/ws/test/server/XPathExpectationsHelperAdapter.java index 7aef6ac4..1a1909eb 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/server/XPathExpectationsHelperAdapter.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/server/XPathExpectationsHelperAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,26 +34,32 @@ class XPathExpectationsHelperAdapter implements ResponseXPathExpectations { helper = new XPathExpectationsHelper(expression, namespaces); } + @Override public ResponseMatcher exists() { return new WebServiceMessageMatcherAdapter(helper.exists()); } + @Override public ResponseMatcher doesNotExist() { return new WebServiceMessageMatcherAdapter(helper.doesNotExist()); } + @Override public ResponseMatcher evaluatesTo(boolean expectedValue) { return new WebServiceMessageMatcherAdapter(helper.evaluatesTo(expectedValue)); } + @Override public ResponseMatcher evaluatesTo(int expectedValue) { return new WebServiceMessageMatcherAdapter(helper.evaluatesTo(expectedValue)); } + @Override public ResponseMatcher evaluatesTo(double expectedValue) { return new WebServiceMessageMatcherAdapter(helper.evaluatesTo(expectedValue)); } + @Override public ResponseMatcher evaluatesTo(String expectedValue) { return new WebServiceMessageMatcherAdapter(helper.evaluatesTo(expectedValue)); } diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/support/creator/AbstractMessageCreator.java b/spring-ws-test/src/main/java/org/springframework/ws/test/support/creator/AbstractMessageCreator.java index b7598da1..e4ba22ca 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/support/creator/AbstractMessageCreator.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/support/creator/AbstractMessageCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ import org.springframework.ws.WebServiceMessageFactory; */ public abstract class AbstractMessageCreator implements WebServiceMessageCreator { + @Override public final WebServiceMessage createMessage(WebServiceMessageFactory messageFactory) throws IOException { WebServiceMessage message = messageFactory.createWebServiceMessage(); doWithMessage(message); diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/AbstractSoapMessageMatcher.java b/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/AbstractSoapMessageMatcher.java index 795da1a9..895e7be9 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/AbstractSoapMessageMatcher.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/AbstractSoapMessageMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +18,11 @@ package org.springframework.ws.test.support.matcher; import java.io.IOException; +import static org.springframework.ws.test.support.AssertionErrors.assertTrue; + import org.springframework.ws.WebServiceMessage; import org.springframework.ws.soap.SoapMessage; -import static org.springframework.ws.test.support.AssertionErrors.assertTrue; - /** * Abstract base class for SOAP-specific {@link WebServiceMessageMatcher} implementations. *

@@ -34,6 +34,7 @@ import static org.springframework.ws.test.support.AssertionErrors.assertTrue; */ public abstract class AbstractSoapMessageMatcher implements WebServiceMessageMatcher { + @Override public final void match(WebServiceMessage message) throws IOException, AssertionError { assertTrue("Message is not a SOAP message", message instanceof SoapMessage); match((SoapMessage) message); diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/DiffMatcher.java b/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/DiffMatcher.java index c2ff3506..cf3c37d0 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/DiffMatcher.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/DiffMatcher.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -18,13 +18,12 @@ package org.springframework.ws.test.support.matcher; import java.io.IOException; -import org.springframework.ws.WebServiceMessage; - import org.custommonkey.xmlunit.Diff; import org.custommonkey.xmlunit.XMLUnit; - import static org.springframework.ws.test.support.AssertionErrors.assertTrue; +import org.springframework.ws.WebServiceMessage; + /** * Implementation of {@link WebServiceMessageMatcher} based on XMLUnit's {@link Diff}. * @@ -37,6 +36,7 @@ public abstract class DiffMatcher implements WebServiceMessageMatcher { XMLUnit.setIgnoreWhitespace(true); } + @Override public final void match(WebServiceMessage message) throws IOException, AssertionError { Diff diff = createDiff(message); assertTrue("Messages are different, " + diff.toString(), diff.similar(), "Payload", message.getPayloadSource()); diff --git a/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/SchemaValidatingMatcher.java b/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/SchemaValidatingMatcher.java index 153c3401..ba624172 100644 --- a/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/SchemaValidatingMatcher.java +++ b/spring-ws-test/src/main/java/org/springframework/ws/test/support/matcher/SchemaValidatingMatcher.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -19,6 +19,9 @@ package org.springframework.ws.test.support.matcher; import java.io.IOException; import java.util.Arrays; +import static org.springframework.ws.test.support.AssertionErrors.fail; +import org.xml.sax.SAXParseException; + import org.springframework.core.io.Resource; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; @@ -26,10 +29,6 @@ import org.springframework.ws.WebServiceMessage; import org.springframework.xml.validation.XmlValidator; import org.springframework.xml.validation.XmlValidatorFactory; -import org.xml.sax.SAXParseException; - -import static org.springframework.ws.test.support.AssertionErrors.fail; - /** * Uses the {@link XmlValidator} to validate request payload. * @@ -57,6 +56,7 @@ public class SchemaValidatingMatcher implements WebServiceMessageMatcher { } + @Override public void match(WebServiceMessage message) throws IOException, AssertionError { SAXParseException[] exceptions = xmlValidator.validate(message.getPayloadSource()); if (!ObjectUtils.isEmpty(exceptions)) { diff --git a/spring-xml/src/main/java/org/springframework/xml/dom/DomContentHandler.java b/spring-xml/src/main/java/org/springframework/xml/dom/DomContentHandler.java index fb7e40d9..760a2293 100644 --- a/spring-xml/src/main/java/org/springframework/xml/dom/DomContentHandler.java +++ b/spring-xml/src/main/java/org/springframework/xml/dom/DomContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,6 @@ package org.springframework.xml.dom; import java.util.ArrayList; import java.util.List; -import org.springframework.util.Assert; - import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -31,6 +29,8 @@ import org.xml.sax.ContentHandler; import org.xml.sax.Locator; import org.xml.sax.SAXException; +import org.springframework.util.Assert; + /** * SAX ContentHandler that transforms callback calls to DOM Nodes. * @@ -72,6 +72,7 @@ public class DomContentHandler implements ContentHandler { } } + @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { Node parent = getParent(); Element element = document.createElementNS(uri, qName); @@ -87,10 +88,12 @@ public class DomContentHandler implements ContentHandler { elements.add(element); } + @Override public void endElement(String uri, String localName, String qName) throws SAXException { elements.remove(elements.size() - 1); } + @Override public void characters(char ch[], int start, int length) throws SAXException { String data = new String(ch, start, length); Node parent = getParent(); @@ -104,6 +107,7 @@ public class DomContentHandler implements ContentHandler { } } + @Override public void processingInstruction(String target, String data) throws SAXException { Node parent = getParent(); ProcessingInstruction pi = document.createProcessingInstruction(target, data); @@ -114,24 +118,31 @@ public class DomContentHandler implements ContentHandler { * Unsupported */ + @Override public void setDocumentLocator(Locator locator) { } + @Override public void startDocument() throws SAXException { } + @Override public void endDocument() throws SAXException { } + @Override public void startPrefixMapping(String prefix, String uri) throws SAXException { } + @Override public void endPrefixMapping(String prefix) throws SAXException { } + @Override public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { } + @Override public void skippedEntity(String name) throws SAXException { } } diff --git a/spring-xml/src/main/java/org/springframework/xml/namespace/SimpleNamespaceContext.java b/spring-xml/src/main/java/org/springframework/xml/namespace/SimpleNamespaceContext.java index 1f15e3d0..9f6cf93c 100644 --- a/spring-xml/src/main/java/org/springframework/xml/namespace/SimpleNamespaceContext.java +++ b/spring-xml/src/main/java/org/springframework/xml/namespace/SimpleNamespaceContext.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -42,6 +42,7 @@ public class SimpleNamespaceContext implements NamespaceContext { private Map> namespaceUriToPrefixes = new LinkedHashMap>(); + @Override public String getNamespaceURI(String prefix) { Assert.notNull(prefix, "prefix is null"); if (XMLConstants.XML_NS_PREFIX.equals(prefix)) { @@ -56,11 +57,13 @@ public class SimpleNamespaceContext implements NamespaceContext { return XMLConstants.NULL_NS_URI; } + @Override public String getPrefix(String namespaceUri) { Iterator iterator = getPrefixes(namespaceUri); return iterator.hasNext() ? iterator.next() : null; } + @Override public Iterator getPrefixes(String namespaceUri) { Set prefixes = getPrefixesInternal(namespaceUri); prefixes = Collections.unmodifiableSet(prefixes); diff --git a/spring-xml/src/main/java/org/springframework/xml/sax/AbstractXmlReader.java b/spring-xml/src/main/java/org/springframework/xml/sax/AbstractXmlReader.java index d2156828..c1b1392b 100644 --- a/spring-xml/src/main/java/org/springframework/xml/sax/AbstractXmlReader.java +++ b/spring-xml/src/main/java/org/springframework/xml/sax/AbstractXmlReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,34 +48,42 @@ public abstract class AbstractXmlReader implements XMLReader { private LexicalHandler lexicalHandler; + @Override public ContentHandler getContentHandler() { return contentHandler; } + @Override public void setContentHandler(ContentHandler contentHandler) { this.contentHandler = contentHandler; } + @Override public void setDTDHandler(DTDHandler dtdHandler) { this.dtdHandler = dtdHandler; } + @Override public DTDHandler getDTDHandler() { return dtdHandler; } + @Override public EntityResolver getEntityResolver() { return entityResolver; } + @Override public void setEntityResolver(EntityResolver entityResolver) { this.entityResolver = entityResolver; } + @Override public ErrorHandler getErrorHandler() { return errorHandler; } + @Override public void setErrorHandler(ErrorHandler errorHandler) { this.errorHandler = errorHandler; } @@ -90,6 +98,7 @@ public abstract class AbstractXmlReader implements XMLReader { * @throws org.xml.sax.SAXNotRecognizedException * always */ + @Override public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { throw new SAXNotRecognizedException(name); } @@ -99,6 +108,7 @@ public abstract class AbstractXmlReader implements XMLReader { * * @throws SAXNotRecognizedException always */ + @Override public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { throw new SAXNotRecognizedException(name); } @@ -107,6 +117,7 @@ public abstract class AbstractXmlReader implements XMLReader { * Throws a SAXNotRecognizedException exception when the given property does not signify a lexical * handler. The property name for a lexical handler is http://xml.org/sax/properties/lexical-handler. */ + @Override public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException { if ("http://xml.org/sax/properties/lexical-handler".equals(name)) { return lexicalHandler; @@ -120,6 +131,7 @@ public abstract class AbstractXmlReader implements XMLReader { * Throws a SAXNotRecognizedException exception when the given property does not signify a lexical * handler. The property name for a lexical handler is http://xml.org/sax/properties/lexical-handler. */ + @Override public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { if ("http://xml.org/sax/properties/lexical-handler".equals(name)) { lexicalHandler = (LexicalHandler) value; diff --git a/spring-xml/src/main/java/org/springframework/xml/validation/Jaxp13ValidatorFactory.java b/spring-xml/src/main/java/org/springframework/xml/validation/Jaxp13ValidatorFactory.java index d478bae2..409eefa5 100644 --- a/spring-xml/src/main/java/org/springframework/xml/validation/Jaxp13ValidatorFactory.java +++ b/spring-xml/src/main/java/org/springframework/xml/validation/Jaxp13ValidatorFactory.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,11 +23,11 @@ import javax.xml.transform.Source; import javax.xml.validation.Schema; import javax.xml.validation.Validator; -import org.springframework.core.io.Resource; - import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; +import org.springframework.core.io.Resource; + /** * Internal class that uses JAXP 1.0 features to create XmlValidator instances. * @@ -54,10 +54,12 @@ abstract class Jaxp13ValidatorFactory { this.schema = schema; } + @Override public SAXParseException[] validate(Source source) throws IOException { return validate(source, null); } + @Override public SAXParseException[] validate(Source source, ValidationErrorHandler errorHandler) throws IOException { if (errorHandler == null) { errorHandler = new DefaultValidationErrorHandler(); @@ -79,17 +81,21 @@ abstract class Jaxp13ValidatorFactory { private List errors = new ArrayList(); + @Override public SAXParseException[] getErrors() { return errors.toArray(new SAXParseException[errors.size()]); } + @Override public void warning(SAXParseException ex) throws SAXException { } + @Override public void error(SAXParseException ex) throws SAXException { errors.add(ex); } + @Override public void fatalError(SAXParseException ex) throws SAXException { errors.add(ex); } diff --git a/spring-xml/src/main/java/org/springframework/xml/xpath/AbstractXPathTemplate.java b/spring-xml/src/main/java/org/springframework/xml/xpath/AbstractXPathTemplate.java index 1e464bb5..9fba40b9 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xpath/AbstractXPathTemplate.java +++ b/spring-xml/src/main/java/org/springframework/xml/xpath/AbstractXPathTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,13 +21,13 @@ import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.dom.DOMResult; -import org.springframework.xml.transform.TransformerObjectSupport; - import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; +import org.springframework.xml.transform.TransformerObjectSupport; + /** * Abstract base class for implementations of {@link XPathOperations}. Contains a namespaces property. * @@ -48,6 +48,7 @@ public abstract class AbstractXPathTemplate extends TransformerObjectSupport imp this.namespaces = namespaces; } + @Override public final void evaluate(String expression, Source context, NodeCallbackHandler callbackHandler) throws XPathException { evaluate(expression, context, new NodeCallbackHandlerNodeMapper(callbackHandler)); @@ -62,6 +63,7 @@ public abstract class AbstractXPathTemplate extends TransformerObjectSupport imp this.callbackHandler = callbackHandler; } + @Override public Object mapNode(Node node, int nodeNum) throws DOMException { callbackHandler.processNode(node); return null; diff --git a/spring-xml/src/main/java/org/springframework/xml/xpath/JaxenXPathExpressionFactory.java b/spring-xml/src/main/java/org/springframework/xml/xpath/JaxenXPathExpressionFactory.java index 642497b1..845238fd 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xpath/JaxenXPathExpressionFactory.java +++ b/spring-xml/src/main/java/org/springframework/xml/xpath/JaxenXPathExpressionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,6 +83,7 @@ abstract class JaxenXPathExpressionFactory { this.xpath = xpath; } + @Override public Node evaluateAsNode(Node node) { try { return (Node) xpath.selectSingleNode(node); @@ -92,6 +93,7 @@ abstract class JaxenXPathExpressionFactory { } } + @Override public boolean evaluateAsBoolean(Node node) { try { return xpath.booleanValueOf(node); @@ -101,6 +103,7 @@ abstract class JaxenXPathExpressionFactory { } } + @Override public double evaluateAsNumber(Node node) { try { return xpath.numberValueOf(node).doubleValue(); @@ -110,6 +113,7 @@ abstract class JaxenXPathExpressionFactory { } } + @Override public String evaluateAsString(Node node) { try { return xpath.stringValueOf(node); @@ -119,6 +123,7 @@ abstract class JaxenXPathExpressionFactory { } } + @Override @SuppressWarnings("unchecked") public List evaluateAsNodeList(Node node) { try { @@ -129,6 +134,7 @@ abstract class JaxenXPathExpressionFactory { } } + @Override public T evaluateAsObject(Node context, NodeMapper nodeMapper) throws XPathException { try { Node result = (Node) xpath.selectSingleNode(context); @@ -149,6 +155,7 @@ abstract class JaxenXPathExpressionFactory { } } + @Override public List evaluate(Node context, NodeMapper nodeMapper) throws XPathException { try { List nodes = xpath.selectNodes(context); diff --git a/spring-xml/src/main/java/org/springframework/xml/xpath/JaxenXPathTemplate.java b/spring-xml/src/main/java/org/springframework/xml/xpath/JaxenXPathTemplate.java index 7aa03ca5..8ce66511 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xpath/JaxenXPathTemplate.java +++ b/spring-xml/src/main/java/org/springframework/xml/xpath/JaxenXPathTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,7 @@ import org.w3c.dom.Node; */ public class JaxenXPathTemplate extends AbstractXPathTemplate { + @Override public boolean evaluateAsBoolean(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); @@ -54,6 +55,7 @@ public class JaxenXPathTemplate extends AbstractXPathTemplate { } } + @Override public Node evaluateAsNode(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); @@ -68,6 +70,7 @@ public class JaxenXPathTemplate extends AbstractXPathTemplate { } } + @Override @SuppressWarnings("unchecked") public List evaluateAsNodeList(String expression, Source context) throws XPathException { try { @@ -83,6 +86,7 @@ public class JaxenXPathTemplate extends AbstractXPathTemplate { } } + @Override public double evaluateAsDouble(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); @@ -97,6 +101,7 @@ public class JaxenXPathTemplate extends AbstractXPathTemplate { } } + @Override public String evaluateAsString(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); @@ -111,6 +116,7 @@ public class JaxenXPathTemplate extends AbstractXPathTemplate { } } + @Override public T evaluateAsObject(String expression, Source context, NodeMapper nodeMapper) throws XPathException { try { XPath xpath = createXPath(expression); @@ -137,6 +143,7 @@ public class JaxenXPathTemplate extends AbstractXPathTemplate { } } + @Override public List evaluate(String expression, Source context, NodeMapper nodeMapper) throws XPathException { try { XPath xpath = createXPath(expression); diff --git a/spring-xml/src/main/java/org/springframework/xml/xpath/Jaxp13XPathExpressionFactory.java b/spring-xml/src/main/java/org/springframework/xml/xpath/Jaxp13XPathExpressionFactory.java index d1ea41db..51cb3987 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xpath/Jaxp13XPathExpressionFactory.java +++ b/spring-xml/src/main/java/org/springframework/xml/xpath/Jaxp13XPathExpressionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,12 +25,12 @@ import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; -import org.springframework.xml.namespace.SimpleNamespaceContext; - import org.w3c.dom.DOMException; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.springframework.xml.namespace.SimpleNamespaceContext; + /** * JAXP 1.3-specific factory creating {@link XPathExpression} objects. * @@ -98,10 +98,12 @@ abstract class Jaxp13XPathExpressionFactory { this.xpathExpression = xpathExpression; } + @Override public String evaluateAsString(Node node) { return (String) evaluate(node, XPathConstants.STRING); } + @Override public List evaluateAsNodeList(Node node) { NodeList nodeList = (NodeList) evaluate(node, XPathConstants.NODESET); return toNodeList(nodeList); @@ -127,18 +129,22 @@ abstract class Jaxp13XPathExpressionFactory { return result; } + @Override public double evaluateAsNumber(Node node) { return (Double) evaluate(node, XPathConstants.NUMBER); } + @Override public boolean evaluateAsBoolean(Node node) { return (Boolean) evaluate(node, XPathConstants.BOOLEAN); } + @Override public Node evaluateAsNode(Node node) { return (Node) evaluate(node, XPathConstants.NODE); } + @Override public T evaluateAsObject(Node node, NodeMapper nodeMapper) throws XPathException { Node result = (Node) evaluate(node, XPathConstants.NODE); if (result != null) { @@ -154,6 +160,7 @@ abstract class Jaxp13XPathExpressionFactory { } } + @Override public List evaluate(Node node, NodeMapper nodeMapper) throws XPathException { NodeList nodes = (NodeList) evaluate(node, XPathConstants.NODESET); List results = new ArrayList(nodes.getLength()); diff --git a/spring-xml/src/main/java/org/springframework/xml/xpath/Jaxp13XPathTemplate.java b/spring-xml/src/main/java/org/springframework/xml/xpath/Jaxp13XPathTemplate.java index 81513447..d96a5d8f 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xpath/Jaxp13XPathTemplate.java +++ b/spring-xml/src/main/java/org/springframework/xml/xpath/Jaxp13XPathTemplate.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -33,11 +33,6 @@ import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import javax.xml.xpath.XPathFactoryConfigurationException; -import org.springframework.util.xml.StaxUtils; -import org.springframework.xml.namespace.SimpleNamespaceContext; -import org.springframework.xml.transform.TransformerHelper; -import org.springframework.xml.transform.TraxUtils; - import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -46,6 +41,11 @@ import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; +import org.springframework.util.xml.StaxUtils; +import org.springframework.xml.namespace.SimpleNamespaceContext; +import org.springframework.xml.transform.TransformerHelper; +import org.springframework.xml.transform.TraxUtils; + /** * Implementation of {@link XPathOperations} that uses JAXP 1.3. JAXP 1.3 is part of Java SE since 1.5. *

@@ -72,15 +72,18 @@ public class Jaxp13XPathTemplate extends AbstractXPathTemplate { } } + @Override public boolean evaluateAsBoolean(String expression, Source context) throws XPathException { Boolean result = (Boolean) evaluate(expression, context, XPathConstants.BOOLEAN); return result != null && result; } + @Override public Node evaluateAsNode(String expression, Source context) throws XPathException { return (Node) evaluate(expression, context, XPathConstants.NODE); } + @Override public List evaluateAsNodeList(String expression, Source context) throws XPathException { NodeList result = (NodeList) evaluate(expression, context, XPathConstants.NODESET); List nodes = new ArrayList(result.getLength()); @@ -90,15 +93,18 @@ public class Jaxp13XPathTemplate extends AbstractXPathTemplate { return nodes; } + @Override public double evaluateAsDouble(String expression, Source context) throws XPathException { Double result = (Double) evaluate(expression, context, XPathConstants.NUMBER); return result != null ? result : Double.NaN; } + @Override public String evaluateAsString(String expression, Source context) throws XPathException { return (String) evaluate(expression, context, XPathConstants.STRING); } + @Override public T evaluateAsObject(String expression, Source context, NodeMapper nodeMapper) throws XPathException { Node node = evaluateAsNode(expression, context); if (node != null) { @@ -114,6 +120,7 @@ public class Jaxp13XPathTemplate extends AbstractXPathTemplate { } } + @Override public List evaluate(String expression, Source context, NodeMapper nodeMapper) throws XPathException { NodeList nodes = (NodeList) evaluate(expression, context, XPathConstants.NODESET); List results = new ArrayList(nodes.getLength()); @@ -173,33 +180,40 @@ public class Jaxp13XPathTemplate extends AbstractXPathTemplate { this.returnType = returnType; } + @Override public void domSource(Node node) throws XPathExpressionException { result = xpath.evaluate(expression, node, returnType); } + @Override public void saxSource(XMLReader reader, InputSource inputSource) throws XPathExpressionException { inputSource(inputSource); } + @Override public void staxSource(XMLEventReader eventReader) throws XPathExpressionException, XMLStreamException, TransformerException { Element element = getRootElement(StaxUtils.createCustomStaxSource(eventReader)); domSource(element); } + @Override public void staxSource(XMLStreamReader streamReader) throws TransformerException, XPathExpressionException { Element element = getRootElement(StaxUtils.createCustomStaxSource(streamReader)); domSource(element); } + @Override public void streamSource(InputStream inputStream) throws XPathExpressionException { inputSource(new InputSource(inputStream)); } + @Override public void streamSource(Reader reader) throws XPathExpressionException { inputSource(new InputSource(reader)); } + @Override public void source(String systemId) throws XPathExpressionException { inputSource(new InputSource(systemId)); } diff --git a/spring-xml/src/main/java/org/springframework/xml/xpath/XPathExpressionFactoryBean.java b/spring-xml/src/main/java/org/springframework/xml/xpath/XPathExpressionFactoryBean.java index d7f16d6b..1c2f5b52 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xpath/XPathExpressionFactoryBean.java +++ b/spring-xml/src/main/java/org/springframework/xml/xpath/XPathExpressionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,6 +51,7 @@ public class XPathExpressionFactoryBean implements FactoryBean, this.namespaces = namespaces; } + @Override public void afterPropertiesSet() throws IllegalStateException, XPathParseException { Assert.notNull(expressionString, "expression is required"); if (CollectionUtils.isEmpty(namespaces)) { @@ -61,14 +62,17 @@ public class XPathExpressionFactoryBean implements FactoryBean, } } + @Override public XPathExpression getObject() throws Exception { return expression; } + @Override public Class getObjectType() { return XPathExpression.class; } + @Override public boolean isSingleton() { return true; } diff --git a/spring-xml/src/main/java/org/springframework/xml/xsd/SimpleXsdSchema.java b/spring-xml/src/main/java/org/springframework/xml/xsd/SimpleXsdSchema.java index 0d9c7ca3..15a3af64 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xsd/SimpleXsdSchema.java +++ b/spring-xml/src/main/java/org/springframework/xml/xsd/SimpleXsdSchema.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2011 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -90,14 +90,17 @@ public class SimpleXsdSchema implements XsdSchema, InitializingBean { this.xsdResource = xsdResource; } + @Override public String getTargetNamespace() { return schemaElement.getAttribute("targetNamespace"); } + @Override public Source getSource() { return new DOMSource(schemaElement); } + @Override public XmlValidator createValidator() { try { return XmlValidatorFactory.createValidator(xsdResource, XmlValidatorFactory.SCHEMA_W3C_XML); @@ -107,6 +110,7 @@ public class SimpleXsdSchema implements XsdSchema, InitializingBean { } } + @Override public void afterPropertiesSet() throws ParserConfigurationException, IOException, SAXException { Assert.notNull(xsdResource, "'xsd' is required"); Assert.isTrue(this.xsdResource.exists(), "xsd '" + this.xsdResource + "' does not exist"); diff --git a/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchema.java b/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchema.java index 82d7496d..70fa3405 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchema.java +++ b/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchema.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -78,6 +78,7 @@ public class CommonsXsdSchema implements XsdSchema { this.collection = collection; } + @Override public String getTargetNamespace() { return schema.getTargetNamespace(); } @@ -87,6 +88,7 @@ public class CommonsXsdSchema implements XsdSchema { return result.toArray(new QName[result.size()]); } + @Override public Source getSource() { // try to use the the package-friendly XmlSchemaSerializer first, fall back to slower stream-based version try { @@ -114,6 +116,7 @@ public class CommonsXsdSchema implements XsdSchema { return new StreamSource(bis); } + @Override public XmlValidator createValidator() { try { Resource resource = new UrlResource(schema.getSourceURI()); diff --git a/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java b/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java index aefc8390..dd0cc7b4 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java +++ b/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java @@ -1,11 +1,11 @@ /* - * Copyright 2005-2012 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -119,10 +119,12 @@ public class CommonsXsdSchemaCollection implements XsdSchemaCollection, Initiali this.uriResolver = uriResolver; } + @Override public void setResourceLoader(ResourceLoader resourceLoader) { this.resourceLoader = resourceLoader; } + @Override public void afterPropertiesSet() throws IOException { Assert.notEmpty(xsdResources, "'xsds' must not be empty"); @@ -153,6 +155,7 @@ public class CommonsXsdSchemaCollection implements XsdSchemaCollection, Initiali } + @Override public XsdSchema[] getXsdSchemas() { XsdSchema[] result = new XsdSchema[xmlSchemas.size()]; for (int i = 0; i < xmlSchemas.size(); i++) { @@ -162,6 +165,7 @@ public class CommonsXsdSchemaCollection implements XsdSchemaCollection, Initiali return result; } + @Override public XmlValidator createValidator() { try { Resource[] resources = new Resource[xmlSchemas.size()]; diff --git a/spring-xml/src/test/java/org/springframework/xml/validation/XmlValidatorFactoryTest.java b/spring-xml/src/test/java/org/springframework/xml/validation/XmlValidatorFactoryTest.java index e6c2088a..34c3b0d9 100644 --- a/spring-xml/src/test/java/org/springframework/xml/validation/XmlValidatorFactoryTest.java +++ b/spring-xml/src/test/java/org/springframework/xml/validation/XmlValidatorFactoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 the original author or authors. + * Copyright 2005-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,13 +22,13 @@ import java.io.InputStream; import java.net.URI; import java.net.URL; +import org.junit.Assert; +import org.junit.Test; + import org.springframework.core.io.AbstractResource; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; -import org.junit.Assert; -import org.junit.Test; - public class XmlValidatorFactoryTest { @Test @@ -74,6 +74,7 @@ public class XmlValidatorFactoryTest { return false; } + @Override public String getDescription() { return null; } @@ -103,6 +104,7 @@ public class XmlValidatorFactoryTest { return false; } + @Override public InputStream getInputStream() throws IOException { throw new IOException(); }