This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new a75cc85  No need to use SoapMessage in the attachment callback handler
a75cc85 is described below

commit a75cc85a4e0a57ef0db15088a98779c9b7a23536
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Tue Jul 2 14:59:46 2019 +0100

    No need to use SoapMessage in the attachment callback handler
---
 .../ws/security/wss4j/AttachmentCallbackHandler.java   | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AttachmentCallbackHandler.java
 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AttachmentCallbackHandler.java
index 1246190..299e1ff 100644
--- 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AttachmentCallbackHandler.java
+++ 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AttachmentCallbackHandler.java
@@ -32,8 +32,8 @@ import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.UnsupportedCallbackException;
 
 import org.apache.cxf.attachment.AttachmentDataSource;
-import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.message.Attachment;
+import org.apache.cxf.message.Message;
 import org.apache.wss4j.common.ext.AttachmentRemovalCallback;
 import org.apache.wss4j.common.ext.AttachmentRequestCallback;
 import org.apache.wss4j.common.ext.AttachmentResultCallback;
@@ -43,10 +43,10 @@ import org.apache.wss4j.common.ext.AttachmentResultCallback;
  */
 public class AttachmentCallbackHandler implements CallbackHandler {
 
-    private final SoapMessage soapMessage;
+    private final Message message;
 
-    public AttachmentCallbackHandler(SoapMessage soapMessage) {
-        this.soapMessage = soapMessage;
+    public AttachmentCallbackHandler(Message message) {
+        this.message = message;
     }
 
     @Override
@@ -67,11 +67,11 @@ public class AttachmentCallbackHandler implements 
CallbackHandler {
             } else if (callback instanceof AttachmentResultCallback) {
                 AttachmentResultCallback attachmentResultCallback = 
(AttachmentResultCallback) callback;
 
-                if (soapMessage.getAttachments() == null) {
-                    soapMessage.setAttachments(new ArrayList<Attachment>());
+                if (message.getAttachments() == null) {
+                    message.setAttachments(new ArrayList<Attachment>());
                 }
 
-                final Collection<org.apache.cxf.message.Attachment> 
attachments = soapMessage.getAttachments();
+                final Collection<org.apache.cxf.message.Attachment> 
attachments = message.getAttachments();
 
                 org.apache.cxf.attachment.AttachmentImpl securedAttachment =
                     new org.apache.cxf.attachment.AttachmentImpl(
@@ -93,7 +93,7 @@ public class AttachmentCallbackHandler implements 
CallbackHandler {
                 AttachmentRemovalCallback attachmentRemovalCallback = 
(AttachmentRemovalCallback) callback;
                 String attachmentId = 
attachmentRemovalCallback.getAttachmentId();
                 if (attachmentId != null) {
-                    final Collection<org.apache.cxf.message.Attachment> 
attachments = soapMessage.getAttachments();
+                    final Collection<org.apache.cxf.message.Attachment> 
attachments = message.getAttachments();
                     // Calling LazyAttachmentCollection.size() here to force 
it to load the attachments
                     if (attachments != null && attachments.size() > 0) {  // 
NOPMD
                         for (Iterator<org.apache.cxf.message.Attachment> 
iterator = attachments.iterator();
@@ -118,7 +118,7 @@ public class AttachmentCallbackHandler implements 
CallbackHandler {
         String attachmentId,
         boolean removeAttachments
     ) throws IOException {
-        final Collection<org.apache.cxf.message.Attachment> attachments = 
soapMessage.getAttachments();
+        final Collection<org.apache.cxf.message.Attachment> attachments = 
message.getAttachments();
         // Calling LazyAttachmentCollection.size() here to force it to load 
the attachments
         if (attachments != null && attachments.size() > 0) { // NOPMD
             for (Iterator<org.apache.cxf.message.Attachment> iterator = 
attachments.iterator();

Reply via email to