public SensitivePropsSchema(Map map) { key = getOptionalKeyAsType(map, SENSITIVE_PROPS_KEY_KEY, String.class, SENSITIVE_PROPS_KEY, ""); algorithm = getOptionalKeyAsType(map, SENSITIVE_PROPS_ALGORITHM_KEY, String.class, SENSITIVE_PROPS_KEY, DEFAULT_ALGORITHM); provider = getOptionalKeyAsType(map, SENSITIVE_PROPS_PROVIDER_KEY, String.class, SENSITIVE_PROPS_KEY, DEFAULT_PROVIDER); }
public FlowFileRepositorySchema(Map map) { partitions = getOptionalKeyAsType(map, PARTITIONS_KEY, Number.class, FLOWFILE_REPO_KEY, DEFAULT_PARTITIONS); checkpointInterval = getOptionalKeyAsType(map, CHECKPOINT_INTERVAL_KEY, String.class, FLOWFILE_REPO_KEY, DEFAULT_CHECKPOINT_INTERVAL); alwaysSync = getOptionalKeyAsType(map, ALWAYS_SYNC_KEY, Boolean.class, FLOWFILE_REPO_KEY, DEFAULT_ALWAYS_SYNC); swapProperties = getMapAsType(map, SWAP_PROPS_KEY, SwapSchema.class, FLOWFILE_REPO_KEY, false); addIssuesIfNotNull(swapProperties); }
public ControllerServiceSchema(Map map) { super(map, "Controller Service(id: {id}, name: {name})"); String wrapperName = getWrapperName(); serviceClass = getRequiredKeyAsType(map, TYPE_KEY, String.class, wrapperName); properties = getOptionalKeyAsType(map, PROPERTIES_KEY, Map.class, wrapperName, DEFAULT_PROPERTIES); annotationData = getOptionalKeyAsType(map, ANNOTATION_DATA_KEY, String.class, wrapperName, ""); }
@Test public void testVersion1() throws IOException, SchemaLoaderException { ConfigSchema configSchema = getConfigSchema(c2Url + "?class=raspi3&version=1"); assertEquals(3, configSchema.getVersion()); assertEquals("raspi3.v1", configSchema.getFlowControllerProperties().getName()); }
protected static void getRemotePortParentIdMap(ProcessGroupSchema processGroupSchema, Map<String, String> output, Function<RemoteProcessGroupSchema, List<RemotePortSchema>> getPortsFunction) { for (RemoteProcessGroupSchema remoteProcessGroupSchema : processGroupSchema.getRemoteProcessGroups()) { for (RemotePortSchema remotePortSchema : getPortsFunction.apply(remoteProcessGroupSchema)) { output.put(remotePortSchema.getId(), remoteProcessGroupSchema.getId()); } } processGroupSchema.getProcessGroupSchemas().forEach(p -> getRemotePortParentIdMap(p, output, getPortsFunction)); }
public ProcessorSchema(Map map) { super(map, "Processor(id: {id}, name: {name})"); String wrapperName = getWrapperName(); processorClass = getRequiredKeyAsType(map, CLASS_KEY, String.class, wrapperName); schedulingStrategy = getRequiredKeyAsType(map, SCHEDULING_STRATEGY_KEY, String.class, wrapperName); if (schedulingStrategy != null && !isSchedulingStrategy(schedulingStrategy)) { addValidationIssue(SCHEDULING_STRATEGY_KEY, wrapperName, IT_IS_NOT_A_VALID_SCHEDULING_STRATEGY); } schedulingPeriod = getRequiredKeyAsType(map, SCHEDULING_PERIOD_KEY, String.class, wrapperName); maxConcurrentTasks = getOptionalKeyAsType(map, MAX_CONCURRENT_TASKS_KEY, Number.class, wrapperName, DEFAULT_MAX_CONCURRENT_TASKS); penalizationPeriod = getOptionalKeyAsType(map, PENALIZATION_PERIOD_KEY, String.class, wrapperName, DEFAULT_PENALIZATION_PERIOD); yieldPeriod = getOptionalKeyAsType(map, YIELD_PERIOD_KEY, String.class, wrapperName, DEFAULT_YIELD_DURATION); runDurationNanos = getOptionalKeyAsType(map, RUN_DURATION_NANOS_KEY, Number.class, wrapperName, DEFAULT_RUN_DURATION_NANOS); autoTerminatedRelationshipsList = getOptionalKeyAsType(map, AUTO_TERMINATED_RELATIONSHIPS_LIST_KEY, List.class, wrapperName, DEFAULT_AUTO_TERMINATED_RELATIONSHIPS_LIST); properties = getOptionalKeyAsType(map, PROPERTIES_KEY, Map.class, wrapperName, DEFAULT_PROPERTIES); annotationData = getOptionalKeyAsType(map, ANNOTATION_DATA_KEY, String.class, wrapperName, ""); }
@Test public void testUser2() throws Exception { SSLContext sslContext = loadSslContext("user2"); assertReturnCode("", sslContext, 403); assertReturnCode("?class=raspi2", sslContext, 403); ConfigSchema configSchema = assertReturnCode("?class=raspi3", sslContext, 200); assertEquals("raspi3.v2", configSchema.getFlowControllerProperties().getName()); }
private static void addProcessGroups(ProcessGroupSchema processGroupSchema, List<ProcessGroupSchema> result) { result.add(processGroupSchema); processGroupSchema.getProcessGroupSchemas().forEach(p -> addProcessGroups(p, result)); }
public RemotePortSchema(Map map) { super(map, "RemoteInputPort(id: {id}, name: {name})"); String wrapperName = getWrapperName(); comment = getOptionalKeyAsType(map, COMMENT_KEY, String.class, wrapperName, DEFAULT_COMMENT); maxConcurrentTasks = getOptionalKeyAsType(map, MAX_CONCURRENT_TASKS_KEY, Number.class, wrapperName, DEFAULT_MAX_CONCURRENT_TASKS); useCompression = getOptionalKeyAsType(map, USE_COMPRESSION_KEY, Boolean.class, wrapperName, DEFAULT_USE_COMPRESSION); }
public FlowControllerSchema(Map map) { name = getRequiredKeyAsType(map, NAME_KEY, String.class, FLOW_CONTROLLER_PROPS_KEY); comment = getOptionalKeyAsType(map, COMMENT_KEY, String.class, FLOW_CONTROLLER_PROPS_KEY, ""); }
public ProvenanceRepositorySchema(Map map) { provenanceRepoRolloverTime = getOptionalKeyAsType(map, PROVENANCE_REPO_ROLLOVER_TIME_KEY, String.class, PROVENANCE_REPO_KEY, DEFAULT_PROVENANCE_ROLLOVER_TIME); provenanceRepository = getOptionalKeyAsType(map, PROVENANCE_REPOSITORY_KEY, String.class, PROVENANCE_REPO_KEY, DEFAULT_PROVENANCE_REPOSITORY); }
public SwapSchema(Map map) { threshold = getOptionalKeyAsType(map, THRESHOLD_KEY, Number.class, SWAP_PROPS_KEY, DEFAULT_THRESHOLD); inPeriod = getOptionalKeyAsType(map, IN_PERIOD_KEY, String.class, SWAP_PROPS_KEY, DEFAULT_IN_PERIOD); inThreads = getOptionalKeyAsType(map, IN_THREADS_KEY, Number.class, SWAP_PROPS_KEY, DEFAULT_IN_THREADS); outPeriod = getOptionalKeyAsType(map, OUT_PERIOD_KEY, String.class, SWAP_PROPS_KEY, DEFAULT_OUT_PERIOD); outThreads = getOptionalKeyAsType(map, OUT_THREADS_KEY, Number.class, SWAP_PROPS_KEY, DEFAULT_OUT_THREADS); }
public ContentRepositorySchema(Map map) { contentClaimMaxAppendableSize = getOptionalKeyAsType(map, CONTENT_CLAIM_MAX_APPENDABLE_SIZE_KEY, String.class, CONTENT_REPO_KEY, DEFAULT_CONTENT_CLAIM_MAX_APPENDABLE_SIZE); contentClaimMaxFlowFiles = getOptionalKeyAsType(map, CONTENT_CLAIM_MAX_FLOW_FILES_KEY, Number.class, CONTENT_REPO_KEY, DEFAULT_CONTENT_CLAIM_MAX_FLOW_FILES); alwaysSync = getOptionalKeyAsType(map, ALWAYS_SYNC_KEY, Boolean.class, CONTENT_REPO_KEY, DEFAULT_ALWAYS_SYNC); }
@Override protected String getId(Map map, String wrapperName) { return getOptionalKeyAsType(map, ID_KEY, String.class, wrapperName, ID_DEFAULT); }
public ComponentStatusRepositorySchema(Map map) { bufferSize = getOptionalKeyAsType(map, BUFFER_SIZE_KEY, Number.class, COMPONENT_STATUS_REPO_KEY, DEFAULT_BUFFER_SIZE); snapshotFrequency = getOptionalKeyAsType(map, SNAPSHOT_FREQUENCY_KEY, String.class, COMPONENT_STATUS_REPO_KEY, DEFAULT_SNAPSHOT_FREQUENCY); }
public CorePropertiesSchema(Map map) { flowControllerGracefulShutdownPeriod = getOptionalKeyAsType(map, FLOW_CONTROLLER_SHUTDOWN_PERIOD_KEY, String.class, CORE_PROPS_KEY, DEFAULT_FLOW_CONTROLLER_GRACEFUL_SHUTDOWN_PERIOD); flowServiceWriteDelayInterval = getOptionalKeyAsType(map, FLOW_SERVICE_WRITE_DELAY_INTERVAL_KEY, String.class, CORE_PROPS_KEY, DEFAULT_FLOW_SERVICE_WRITE_DELAY_INTERVAL); administrativeYieldDuration = getOptionalKeyAsType(map, ADMINISTRATIVE_YIELD_DURATION_KEY, String.class, CORE_PROPS_KEY, DEFAULT_ADMINISTRATIVE_YIELD_DURATION); boredYieldDuration = getOptionalKeyAsType(map, BORED_YIELD_DURATION_KEY, String.class, CORE_PROPS_KEY, DEFAULT_BORED_YIELD_DURATION); maxConcurrentThreads = getOptionalKeyAsType(map, MAX_CONCURRENT_THREADS_KEY, Number.class, CORE_PROPS_KEY, DEFAULT_MAX_CONCURRENT_THREADS); variableRegistryProperties = getOptionalKeyAsType(map, VARIABLE_REGISTRY_PROPERTIES_KEY, String.class, CORE_PROPS_KEY, DEFAULT_VARIABLE_REGISTRY_PROPERTIES); }
public SecurityPropertiesSchema() { sensitiveProps = new SensitivePropsSchema(); }
public FlowFileRepositorySchema() { swapProperties = new SwapSchema(); }
public static List<ProcessGroupSchema> getAllProcessGroups(ProcessGroupSchema processGroupSchema) { List<ProcessGroupSchema> result = new ArrayList<>(); addProcessGroups(processGroupSchema, result); return result; }
@Test public void testVersion2() throws IOException, SchemaLoaderException { ConfigSchema configSchema = getConfigSchema(c2Url + "?class=raspi3&version=2"); assertEquals(3, configSchema.getVersion()); assertEquals("raspi3.v2", configSchema.getFlowControllerProperties().getName()); }