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

org.wildfly.glow.ScanResults Maven / Gradle / Ivy

The newest version!
/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2023 Red Hat, Inc., and individual contributors
 * as indicated by the @author tags.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.wildfly.glow;

import java.nio.file.Path;
import java.util.List;
import org.wildfly.glow.error.ErrorIdentificationSession;

import java.util.Map;
import java.util.Set;
import org.jboss.galleon.api.Provisioning;
import org.jboss.galleon.api.config.GalleonProvisioningConfig;
import org.jboss.galleon.universe.FeaturePackLocation.FPID;
import org.jboss.galleon.universe.FeaturePackLocation.ProducerSpec;
import org.wildfly.channel.Channel;

public class ScanResults implements AutoCloseable {

    private final GlowSession glowSession;
    private final Set discoveredLayers;
    private final Set excludedLayers;
    private final Layer baseLayer;
    private final Set decorators;
    private final Set metadataOnlyLayers;
    private final Provisioning provisioning;
    private final GalleonProvisioningConfig config;
    private final ErrorIdentificationSession errorSession;
    private final Map disabledAddOns;
    private final Set enabledAddOns;
    private final Suggestions suggestions;
    private final Set excludedPackages;
    private final Map> excludedFeatures;
    private final Map fpVersions;
    private final List channels;
    ScanResults(GlowSession glowSession,
            Set discoveredLayers,
            Set excludedLayers,
            Layer baseLayer,
            Set decorators,
            Set metadataOnlyLayers,
            Provisioning provisioning,
            GalleonProvisioningConfig config,
            Set enabledAddOns,
            Map disabledAddOns,
            Suggestions suggestions,
            ErrorIdentificationSession errorSession,
            Set excludedPackages,
            Map> excludedFeatures,
            Map fpVersions,
            List channels) {
        this.glowSession = glowSession;
        this.discoveredLayers = discoveredLayers;
        this.excludedLayers = excludedLayers;
        this.baseLayer = baseLayer;
        this.decorators = decorators;
        this.metadataOnlyLayers = metadataOnlyLayers;
        this.provisioning = provisioning;
        this.config = config;
        this.disabledAddOns = disabledAddOns;
        this.enabledAddOns = enabledAddOns;
        this.suggestions = suggestions;
        this.errorSession = errorSession;
        this.excludedPackages = excludedPackages;
        this.excludedFeatures = excludedFeatures;
        this.fpVersions = fpVersions;
        this.channels = channels;
    }

    public Set getDiscoveredLayers() {
        return discoveredLayers;
    }

    public Set getExcludedLayers() {
        return excludedLayers;
    }

    public Layer getBaseLayer() {
        return baseLayer;
    }

    public Set getDecorators() {
        return decorators;
    }

    public Set getMetadataOnlyLayers() {
        return metadataOnlyLayers;
    }

    public Provisioning getProvisioning() {
        return provisioning;
    }
    public GalleonProvisioningConfig getProvisioningConfig() {
        return config;
    }

    public Suggestions getSuggestions() {
        return suggestions;
    }

    public ErrorIdentificationSession getErrorSession() {
        return errorSession;
    }

    public Map getDisabledAddOns() {
        return disabledAddOns;
    }

    public Set getEnabledAddOns() {
        return enabledAddOns;
    }

    public OutputContent outputConfig(Path target, String dockerImageName) throws Exception {
        return glowSession.outputConfig(this, target, dockerImageName);
    }

    public void outputInformation() throws Exception {
        outputInformation(GlowMessageWriter.DEFAULT, null);
    }

    public void outputCompactInformation() throws Exception {
        outputCompactInformation(GlowMessageWriter.DEFAULT);
    }

    public void outputInformation(ConfigurationResolver resolver) throws Exception {
        outputInformation(GlowMessageWriter.DEFAULT, resolver);
    }

    public void outputInformation(GlowMessageWriter writer) throws Exception {
        outputInformation(writer, null);
    }

    public void outputInformation(GlowMessageWriter writer, ConfigurationResolver resolver) throws Exception {
        ScanResultsPrinter printer = new ScanResultsPrinter(writer, resolver);
        glowSession.outputInformation(printer, this);
    }

    public void outputCompactInformation(GlowMessageWriter writer) throws Exception {
        ScanResultsPrinter printer = new ScanResultsPrinter(writer);
        glowSession.outputCompactInformation(printer, this);
    }

    public String getCompactInformation() throws Exception {
        ScanResultsPrinter printer = new ScanResultsPrinter(GlowMessageWriter.DEFAULT);
        return glowSession.getCompactInformation(printer, this);
    }

    @Override
    public void close() {
        provisioning.close();
    }

    public Set getExcludedPackages() {
        return excludedPackages;
    }

    public Map> getExcludedFeatures() {
        return excludedFeatures;
    }

    public Map getFeaturePackVersions() {
        return fpVersions;
    }

    public List getChannels() {
        return channels;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy