Skip to content

Commit 9e1cf7a

Browse files
committed
Adding FTP Source connector capabilities
1 parent 04daf77 commit 9e1cf7a

File tree

2 files changed

+113
-1
lines changed

2 files changed

+113
-1
lines changed

src/factories/connector-objects.factory.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ angularAPP.factory('connectorObjects', function (KafkaConnectFactory, supportedC
7575
function extractTopicsFromConfig(connectorConfig) {
7676
var topics = [];
7777
angular.forEach(connectorConfig, function (value, key) {
78+
// adding extra logic to capture information about FTP Source connectors
79+
if (key.indexOf("connect.ftp.monitor") != -1) {
80+
var setup = value.split(": ");
81+
topics.push(setup)
82+
}
7883
if (key.indexOf("topic") != -1) {
7984
var tArray = value.split(",");
8085
if(tArray.length > 1) {

src/supported-connectors.js

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,114 @@ var supportedConnectorsTemplates = [{
151151
}]
152152
}],
153153
},
154-
154+
{
155+
name: "ftp",
156+
icon: "file.png",
157+
class: "com.datamountaineer.streamreactor.connect.ftp.FtpSourceConnector",
158+
description: "Tail directories in remote FTP location and bring messages in Kafka",
159+
type: "Source",
160+
uiEnabled: true,
161+
color: "#b1b1b1",
162+
template: [{
163+
step: "Basic Info",
164+
id: "step1",
165+
sections: [{
166+
section: "Basic connector information",
167+
elements: [{
168+
key: 'name',
169+
value: 'ftp-connector',
170+
label: 'Connector Name',
171+
tooltip: ' The (unique) connector name',
172+
type: 'text',
173+
placeholder: 'ie.ftp-connector',
174+
required: true,
175+
flex: "100",
176+
errorMessage: "Connector Name is required field and must be unique"
177+
}, {
178+
key: 'tasks.max',
179+
value: 1,
180+
element: 'input',
181+
label: 'Max Tasks',
182+
tooltip: 'The number of tasks the connector is allowed to start (max is 5)',
183+
type: 'number',
184+
max: 5,
185+
min: 1,
186+
required: true,
187+
flex: 50,
188+
errorMessage: "Max 5 tasks"
189+
}, {
190+
key: 'connect.ftp.monitor.tail',
191+
value: 'multichannel/*.csv:multichannel',
192+
element: 'input',
193+
label: 'Remote FTP location:topicName',
194+
tooltip: 'Comma separated tuples of folders and topics',
195+
type: 'text',
196+
required: true,
197+
errorMessage: "Must setup FTP monitor.tail or monitor.update"
198+
}, {
199+
key: 'connect.ftp.keystyle',
200+
value: 'struct',
201+
element: 'input',
202+
label: 'struct or string',
203+
tooltip: 'How to key your messages',
204+
type: 'text',
205+
required: true,
206+
errorMessage: "Must setup FTP keystyle"
207+
}, {
208+
key: 'connect.ftp.file.maxage',
209+
value: 'P14D',
210+
element: 'input',
211+
label: 'Do not care for files older than the particular duration',
212+
tooltip: 'i.e. ignore files older than 14 days',
213+
type: 'text',
214+
required: true,
215+
errorMessage: "Must setup FTP maxage"
216+
}, {
217+
key: 'connect.ftp.refresh',
218+
value: 'PT1M',
219+
element: 'input',
220+
label: 'Poll time in iso8086 duration format',
221+
tooltip: 'Poll FTP every 1 minute by default',
222+
type: 'text',
223+
required: true,
224+
errorMessage: "Must setup FTP refresh"
225+
}, {
226+
key: 'connect.ftp.password',
227+
value: 'xxxxxx',
228+
element: 'input',
229+
label: 'FTP Password',
230+
tooltip: 'The FTP password',
231+
type: 'text',
232+
required: true,
233+
errorMessage: "Must setup FTP password"
234+
}, {
235+
key: 'connect.ftp.user',
236+
value: 'Antwnis',
237+
element: 'input',
238+
label: 'FTP User',
239+
tooltip: 'The FTP username',
240+
type: 'text',
241+
required: true,
242+
errorMessage: "Must setup FTP username"
243+
}, {
244+
key: 'connect.ftp.address',
245+
value: '192.168.0.15:21',
246+
element: 'input',
247+
label: 'FTP Server',
248+
tooltip: 'The host and port of the remote FTP server',
249+
type: 'text',
250+
required: true,
251+
errorMessage: "Must setup FTP Address"
252+
}, {
253+
key: 'connector.class',
254+
value: 'com.datamountaineer.streamreactor.connect.ftp.FtpSourceConnector',
255+
type: 'hidden',
256+
required: true,
257+
flex: "100"
258+
}]
259+
}] //end of sections
260+
}]
261+
},
155262
{
156263
name: "file",
157264
icon: "file.png",

0 commit comments

Comments
 (0)