Search in sources :

Example 6 with ArtifactRef

use of org.commonjava.atlas.maven.ident.ref.ArtifactRef in project indy by Commonjava.

the class KojiContentManagerDecorator method findKojiBuildAnd.

@Measure
private <T> T findKojiBuildAnd(ArtifactStore store, String path, EventMetadata eventMetadata, T defValue, KojiBuildAction<T> action) throws IndyWorkflowException {
    if (!config.getEnabled()) {
        Logger logger = LoggerFactory.getLogger(getClass());
        logger.debug("Koji content-manager decorator is disabled.");
        logger.debug("When koji addon is disenabled , path:{},config instance is {}", path, config.toString());
        return defValue;
    }
    if (!config.isEnabledFor(store)) {
        Logger logger = LoggerFactory.getLogger(getClass());
        logger.debug("Koji content-manager decorator not enabled for: {}.", store.getKey());
        logger.debug("When the group is disenabled , path:{},config instance is {}", path, config.toString());
        return defValue;
    }
    logger.debug("When the koji is enabled , path:{},config instance is {}", path, config.toString());
    // TODO: This won't work for maven-metadata.xml files! We need to hit a POM or jar or something first.
    // FIXME: This won't work for NPM!
    ArtifactPathInfo pathInfo = ArtifactPathInfo.parse(path);
    if (pathInfo != null) {
        ArtifactRef artifactRef = pathInfo.getArtifact();
        logger.info("Searching for Koji build: {}", artifactRef);
        return proxyKojiBuild(store.getKey(), artifactRef, path, eventMetadata, defValue, action);
    } else {
        logger.info("Path is not a maven artifact reference: {}", path);
    }
    return defValue;
}
Also used : ArtifactPathInfo(org.commonjava.atlas.maven.ident.util.ArtifactPathInfo) Logger(org.slf4j.Logger) ArtifactRef(org.commonjava.atlas.maven.ident.ref.ArtifactRef) Measure(org.commonjava.o11yphant.metrics.annotation.Measure)

Aggregations

ArtifactRef (org.commonjava.atlas.maven.ident.ref.ArtifactRef)6 Transfer (org.commonjava.maven.galley.model.Transfer)3 Measure (org.commonjava.o11yphant.metrics.annotation.Measure)3 KojiArchiveInfo (com.redhat.red.build.koji.model.xmlrpc.KojiArchiveInfo)2 ArrayList (java.util.ArrayList)2 StoreKey (org.commonjava.indy.model.core.StoreKey)2 Location (org.commonjava.maven.galley.model.Location)2 Logger (org.slf4j.Logger)2 KojiClientException (com.redhat.red.build.koji.KojiClientException)1 KojiBuildInfo (com.redhat.red.build.koji.model.xmlrpc.KojiBuildInfo)1 KojiSessionInfo (com.redhat.red.build.koji.model.xmlrpc.KojiSessionInfo)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 HashSet (java.util.HashSet)1 SimpleArtifactRef (org.commonjava.atlas.maven.ident.ref.SimpleArtifactRef)1 ArtifactPathInfo (org.commonjava.atlas.maven.ident.util.ArtifactPathInfo)1 IndyWorkflowException (org.commonjava.indy.IndyWorkflowException)1 ChangeSummary (org.commonjava.indy.audit.ChangeSummary)1 IndyDataException (org.commonjava.indy.data.IndyDataException)1 KojiMultiRepairResult (org.commonjava.indy.koji.model.KojiMultiRepairResult)1