1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.jumpmind.symmetric.transport.mock;
22
23 import java.io.IOException;
24 import java.io.OutputStream;
25 import java.util.List;
26 import java.util.Map;
27
28 import org.jumpmind.symmetric.model.BatchInfo;
29 import org.jumpmind.symmetric.model.Node;
30 import org.jumpmind.symmetric.model.IncomingBatchHistory;
31 import org.jumpmind.symmetric.transport.IIncomingTransport;
32 import org.jumpmind.symmetric.transport.IOutgoingWithResponseTransport;
33 import org.jumpmind.symmetric.transport.ITransportManager;
34
35 public class MockTransportManager implements ITransportManager {
36
37 protected IIncomingTransport incomingTransport;
38
39 protected IOutgoingWithResponseTransport outgoingTransport;
40
41 public IIncomingTransport getPullTransport(Node remote, Node local) throws IOException {
42 return incomingTransport;
43 }
44
45 public IOutgoingWithResponseTransport getPushTransport(Node remote, Node local) throws IOException {
46 return outgoingTransport;
47 }
48
49 public boolean sendAcknowledgement(Node remote, List<IncomingBatchHistory> list, Node local) throws IOException {
50 return true;
51 }
52
53 public boolean sendMessage(Node node, String data) throws IOException {
54 return true;
55 }
56
57 public void writeAcknowledgement(OutputStream out, List<IncomingBatchHistory> list) throws IOException {
58 }
59
60 public void writeMessage(OutputStream out, String data) throws IOException {
61 }
62
63 public IIncomingTransport getIncomingTransport() {
64 return incomingTransport;
65 }
66
67 public void setIncomingTransport(IIncomingTransport is) {
68 this.incomingTransport = is;
69 }
70
71 public IOutgoingWithResponseTransport getOutgoingTransport() {
72 return outgoingTransport;
73 }
74
75 public void setOutgoingTransport(IOutgoingWithResponseTransport outgoingTransport) {
76 this.outgoingTransport = outgoingTransport;
77 }
78
79 public IIncomingTransport getRegisterTransport(Node node) throws IOException {
80 return incomingTransport;
81 }
82
83 public List<BatchInfo> readAcknowledgement(String parameterString) throws IOException {
84 return null;
85 }
86
87 public List<BatchInfo> readAcknowledgement(Map<String, Object> parameters) {
88 return null;
89 }
90
91 public List<BatchInfo> readAcknowledgement(String parameterString1, String parameterString2) throws IOException {
92 return null;
93 }
94
95 }