All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.platform.operation.internal.cpf.builder.CreatePDFContentAnalyzerRequestsDtoBuilder Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2019 Adobe
 * All Rights Reserved.
 *
 * NOTICE: Adobe permits you to use, modify, and distribute this file in
 * accordance with the terms of the Adobe license agreement accompanying
 * it. If you have received this file from a source other than Adobe,
 * then your use, modification, or distribution of it requires the prior
 * written permission of Adobe.
 */

package com.adobe.platform.operation.internal.cpf.builder;

import com.adobe.platform.operation.internal.GlobalConfig;
import com.adobe.platform.operation.internal.cpf.context.ContentAnalyzerRequestBuilderContext;
import com.adobe.platform.operation.internal.cpf.dto.request.ContentAnalyzerRequestsDto;

public class CreatePDFContentAnalyzerRequestsDtoBuilder {

    private ContentAnalyzerRequestBuilderContext contentAnalyzerRequestBuilderContext;

    public CreatePDFContentAnalyzerRequestsDtoBuilder(ContentAnalyzerRequestBuilderContext contentAnalyzerRequestBuilderContext) {
        this.contentAnalyzerRequestBuilderContext = contentAnalyzerRequestBuilderContext;
    }

    public ContentAnalyzerRequestsDto build() {
        ContentAnalyzerRequestsDto contentAnalyzerRequestsDto = new ContentAnalyzerRequestsDto();

        contentAnalyzerRequestBuilderContext.setExecutionInfo(GlobalConfig
                .getV2Property(PropertyKeys.EXECUTION_INFO_CONFIG_KEY));

        contentAnalyzerRequestsDto.setName(GlobalConfig
                .getV2Property(PropertyKeys.NAME_CONFIG_KEY));
        contentAnalyzerRequestsDto.setInvocationMode(GlobalConfig
                .getV2Property(PropertyKeys.INVOCATION_MODE_CONFIG_KEY));
        contentAnalyzerRequestsDto.setGetInvocationbatch(Boolean.parseBoolean(GlobalConfig
                .getV2Property(PropertyKeys.INVOCATION_BATCH_CONFIG_KEY)));
        contentAnalyzerRequestsDto.setInResponse(Boolean.parseBoolean(GlobalConfig
                .getV2Property(PropertyKeys.IN_RESPONSE_CONFIG_KEY)));

        EnginesDtoBuilder enginesDtoBuilder = new EnginesDtoBuilder(contentAnalyzerRequestBuilderContext);
        contentAnalyzerRequestsDto.setEngines(enginesDtoBuilder.build());

        return contentAnalyzerRequestsDto;
    }

    private static class PropertyKeys {
        private static final String NAME_CONFIG_KEY = "v2.createPdf.name";
        private static final String INVOCATION_MODE_CONFIG_KEY = "v2.createPdf.invocation_mode";
        private static final String INVOCATION_BATCH_CONFIG_KEY = "v2.createPdf.invocation_batch";
        private static final String IN_RESPONSE_CONFIG_KEY = "v2.createPdf.in_response";
        private static final String EXECUTION_INFO_CONFIG_KEY = "v2.createPdf.engines.execution_info.engine";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy