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

software.amazon.awsconstructs.services.kinesisfirehoses3kinesisanalytics.$Module Maven / Gradle / Ivy

Go to download

CDK constructs for defining an interaction between an Amazon Kinesis Data Firehose delivery stream and (1) an Amazon S3 bucket, and (2) an Amazon Kinesis Data Analytics application.

There is a newer version: 2.45.0
Show newest version
package software.amazon.awsconstructs.services.kinesisfirehoses3kinesisanalytics;

import static java.util.Arrays.asList;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.Reader;
import java.io.UncheckedIOException;

import java.nio.charset.StandardCharsets;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import software.amazon.jsii.JsiiModule;

public final class $Module extends JsiiModule {
    private static final Map MODULE_TYPES = load();

    private static Map load() {
        final Map result = new HashMap<>();
        final ClassLoader cl = $Module.class.getClassLoader();
        try (final InputStream is = cl.getResourceAsStream("software/amazon/awsconstructs/services/kinesisfirehoses3kinesisanalytics/$Module.txt");
             final Reader rd = new InputStreamReader(is, StandardCharsets.UTF_8);
             final BufferedReader br = new BufferedReader(rd)) {
            br.lines()
              .filter(line -> !line.trim().isEmpty())
              .forEach(line ->  {
                final String[] parts = line.split("=", 2);
                final String fqn = parts[0];
                final String className = parts[1];
                result.put(fqn, className);
            });
        }
        catch (final IOException exception) {
            throw new UncheckedIOException(exception);
        }
        return result;
    }

    private final Map> cache = new HashMap<>();

    public $Module() {
        super("@aws-solutions-constructs/aws-kinesisfirehose-s3-and-kinesisanalytics", "1.50.0", $Module.class, "[email protected]");
    }

    @Override
    public List> getDependencies() {
        return asList(software.amazon.awscdk.services.iam.$Module.class, software.amazon.awscdk.services.kinesis.$Module.class, software.amazon.awscdk.services.kinesisanalytics.$Module.class, software.amazon.awscdk.services.kinesisfirehose.$Module.class, software.amazon.awscdk.services.s3.$Module.class, software.amazon.awscdk.core.$Module.class, software.amazon.awsconstructs.services.kinesisfirehoses3.$Module.class, software.amazon.awsconstructs.services.core.$Module.class, software.constructs.$Module.class);
    }

    @Override
    protected Class resolveClass(final String fqn) throws ClassNotFoundException {
        if (!MODULE_TYPES.containsKey(fqn)) {
            throw new ClassNotFoundException("Unknown JSII type: " + fqn);
        }
        String className = MODULE_TYPES.get(fqn);
        if (!this.cache.containsKey(className)) {
            this.cache.put(className, this.findClass(className));
        }
        return this.cache.get(className);
    }

    private Class findClass(final String binaryName) {
        try {
            return Class.forName(binaryName);
        }
        catch (final ClassNotFoundException exception) {
            throw new RuntimeException(exception);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy