1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
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 | |
} |