Skip to content
Snippets Groups Projects

feat: Change Committee relation type to ME

3 files
+ 32
28
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -21,6 +21,7 @@ import javax.annotation.PostConstruct;
@@ -21,6 +21,7 @@ import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.inject.Inject;
 
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.context.ManagedExecutor;
import org.eclipse.microprofile.context.ManagedExecutor;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.eclipsefoundation.core.service.APIMiddleware;
import org.eclipsefoundation.core.service.APIMiddleware;
@@ -47,7 +48,8 @@ import io.quarkus.runtime.Startup;
@@ -47,7 +48,8 @@ import io.quarkus.runtime.Startup;
public class DefaultAPIService implements APIService {
public class DefaultAPIService implements APIService {
public static final Logger LOGGER = LoggerFactory.getLogger(DefaultAPIService.class);
public static final Logger LOGGER = LoggerFactory.getLogger(DefaultAPIService.class);
public static final String COMMITTEE_RELATION_TYPE = "WC";
@ConfigProperty(name = "eclipse.working-groups.relation-type")
 
String committeeRelationType;
@Inject
@Inject
CachingService cache;
CachingService cache;
@@ -81,14 +83,14 @@ public class DefaultAPIService implements APIService {
@@ -81,14 +83,14 @@ public class DefaultAPIService implements APIService {
@Override
@Override
public List<SysRelationData> getRelations() {
public List<SysRelationData> getRelations() {
// Paginated fetch of all relations matching the WC type
// Paginated fetch of all relations matching the ME type
Optional<List<SysRelationData>> relations = cache.get(COMMITTEE_RELATION_TYPE, new MultivaluedMapImpl<>(),
Optional<List<SysRelationData>> relations = cache.get(committeeRelationType, new MultivaluedMapImpl<>(),
SysRelationData.class, () -> middleware.getAll(r -> fdbAPI.getRelations(r, COMMITTEE_RELATION_TYPE),
SysRelationData.class, () -> middleware.getAll(r -> fdbAPI.getRelations(r, committeeRelationType),
SysRelationData.class));
SysRelationData.class));
if (relations.isEmpty()) {
if (relations.isEmpty()) {
LOGGER.warn("Could not find any Relations of type '{}', there may be a connection error",
LOGGER.warn("Could not find any Relations of type '{}', there may be a connection error",
COMMITTEE_RELATION_TYPE);
committeeRelationType);
return Collections.emptyList();
return Collections.emptyList();
}
}
Loading