use of org.apache.archiva.admin.model.beans.ProxyConnectorRule in project archiva by apache.
the class DefaultProxyConnectorRuleAdmin method getProxyConnectorRules.
@Override
public List<ProxyConnectorRule> getProxyConnectorRules() throws RepositoryAdminException {
List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations = getArchivaConfiguration().getConfiguration().getProxyConnectorRuleConfigurations();
if (proxyConnectorRuleConfigurations.isEmpty()) {
return Collections.emptyList();
}
List<ProxyConnectorRule> proxyConnectorRules = new ArrayList<>(proxyConnectorRuleConfigurations.size());
for (ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration : proxyConnectorRuleConfigurations) {
ProxyConnectorRule proxyConnectorRule = new ProxyConnectorRule();
proxyConnectorRule.setPattern(proxyConnectorRuleConfiguration.getPattern());
proxyConnectorRule.setProxyConnectorRuleType(getProxyConnectorRuleType(proxyConnectorRuleConfiguration.getRuleType()));
for (ProxyConnectorConfiguration proxyConnectorConfiguration : proxyConnectorRuleConfiguration.getProxyConnectors()) {
ProxyConnector proxyConnector = new ProxyConnector();
proxyConnector.setSourceRepoId(proxyConnectorConfiguration.getSourceRepoId());
proxyConnector.setTargetRepoId(proxyConnectorConfiguration.getTargetRepoId());
proxyConnectorRule.getProxyConnectors().add(proxyConnector);
}
proxyConnectorRules.add(proxyConnectorRule);
}
return proxyConnectorRules;
}
Aggregations