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

org.jboss.pnc.cleaner.orchApi.OrchClientProducer Maven / Gradle / Ivy

Go to download

This project is a service, which performs cleanup and maintenance tasks for PNC eco-system.

There is a newer version: 3.0.2
Show newest version
/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2019-2022 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.jboss.pnc.cleaner.orchApi;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Inject;

import org.jboss.pnc.client.BuildClient;
import org.jboss.pnc.client.GroupBuildClient;
import org.jboss.pnc.client.ProductMilestoneClient;
import org.jboss.pnc.client.ProductVersionClient;

/**
 * Producer for Orchestrator clients
 *
 * @author Jakub Bartecek
 */
@ApplicationScoped
public class OrchClientProducer {

    @Inject
    OrchClientConfiguration orchClientConfiguration;

    @Produces
    public BuildClient getBuildClient() {
        return new BuildClient(orchClientConfiguration.getConfiguration());
    }

    public BuildClient getAuthenticatedBuildClient() {
        return new BuildClient(orchClientConfiguration.getConfiguration(true));
    }

    @Produces
    public GroupBuildClient getBuildGroupClient() {
        return new GroupBuildClient(orchClientConfiguration.getConfiguration());
    }

    public GroupBuildClient getAuthenticatedBuildGroupClient() {
        return new GroupBuildClient(orchClientConfiguration.getConfiguration(true));
    }

    @Produces
    public ProductVersionClient getProductVersionClient() {
        return new ProductVersionClient(orchClientConfiguration.getConfiguration());
    }

    @Produces
    public ProductMilestoneClient getProductMilestoneClient() {
        return new ProductMilestoneClient(orchClientConfiguration.getConfiguration());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy