public List getFunctionConfs()

in src/main/java/com/awslabs/aws/greengrass/provisioner/implementations/helpers/BasicDeploymentHelper.java [1165:1217]


    public List<FunctionConf> getFunctionConfs(DeploymentConf deploymentConf, FunctionIsolationMode defaultFunctionIsolationMode, Config defaultConfig) {
        List<FunctionConf> functionConfs = functionHelper.getFunctionConfObjects(defaultConfig, deploymentConf, defaultFunctionIsolationMode);

        // Find Python functions that may not have had their language updated, this should never happen
        Predicate<FunctionConf> legacyPythonPredicate = functionConf -> functionConf.getLanguage().equals(Language.Python);

        List<FunctionConf> legacyPythonFunctions = functionConfs.stream()
                .filter(legacyPythonPredicate)
                .collect(Collectors.toList());

        if (legacyPythonFunctions.size() != 0) {
            log.error("Some Python functions do not have a Python version specified, this should never happen!");
            legacyPythonFunctions.stream()
                    .map(FunctionConf::getFunctionName)
                    .map(FunctionName::getName)
                    .forEach(log::error);
            throw new UnsupportedOperationException();
        }

        // Find Node functions that may not have had their language updated, this should never happen
        Predicate<FunctionConf> legacyNodePredicate = functionConf -> functionConf.getLanguage().equals(Language.Node);

        List<FunctionConf> legacyNodeFunctions = functionConfs.stream()
                .filter(legacyNodePredicate)
                .collect(Collectors.toList());

        if (legacyNodeFunctions.size() != 0) {
            log.error("Some Node functions do not have a Node version specified, this should never happen!");
            legacyNodeFunctions.stream()
                    .map(FunctionConf::getFunctionName)
                    .map(FunctionName::getName)
                    .forEach(log::error);
            throw new UnsupportedOperationException();
        }

        // Find Java functions that may not have had their language updated, this should never happen
        Predicate<FunctionConf> legacyJavaPredicate = functionConf -> functionConf.getLanguage().equals(Language.Java);

        List<FunctionConf> legacyJavaFunctions = functionConfs.stream()
                .filter(legacyJavaPredicate)
                .collect(Collectors.toList());

        if (legacyJavaFunctions.size() != 0) {
            log.error("Some Java functions do not have a Java version specified, this should never happen!");
            legacyJavaFunctions.stream()
                    .map(FunctionConf::getFunctionName)
                    .map(FunctionName::getName)
                    .forEach(log::error);
            throw new UnsupportedOperationException();
        }

        return functionConfs;
    }