| 197 | } |
| 198 | |
| 199 | void S3Processor::onSchedule(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory) { |
| 200 | std::string value; |
| 201 | if (!context->getProperty(Bucket.getName(), value) || value.empty()) { |
| 202 | throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Bucket property missing or invalid"); |
| 203 | } |
| 204 | |
| 205 | if (!context->getProperty(Region.getName(), value) || value.empty() || REGIONS.count(value) == 0) { |
| 206 | throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Region property missing or invalid"); |
| 207 | } |
| 208 | s3_wrapper_->setRegion(value); |
| 209 | logger_->log_debug("S3Processor: Region [%s]", value); |
| 210 | |
| 211 | uint64_t timeout_val; |
| 212 | if (context->getProperty(CommunicationsTimeout.getName(), value) && !value.empty() && core::Property::getTimeMSFromString(value, timeout_val)) { |
| 213 | s3_wrapper_->setTimeout(timeout_val); |
| 214 | logger_->log_debug("S3Processor: Communications Timeout [%d]", timeout_val); |
| 215 | } else { |
| 216 | throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Communications Timeout missing or invalid"); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | minifi::utils::optional<CommonProperties> S3Processor::getCommonELSupportedProperties( |
| 221 | const std::shared_ptr<core::ProcessContext> &context, |
nothing calls this directly
no test coverage detected