Coverage Report - org.mule.transport.sftp.notification.SftpNotifier
 
Classes in this File Line Coverage Branch Coverage Complexity
SftpNotifier
0%
0/13
0%
0/2
1.25
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.transport.sftp.notification;
 8  
 
 9  
 import org.mule.api.MuleMessage;
 10  
 import org.mule.api.endpoint.ImmutableEndpoint;
 11  
 import org.mule.transport.sftp.SftpConnector;
 12  
 
 13  
 public class SftpNotifier
 14  
 {
 15  
 
 16  
     private SftpConnector connector;
 17  
     private MuleMessage message;
 18  
     private ImmutableEndpoint endpoint;
 19  
     private String serviceName;
 20  
 
 21  
     public SftpNotifier(SftpConnector connector,
 22  
                         MuleMessage message,
 23  
                         ImmutableEndpoint endpoint,
 24  
                         String serviceName)
 25  0
     {
 26  
 
 27  0
         this.connector = connector;
 28  0
         this.message = message;
 29  0
         this.endpoint = endpoint;
 30  0
         this.serviceName = serviceName;
 31  0
     }
 32  
 
 33  
     public void setMessage(MuleMessage message)
 34  
     {
 35  0
         this.message = message;
 36  0
     }
 37  
 
 38  
     public void notify(int action, String info)
 39  
     {
 40  0
         notify(action, info, -1);
 41  0
     }
 42  
 
 43  
     public void notify(int action, String info, long size)
 44  
     {
 45  0
         if (connector.isEnableMessageEvents())
 46  
         {
 47  0
             connector.fireNotification(new SftpTransportNotification(message, endpoint, serviceName, action,
 48  
                 info, size));
 49  
         }
 50  0
     }
 51  
 }