MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / listConnections

Function listConnections

controller/Controller.h:214–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214int listConnections(std::unique_ptr<minifi::io::Socket> socket, std::ostream &out, bool show_header = true) {
215 socket->initialize();
216 minifi::io::BufferStream stream;
217 uint8_t op = minifi::c2::Operation::DESCRIBE;
218 stream.write(&op, 1);
219 stream.write("connections");
220 if (socket->write(const_cast<uint8_t*>(stream.getBuffer()), gsl::narrow<int>(stream.size())) < 0) {
221 return -1;
222 }
223 uint16_t responses = 0;
224 socket->read(&op, 1);
225 socket->read(responses);
226 if (show_header)
227 out << "Connection Names:" << std::endl;
228
229 for (int i = 0; i < responses; i++) {
230 std::string name;
231 socket->read(name, false);
232 out << name << std::endl;
233 }
234 return 0;
235}
236
237std::shared_ptr<core::controller::ControllerService> getControllerService(const std::shared_ptr<minifi::Configure> &configuration, const std::string &service_name) {
238

Callers 1

mainFunction · 0.85

Calls 5

initializeMethod · 0.45
writeMethod · 0.45
getBufferMethod · 0.45
sizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected