blob: a1b3d2f8c881f5aaef4eaf7a8414356fd9a9e2a9 [file] [log] [blame]
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <array>
#include <string_view>
#include <utility>
#include "core/ProcessorImpl.h"
#include "agent/agent_docs.h"
#include "core/PropertyDefinitionBuilder.h"
namespace org::apache::nifi::minifi::test {
class DummyProcessor : public minifi::core::ProcessorImpl {
public:
using ProcessorImpl::ProcessorImpl;
explicit DummyProcessor(std::string_view name)
: ProcessorImpl{minifi::core::ProcessorMetadata{
.uuid = minifi::utils::IdGenerator::getIdGenerator()->generate(),
.name = std::string{name},
.logger = minifi::core::logging::LoggerFactory<DummyProcessor>::getLogger()
}} {}
static constexpr const char* Description = "A processor that does nothing.";
static constexpr auto SimpleProperty = core::PropertyDefinitionBuilder<>::createProperty("Simple Property")
.withDescription("Just a simple string property")
.build();
static constexpr auto SensitiveProperty = core::PropertyDefinitionBuilder<>::createProperty("Sensitive Property")
.withDescription("Sensitive property")
.isSensitive(true)
.build();
static constexpr auto Properties = std::array<core::PropertyReference, 2>{SimpleProperty, SensitiveProperty};
static constexpr core::RelationshipDefinition Success{"success", "Success relationship"};
static constexpr auto Relationships = std::array{Success};
static constexpr bool SupportsDynamicProperties = true;
static constexpr bool SupportsDynamicRelationships = false;
static constexpr core::annotation::Input InputRequirement = core::annotation::Input::INPUT_ALLOWED;
static constexpr bool IsSingleThreaded = false;
ADD_COMMON_VIRTUAL_FUNCTIONS_FOR_PROCESSORS
void initialize() override { setSupportedProperties(Properties); }
};
} // namespace org::apache::nifi::minifi::test