* Creates a NiFi Instance from the url and output port. * @param url http URL for NiFi instance * @param port Remote output port. * @Deprecated for API version 0.2 in favor of the following prototype * nifi_instance *create_instance(nifi_port const *port) { */
| 110 | * nifi_instance *create_instance(nifi_port const *port) { |
| 111 | */ |
| 112 | nifi_instance *create_instance_repo(const char *url, nifi_port *port, const char* const repo_type) { |
| 113 | // make sure that we have a thread safe way of initializing the content directory |
| 114 | DirectoryConfiguration::initialize(); |
| 115 | |
| 116 | // need reinterpret cast until we move to C for this module. |
| 117 | nifi_instance *instance = reinterpret_cast<nifi_instance*>(malloc(sizeof(nifi_instance))); |
| 118 | /** |
| 119 | * This API will gradually move away from C++, hence malloc is used for nifi_instance |
| 120 | * Since minifi::Instance is currently being used, then we need to use new in that case. |
| 121 | */ |
| 122 | instance->instance_ptr = new minifi::Instance(url, port->port_id, repo_type); |
| 123 | |
| 124 | NULL_CHECK(nullptr, instance->instance_ptr); |
| 125 | |
| 126 | // may have to translate port ID here in the future |
| 127 | // need reinterpret cast until we move to C for this module. |
| 128 | char* port_id = reinterpret_cast<char*>(malloc(strlen(port->port_id) + 1)); |
| 129 | std::strcpy(port_id, port->port_id); |
| 130 | instance->port.port_id = port_id; |
| 131 | return instance; |
| 132 | } |
| 133 | |
| 134 | standalone_processor * create_processor(const char *name, nifi_instance * instance) { |
| 135 | NULL_CHECK(nullptr, name); |
no outgoing calls