use of org.apache.nifi.toolkit.cli.impl.result.writer.Table in project nifi by apache.
the class BucketsResult method writeSimpleResult.
@Override
protected void writeSimpleResult(final PrintStream output) {
if (buckets.isEmpty()) {
return;
}
final Table table = new Table.Builder().column("#", 3, 3, false).column("Name", 20, 36, true).column("Id", 36, 36, false).column("Description", 11, 40, true).build();
for (int i = 0; i < buckets.size(); ++i) {
final Bucket bucket = buckets.get(i);
table.addRow(String.valueOf(i + 1), bucket.getName(), bucket.getIdentifier(), bucket.getDescription());
}
final TableWriter tableWriter = new DynamicTableWriter();
tableWriter.write(table, output);
}
use of org.apache.nifi.toolkit.cli.impl.result.writer.Table in project nifi by apache.
the class VersionControlInfoResult method writeSimpleResult.
@Override
protected void writeSimpleResult(final PrintStream output) {
final VersionControlInformationDTO dto = versionControlInformationEntity.getVersionControlInformation();
if (dto == null) {
return;
}
final Table table = new Table.Builder().column("Registry", 20, 30, true).column("Bucket", 20, 30, true).column("Flow", 20, 30, true).column("Ver", 3, 3, false).build();
table.addRow(dto.getRegistryName(), dto.getBucketName(), dto.getFlowName(), String.valueOf(dto.getVersion()));
final TableWriter tableWriter = new DynamicTableWriter();
tableWriter.write(table, output);
}
use of org.apache.nifi.toolkit.cli.impl.result.writer.Table in project nifi by apache.
the class VersionedFlowsResult method writeSimpleResult.
@Override
protected void writeSimpleResult(PrintStream output) {
if (versionedFlows.isEmpty()) {
return;
}
final Table table = new Table.Builder().column("#", 3, 3, false).column("Name", 20, 36, true).column("Id", 36, 36, false).column("Description", 11, 40, true).build();
for (int i = 0; i < versionedFlows.size(); ++i) {
final VersionedFlow flow = versionedFlows.get(i);
table.addRow(String.valueOf(i + 1), flow.getName(), flow.getIdentifier(), flow.getDescription());
}
final TableWriter tableWriter = new DynamicTableWriter();
tableWriter.write(table, output);
}
use of org.apache.nifi.toolkit.cli.impl.result.writer.Table in project nifi by apache.
the class ProcessGroupsResult method writeSimpleResult.
@Override
protected void writeSimpleResult(final PrintStream output) {
final Table table = new Table.Builder().column("#", 3, 3, false).column("Name", 20, 36, true).column("Id", 36, 36, false).column("Running", 7, 7, false).column("Stopped", 7, 7, false).column("Disabled", 8, 8, false).column("Invalid", 7, 7, false).build();
for (int i = 0; i < processGroups.size(); i++) {
final ProcessGroupDTO dto = processGroups.get(i);
table.addRow(String.valueOf(i + 1), dto.getName(), dto.getId(), String.valueOf(dto.getRunningCount()), String.valueOf(dto.getStoppedCount()), String.valueOf(dto.getDisabledCount()), String.valueOf(dto.getInvalidCount()));
}
final TableWriter tableWriter = new DynamicTableWriter();
tableWriter.write(table, output);
}
use of org.apache.nifi.toolkit.cli.impl.result.writer.Table in project nifi by apache.
the class RegistryClientsResult method writeSimpleResult.
@Override
protected void writeSimpleResult(final PrintStream output) {
final Set<RegistryClientEntity> clients = registryClients.getRegistries();
if (clients == null || clients.isEmpty()) {
return;
}
final List<RegistryDTO> registries = clients.stream().map(RegistryClientEntity::getComponent).sorted(Comparator.comparing(RegistryDTO::getName)).collect(Collectors.toList());
final Table table = new Table.Builder().column("#", 3, 3, false).column("Name", 20, 36, true).column("Id", 36, 36, false).column("Uri", 3, Integer.MAX_VALUE, false).build();
for (int i = 0; i < registries.size(); i++) {
RegistryDTO r = registries.get(i);
table.addRow("" + (i + 1), r.getName(), r.getId(), r.getUri());
}
final TableWriter tableWriter = new DynamicTableWriter();
tableWriter.write(table, output);
}
Aggregations