Skip to content

Commit 7e76c80

Browse files
[*] javadoc
1 parent b7ffaf9 commit 7e76c80

File tree

11 files changed

+50
-120
lines changed

11 files changed

+50
-120
lines changed

java/commons/src/main/java/com/epam/deltix/data/connectors/commons/DataConnector.java

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.epam.deltix.data.connectors.commons;
22

33
/**
4+
* Base Data Connector class
45
*
5-
* @param <T>
66
*/
77
public abstract class DataConnector<T extends DataConnectorSettings> implements AutoCloseable {
88
public static volatile CloseableMessageOutputFactory DEBUG_OUTPUT_FACTORY = null; // not sure we need to
@@ -32,8 +32,8 @@ public T settings() {
3232
}
3333

3434
/**
35-
*
36-
* @return
35+
* Model
36+
* @return Actual model
3737
*/
3838
public MdModel model() {
3939
return model;
@@ -45,8 +45,8 @@ public Logger logger() {
4545

4646
/**
4747
*
48-
* @param selected
49-
* @param symbols
48+
* @param selected options
49+
* @param symbols symbols to subscribe
5050
*/
5151
public final synchronized void subscribe(final MdModel.Options selected, final String... symbols) {
5252
if (closed) {
@@ -95,10 +95,11 @@ public void close() {
9595

9696
/**
9797
*
98-
* @param selected
99-
* @param outputFactory
100-
* @param symbols
101-
* @return
98+
* @param selected options
99+
* @param outputFactory factory
100+
* @param symbols symbols to subscribe
101+
*
102+
* @return factory to receive data
102103
*/
103104
protected abstract RetriableFactory<MdFeed> doSubscribe(
104105
MdModel.Options selected,

java/commons/src/main/java/com/epam/deltix/data/connectors/commons/MdModel.java

+8-76
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public boolean level1() {
103103
/**
104104
*
105105
* @see com.epam.deltix.qsrv.hf.pub.md.RecordClassDescriptor RecordClassDescriptor
106-
* @return
106+
* @return RecordClassDescriptors for l1
107107
*/
108108
public RecordClassDescriptor[] level1Types() {
109109
return level1 != null ? level1 : EMPTY_RCDS;
@@ -116,7 +116,7 @@ public boolean level2() {
116116
/**
117117
*
118118
* @see com.epam.deltix.qsrv.hf.pub.md.RecordClassDescriptor RecordClassDescriptor
119-
* @return
119+
* @return RecordClassDescriptors for l2
120120
*/
121121
public RecordClassDescriptor[] level2Types() {
122122
return level2 != null ? level2 : EMPTY_RCDS;
@@ -133,7 +133,7 @@ public boolean custom(final Class type) {
133133
/**
134134
*
135135
* @see com.epam.deltix.qsrv.hf.pub.md.RecordClassDescriptor RecordClassDescriptor
136-
* @return
136+
* @return RecordClassDescriptors for custom types
137137
*/
138138
public RecordClassDescriptor[] customTypes() {
139139
return custom != null ? custom : EMPTY_RCDS;
@@ -153,7 +153,7 @@ public RecordClassDescriptor[] types() {
153153

154154
/**
155155
*
156-
* @return
156+
* @return true if empty
157157
*/
158158
public boolean isEmpty() {
159159
return !(trades() || level1() || level2() || custom());
@@ -177,95 +177,54 @@ public String toString() {
177177
}
178178
}
179179

180-
/**
181-
*
182-
* @param <S>
183-
*/
184180
public static class ModifiableOptions<S extends Options> extends Options {
185181
private ModifiableOptions() {
186182
}
187183

188-
/**
189-
*
190-
* @return
191-
*/
192184
@SuppressWarnings("unchecked")
193185
public S withTrades() {
194186
trades = DEFAULT_RCDS;
195187
return (S) this;
196188
}
197189

198-
/**
199-
*
200-
* @param tradesType
201-
* @return
202-
*/
203190
@SuppressWarnings("unchecked")
204191
public S withTrades(final RecordClassDescriptor... tradesType) {
205192
trades = tradesType;
206193
return (S) this;
207194
}
208195

209-
/**
210-
*
211-
* @return
212-
*/
213196
@SuppressWarnings("unchecked")
214197
public S withLevel1() {
215198
level1 = DEFAULT_RCDS;
216199
return (S) this;
217200
}
218201

219-
/**
220-
*
221-
* @param level1Types
222-
* @return
223-
*/
224202
@SuppressWarnings("unchecked")
225203
public S withLevel1(final RecordClassDescriptor... level1Types) {
226204
level1 = level1Types;
227205
return (S) this;
228206
}
229207

230-
/**
231-
*
232-
* @return
233-
*/
234208
@SuppressWarnings("unchecked")
235209
public S withLevel2() {
236210
level2 = DEFAULT_RCDS;
237211
return (S) this;
238212
}
239213

240-
/**
241-
*
242-
* @param level2Types
243-
* @return
244-
*/
245214
@SuppressWarnings("unchecked")
246215
public S withLevel2(final RecordClassDescriptor... level2Types) {
247216
level2 = level2Types;
248217
return (S) this;
249218
}
250219

251-
/**
252-
*
253-
* @param customTypes
254-
* @return
255-
*/
256220
@SuppressWarnings("unchecked")
257221
public S withCustom(final RecordClassDescriptor... customTypes) {
258222
custom = customTypes;
259223
return (S) this;
260224
}
261225

262-
/**
263-
*
264-
* @param customTypes
265-
* @return
266-
*/
267226
@SuppressWarnings("unchecked")
268-
public S withCustom(final Class... customTypes) {
227+
public S withCustom(final Class ... customTypes) {
269228
final Introspector introspector = introspector();
270229
custom = Arrays.stream(customTypes).
271230
map(c -> {
@@ -283,10 +242,6 @@ public S withCustom(final Class... customTypes) {
283242
*
284243
*/
285244
public static class Availability extends ModifiableOptions<Availability> {
286-
/**
287-
*
288-
* @return
289-
*/
290245
public MdModel build() {
291246
return new MdModel(this);
292247
}
@@ -296,10 +251,7 @@ public MdModel build() {
296251
*
297252
*/
298253
public class Selection extends ModifiableOptions<Selection> {
299-
/**
300-
*
301-
* @return
302-
*/
254+
303255
@Override
304256
public Selection withTrades() {
305257
if (!availability.trades()) {
@@ -308,10 +260,6 @@ public Selection withTrades() {
308260
return super.withTrades();
309261
}
310262

311-
/**
312-
*
313-
* @return
314-
*/
315263
@Override
316264
public Selection withLevel1() {
317265
if (!availability.level1()) {
@@ -320,10 +268,6 @@ public Selection withLevel1() {
320268
return super.withLevel1();
321269
}
322270

323-
/**
324-
*
325-
* @return
326-
*/
327271
@Override
328272
public Selection withLevel2() {
329273
if (!availability.level2()) {
@@ -332,8 +276,8 @@ public Selection withLevel2() {
332276
return super.withLevel2();
333277
}
334278

335-
public Selection withCustom(final Class... customTypes) {
336-
final Class[] unknown = Arrays.stream(customTypes)
279+
public Selection withCustom(final Class ... customTypes) {
280+
final Class<?>[] unknown = Arrays.stream(customTypes)
337281
.filter(c -> !availability.custom(c))
338282
.toArray(Class[]::new);
339283
if (unknown.length > 0) {
@@ -347,10 +291,6 @@ public Selection withCustom(final Class... customTypes) {
347291
return super.withCustom(customTypes);
348292
}
349293

350-
/**
351-
*
352-
* @return
353-
*/
354294
public Options build() {
355295
return new Options(
356296
tradesTypes(),
@@ -366,18 +306,10 @@ private MdModel(final Availability availability) {
366306
this.availability = availability;
367307
}
368308

369-
/**
370-
*
371-
* @return
372-
*/
373309
public Availability available() {
374310
return availability;
375311
}
376312

377-
/**
378-
*
379-
* @return
380-
*/
381313
public Selection select() {
382314
return new Selection();
383315
}

java/commons/src/main/java/com/epam/deltix/data/connectors/commons/MdModelEnum.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static void with(MdModel.ModifiableOptions options, MdModelEnum enumValue
2424
}
2525
}
2626

27-
public static void withCustom(MdModel.ModifiableOptions options, MdModel model, Class<?>... customTypes) {
27+
public static void withCustom(MdModel.ModifiableOptions options, MdModel model, Class<?> ... customTypes) {
2828
if (customTypes != null && customTypes.length > 0) {
2929
options.withCustom(customTypes);
3030
} else {

java/commons/src/main/java/com/epam/deltix/data/connectors/commons/SingleWsFeed.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -312,16 +312,15 @@ protected final void doClose() {
312312
protected void onClose() {};
313313

314314
/**
315-
*
316-
* @param jsonWriter
317-
* @param symbols
315+
* @param jsonWriter writer
316+
* @param symbols symbols to subscribe
318317
*/
319318
protected abstract void subscribe(JsonWriter jsonWriter, String... symbols);
320319

321320
/**
322-
*
323-
* @param data
324-
* @param last
321+
* @param data data
322+
* @param last is last portion
323+
* @param jsonWriter writer
325324
*/
326325
protected abstract void onJson(CharSequence data, boolean last, JsonWriter jsonWriter);
327326

java/commons/src/main/java/com/epam/deltix/data/connectors/commons/SingleWsRestFeed.java

+9-14
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,6 @@ protected final void doClose() {
337337
protected void onClose() {
338338
}
339339

340-
/**
341-
* @param relativeUrl
342-
*/
343-
344340
protected void getAsync(String id, String relativeUrl) {
345341
mgmtService.execute(() -> {
346342
if (state != STARTED_STATE) {
@@ -359,9 +355,6 @@ protected void getAsync(String id, String relativeUrl) {
359355
});
360356
}
361357

362-
/**
363-
* @param relativeUrl
364-
*/
365358
protected CharSequence post(String relativeUrl) {
366359
CharSequence response = null;
367360
String fullUrl = restUrl + relativeUrl;
@@ -382,25 +375,27 @@ protected CharSequence post(String relativeUrl) {
382375
}
383376

384377
/**
385-
* @param jsonWriter
386-
* @param symbols
378+
* @param jsonWriter writer
379+
* @param symbols list of symbols
387380
*/
388381
protected abstract void subscribe(JsonWriter jsonWriter, String... symbols);
389382

390383
/**
391-
* @param data
392-
* @param last
384+
* @param data data
385+
* @param last is last portion
386+
* @param jsonWriter writer
393387
*/
394388
protected abstract void onWsJson(CharSequence data, boolean last, JsonWriter jsonWriter);
395389

396390
/**
397-
* @param id
398-
* @param body
391+
* @param id id of element
392+
* @param body text
399393
*/
400394
protected abstract void onRestJson(String id, CharSequence body);
401395

402396
/**
403-
* @param wsUrl
397+
* @param wsUrl authentication address
398+
* @return authentication url with token
404399
*/
405400
protected abstract String authenticate(String wsUrl);
406401
}

java/commons/src/main/java/com/epam/deltix/data/connectors/commons/SymbolMapper.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
import java.util.stream.Collectors;
1010

1111
/**
12-
* <p>This class is thread-safe.
13-
* <p>Symbology for the symbols: "NAME_FOR_CONNECTOR[=NAME_FOR_TIMEBASE]". If a symbol name contains char '=',
12+
* <p>This class is thread-safe.</p>
13+
*
14+
* Symbology for the symbols: "NAME_FOR_CONNECTOR[=NAME_FOR_TIMEBASE]". If a symbol name contains char '=',
1415
* use escaping with the '\' character. For '\' use escaping '\\'. Examples:
1516
* <ul>
1617
* <li>BTC/USD - the data connector requests the vendor using the "BTC/USD" name and the same name writing the result data to TB</li>
1718
* <li>BTC-USD=BTC/USD - the data connector requests the vendor using the "BTC-USD" name and the "BTC/USD" name writing the result data to TB</li>
1819
* <li>BTC\=USD=BTC\\USD - the data connector requests the vendor using the "BTC=USD" name and the "BTC\USD" name writing the result data to TB</li>
1920
* </ul>
20-
* <p>
2121
*/
2222
public class SymbolMapper implements CloseableMessageOutputFactory {
2323
private final CharSequenceToObjectMap<String> mapping = new CharSequenceToObjectMap<>(); // guarded by itself

java/commons/src/main/java/com/epam/deltix/data/connectors/commons/annotations/Connector.java

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
/**
1414
* Data Connector name.
15+
*
16+
* @return name of the Data Connector
1517
*/
1618
String value() default "";
1719

java/commons/src/main/java/com/epam/deltix/data/connectors/commons/annotations/ConnectorSettings.java

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
/**
1616
* Data Connector name.
17+
* @return name of the Data Connector
1718
*/
1819
String value() default "";
1920

0 commit comments

Comments
 (0)