Skip to content
Snippets Groups Projects

Iss #2 - Add base CVE service for retrieving data for resources.

Merged Iss #2 - Add base CVE service for retrieving data for resources.
Merged Martin Lowe requested to merge malowe/eclipsefdn-cve-api:malowe/main/2 into main
Files
11
/*******************************************************************************
* Copyright (C) 2022 Eclipse Foundation
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/
package org.eclipsefoundation.cve.config;
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;
import org.eclipsefoundation.cve.service.CveSourceService;
import org.eclipsefoundation.cve.service.impl.DefaultCveSourceService;
import org.eclipsefoundation.cve.service.impl.StubbedCveSourceService;
import io.quarkus.arc.DefaultBean;
import io.quarkus.arc.properties.IfBuildProperty;
/**
* Provider for CVE source service, allows for swapping back to stubbed service for tests/development to avoid having to
* use real data.
*
* @author Martin Lowe
*
*/
@Dependent
public class CveSourceServiceProvider {
public static final String PROVIDER_TYPE_PROPERTY_NAME = "eclipse.cve.provider";
@Produces
@DefaultBean
public CveSourceService defaultService() {
return new DefaultCveSourceService();
}
@Produces
@IfBuildProperty(name = PROVIDER_TYPE_PROPERTY_NAME, stringValue = "stubbed")
public CveSourceService stubbedService() {
return new StubbedCveSourceService();
}
}
Loading