Search in sources :

Example 1 with TgzArtifact

use of io.strimzi.api.kafka.model.connect.build.TgzArtifact in project strimzi-kafka-operator by strimzi.

the class KafkaConnectDockerfile method addPlugin.

/**
 * Adds a particular connector plugin to the container image. It will go through the individual artifacts and add
 * them one by one depending on their type.
 *
 * @param writer    Writer for printing the Docker commands
 * @param plugin    A single plugin which should be added to the new container image
 */
private void addPlugin(PrintWriter writer, Plugin plugin) {
    printSectionHeader(writer, "Connector plugin " + plugin.getName());
    String connectorPath = BASE_PLUGIN_PATH + plugin.getName();
    for (Artifact art : plugin.getArtifacts()) {
        if (art instanceof JarArtifact) {
            addJarArtifact(writer, connectorPath, (JarArtifact) art);
        } else if (art instanceof TgzArtifact) {
            addTgzArtifact(writer, connectorPath, (TgzArtifact) art);
        } else if (art instanceof ZipArtifact) {
            addZipArtifact(writer, connectorPath, (ZipArtifact) art);
        } else if (art instanceof MavenArtifact) {
            addMavenArtifact(writer, plugin.getName(), (MavenArtifact) art);
        } else if (art instanceof OtherArtifact) {
            addOtherArtifact(writer, connectorPath, (OtherArtifact) art);
        } else {
            throw new RuntimeException("Unexpected artifact type " + art.getType());
        }
    }
}
Also used : ZipArtifact(io.strimzi.api.kafka.model.connect.build.ZipArtifact) OtherArtifact(io.strimzi.api.kafka.model.connect.build.OtherArtifact) JarArtifact(io.strimzi.api.kafka.model.connect.build.JarArtifact) TgzArtifact(io.strimzi.api.kafka.model.connect.build.TgzArtifact) MavenArtifact(io.strimzi.api.kafka.model.connect.build.MavenArtifact) Artifact(io.strimzi.api.kafka.model.connect.build.Artifact) DownloadableArtifact(io.strimzi.api.kafka.model.connect.build.DownloadableArtifact) ZipArtifact(io.strimzi.api.kafka.model.connect.build.ZipArtifact) OtherArtifact(io.strimzi.api.kafka.model.connect.build.OtherArtifact) TgzArtifact(io.strimzi.api.kafka.model.connect.build.TgzArtifact) MavenArtifact(io.strimzi.api.kafka.model.connect.build.MavenArtifact) JarArtifact(io.strimzi.api.kafka.model.connect.build.JarArtifact)

Example 2 with TgzArtifact

use of io.strimzi.api.kafka.model.connect.build.TgzArtifact in project strimzi by strimzi.

the class KafkaConnectDockerfile method addPlugin.

/**
 * Adds a particular connector plugin to the container image. It will go through the individual artifacts and add
 * them one by one depending on their type.
 *
 * @param writer    Writer for printing the Docker commands
 * @param plugin    A single plugin which should be added to the new container image
 */
private void addPlugin(PrintWriter writer, Plugin plugin) {
    printSectionHeader(writer, "Connector plugin " + plugin.getName());
    String connectorPath = BASE_PLUGIN_PATH + plugin.getName();
    for (Artifact art : plugin.getArtifacts()) {
        if (art instanceof JarArtifact) {
            addJarArtifact(writer, connectorPath, (JarArtifact) art);
        } else if (art instanceof TgzArtifact) {
            addTgzArtifact(writer, connectorPath, (TgzArtifact) art);
        } else if (art instanceof ZipArtifact) {
            addZipArtifact(writer, connectorPath, (ZipArtifact) art);
        } else if (art instanceof MavenArtifact) {
            addMavenArtifact(writer, plugin.getName(), (MavenArtifact) art);
        } else if (art instanceof OtherArtifact) {
            addOtherArtifact(writer, connectorPath, (OtherArtifact) art);
        } else {
            throw new RuntimeException("Unexpected artifact type " + art.getType());
        }
    }
}
Also used : ZipArtifact(io.strimzi.api.kafka.model.connect.build.ZipArtifact) OtherArtifact(io.strimzi.api.kafka.model.connect.build.OtherArtifact) JarArtifact(io.strimzi.api.kafka.model.connect.build.JarArtifact) TgzArtifact(io.strimzi.api.kafka.model.connect.build.TgzArtifact) MavenArtifact(io.strimzi.api.kafka.model.connect.build.MavenArtifact) Artifact(io.strimzi.api.kafka.model.connect.build.Artifact) DownloadableArtifact(io.strimzi.api.kafka.model.connect.build.DownloadableArtifact) ZipArtifact(io.strimzi.api.kafka.model.connect.build.ZipArtifact) OtherArtifact(io.strimzi.api.kafka.model.connect.build.OtherArtifact) TgzArtifact(io.strimzi.api.kafka.model.connect.build.TgzArtifact) MavenArtifact(io.strimzi.api.kafka.model.connect.build.MavenArtifact) JarArtifact(io.strimzi.api.kafka.model.connect.build.JarArtifact)

Aggregations

Artifact (io.strimzi.api.kafka.model.connect.build.Artifact)2 DownloadableArtifact (io.strimzi.api.kafka.model.connect.build.DownloadableArtifact)2 JarArtifact (io.strimzi.api.kafka.model.connect.build.JarArtifact)2 MavenArtifact (io.strimzi.api.kafka.model.connect.build.MavenArtifact)2 OtherArtifact (io.strimzi.api.kafka.model.connect.build.OtherArtifact)2 TgzArtifact (io.strimzi.api.kafka.model.connect.build.TgzArtifact)2 ZipArtifact (io.strimzi.api.kafka.model.connect.build.ZipArtifact)2