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

com.ca.apim.gateway.cagatewayconfig.GatewayDeveloperPluginConfig Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2018 CA. All rights reserved.
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

package com.ca.apim.gateway.cagatewayconfig;

import org.gradle.api.Project;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Optional;

import java.util.Map;

public class GatewayDeveloperPluginConfig {

    private final DirectoryProperty solutionDir;
    private Property targetFolderPath;
    private DirectoryProperty builtBundleDir;
    private DirectoryProperty builtEnvironmentBundleDir;
    private final Property detemplatizeDeploymentBundles;
    private final EnvironmentConfig envConfig;
    //for backward compatibility
    private final Property environmentConfig;

    private Property keepEncryptedSecrets;
    private final Property p12Passphrase;

    public GatewayDeveloperPluginConfig(Project project, EnvironmentConfig environmentConfig) {
        solutionDir = project.getLayout().directoryProperty();
        targetFolderPath = project.getObjects().property(String.class);
        builtBundleDir = project.getLayout().directoryProperty();
        builtEnvironmentBundleDir = project.getLayout().directoryProperty();
        detemplatizeDeploymentBundles = project.getObjects().property(Boolean.class);
        this.environmentConfig = project.getObjects().property(Map.class);
        this.envConfig = environmentConfig;

        keepEncryptedSecrets = project.getObjects().property(Boolean.class);
        p12Passphrase = project.getObjects().property(String.class);
    }

    DirectoryProperty getSolutionDir() {
        return solutionDir;
    }

    DirectoryProperty getBuiltBundleDir() {
        return builtBundleDir;
    }

    DirectoryProperty getBuiltEnvironmentBundleDir() {
        return builtEnvironmentBundleDir;
    }

    public Property getDetemplatizeDeploymentBundles() {
        return detemplatizeDeploymentBundles;
    }

    public EnvironmentConfig getEnvConfig() {
        return envConfig;
    }

    public Property getEnvironmentConfig() {
        return environmentConfig;
    }

    public Property getTargetFolderPath() {
        return targetFolderPath;
    }

    /**
     * Keep encrypted secrets or not
     * @return true for requesting the encrypted secrets to be persisted with the entity configuration
     */
    @Input
    @Optional
    public Property getKeepEncryptedSecrets() {
        return keepEncryptedSecrets;
    }

    /**
     * Passphrase used to protect the p12 key files
     * @return passphrase for p12 files
     */
    @Input
    @Optional
    public Property getP12Passphrase() {
        return p12Passphrase;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy