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

io.smallrye.reactive.messaging.providers.wiring.OpenGraphException Maven / Gradle / Ivy

package io.smallrye.reactive.messaging.providers.wiring;

import java.util.Set;

public class OpenGraphException extends WiringException {
    public OpenGraphException(final String message) {
        super(message);
    }

    public static OpenGraphException openGraphException(Set resolved,
            Set unresolved) {
        StringBuffer message = new StringBuffer(
                "Some components are not connected to either downstream consumers or upstream producers:\n");
        resolved.stream().filter(component -> !component.isDownstreamResolved())
                .forEach(c -> message.append("\t- ").append(c).append(" has no downstream\n"));
        unresolved.stream().filter(component -> !component.isDownstreamResolved())
                .forEach(c -> message.append("\t- ").append(c).append(" has no downstream\n"));
        unresolved.stream()
                .filter(c -> c.upstreams().isEmpty())
                .forEach(c -> message.append("\t- ").append(c).append(" has no upstream\n"));

        return new OpenGraphException(message.toString());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy