@ExtendWith(RepositoryManagementTestExecutionListener.class) @Test public void testSetProxyRepositoryMaxConnections(@RawRepository(repositoryId = REPOSITORY_RELEASES_2) Repository releases2) throws IOException { final String storageId = releases2.getStorage().getId(); final String releases2Id = releases2.getId(); configurationManagementService.setProxyRepositoryMaxConnections(storageId, releases2Id, 10); HttpConnectionPool pool = configurationManagementService.getConfiguration() .getHttpConnectionPoolConfiguration(storageId, releases2Id); assertThat(pool).isNotNull(); assertThat(pool.getAllocatedConnections()).isEqualTo(10); }
@Override public void setProxyRepositoryMaxConnections(String storageId, String repositoryId, int numberOfConnections) throws IOException { modifyInLock(configuration -> { RepositoryDto repository = configuration.getStorage(storageId).getRepository(repositoryId); if (repository.getHttpConnectionPool() == null) { repository.setHttpConnectionPool(new MutableHttpConnectionPool()); } repository.getHttpConnectionPool().setAllocatedConnections(numberOfConnections); }); }
ConfigurationManagementServiceImpl implements ConfigurationManagementService { @Override public void setProxyRepositoryMaxConnections(String storageId, String repositoryId, int numberOfConnections) throws IOException { modifyInLock(configuration -> { RepositoryDto repository = configuration.getStorage(storageId).getRepository(repositoryId); if (repository.getHttpConnectionPool() == null) { repository.setHttpConnectionPool(new MutableHttpConnectionPool()); } repository.getHttpConnectionPool().setAllocatedConnections(numberOfConnections); }); } }
ConfigurationManagementServiceImpl implements ConfigurationManagementService { @Override public void setProxyRepositoryMaxConnections(String storageId, String repositoryId, int numberOfConnections) throws IOException { modifyInLock(configuration -> { RepositoryDto repository = configuration.getStorage(storageId).getRepository(repositoryId); if (repository.getHttpConnectionPool() == null) { repository.setHttpConnectionPool(new MutableHttpConnectionPool()); } repository.getHttpConnectionPool().setAllocatedConnections(numberOfConnections); }); }  }
ConfigurationManagementServiceImpl implements ConfigurationManagementService { @Override public void setProxyRepositoryMaxConnections(String storageId, String repositoryId, int numberOfConnections) throws IOException { modifyInLock(configuration -> { RepositoryDto repository = configuration.getStorage(storageId).getRepository(repositoryId); if (repository.getHttpConnectionPool() == null) { repository.setHttpConnectionPool(new MutableHttpConnectionPool()); } repository.getHttpConnectionPool().setAllocatedConnections(numberOfConnections); }); }  @PostConstruct void init(); @Override MutableConfiguration getMutableConfigurationClone(); @Override Configuration getConfiguration(); @Override void setConfiguration(MutableConfiguration newConf); @Override void setInstanceName(String instanceName); @Override void setBaseUrl(String baseUrl); @Override void setPort(int port); @Override void setProxyConfiguration(String storageId,
                                      String repositoryId,
                                      MutableProxyConfiguration proxyConfiguration); @Override void saveStorage(StorageDto storage); @Override void addStorageIfNotExists(StorageDto storage); @Override void removeStorage(String storageId); @Override void saveRepository(String storageId,
                               RepositoryDto repository); @Override void removeRepositoryFromAssociatedGroups(String storageId,
                                                     String repositoryId); @Override void removeRepository(String storageId,
                                 String repositoryId); @Override void setProxyRepositoryMaxConnections(String storageId,
                                                 String repositoryId,
                                                 int numberOfConnections); @Override MutableRoutingRules getRoutingRules(); @Override MutableRoutingRule getRoutingRule(UUID uuid); @Override boolean updateRoutingRule(UUID uuid,
                                     MutableRoutingRule routingRule); @Override boolean addRoutingRule(MutableRoutingRule routingRule); @Override boolean removeRoutingRule(UUID uuid); @Override void addRepositoryToGroup(String storageId,
                                     String repositoryId,
                                     String repositoryGroupMemberId); @Override void setRepositoryArtifactCoordinateValidators(); @Override void putInService(final String storageId,
                             final String repositoryId); @Override void putOutOfService(final String storageId,
                                final String repositoryId); @Override void setArtifactMaxSize(final String storageId,
                                   final String repositoryId,
                                   final long value); @Override void set(final MutableRemoteRepositoryRetryArtifactDownloadConfiguration remoteRepositoryRetryArtifactDownloadConfiguration); @Override void addRepositoryArtifactCoordinateValidator(final String storageId,
                                                         final String repositoryId,
                                                         final String alias); @Override boolean removeRepositoryArtifactCoordinateValidator(final String storageId,
                                                               final String repositoryId,
                                                               final String alias); @Override void setCorsAllowedOrigins(final List<String> allowedOrigins); @Override void setSmtpSettings(MutableSmtpConfiguration smtpConfiguration); }
ConfigurationManagementServiceImpl implements ConfigurationManagementService { @Override public void setProxyRepositoryMaxConnections(String storageId, String repositoryId, int numberOfConnections) throws IOException { modifyInLock(configuration -> { RepositoryDto repository = configuration.getStorage(storageId).getRepository(repositoryId); if (repository.getHttpConnectionPool() == null) { repository.setHttpConnectionPool(new MutableHttpConnectionPool()); } repository.getHttpConnectionPool().setAllocatedConnections(numberOfConnections); }); }  @PostConstruct void init(); @Override MutableConfiguration getMutableConfigurationClone(); @Override Configuration getConfiguration(); @Override void setConfiguration(MutableConfiguration newConf); @Override void setInstanceName(String instanceName); @Override void setBaseUrl(String baseUrl); @Override void setPort(int port); @Override void setProxyConfiguration(String storageId,
                                      String repositoryId,
                                      MutableProxyConfiguration proxyConfiguration); @Override void saveStorage(StorageDto storage); @Override void addStorageIfNotExists(StorageDto storage); @Override void removeStorage(String storageId); @Override void saveRepository(String storageId,
                               RepositoryDto repository); @Override void removeRepositoryFromAssociatedGroups(String storageId,
                                                     String repositoryId); @Override void removeRepository(String storageId,
                                 String repositoryId); @Override void setProxyRepositoryMaxConnections(String storageId,
                                                 String repositoryId,
                                                 int numberOfConnections); @Override MutableRoutingRules getRoutingRules(); @Override MutableRoutingRule getRoutingRule(UUID uuid); @Override boolean updateRoutingRule(UUID uuid,
                                     MutableRoutingRule routingRule); @Override boolean addRoutingRule(MutableRoutingRule routingRule); @Override boolean removeRoutingRule(UUID uuid); @Override void addRepositoryToGroup(String storageId,
                                     String repositoryId,
                                     String repositoryGroupMemberId); @Override void setRepositoryArtifactCoordinateValidators(); @Override void putInService(final String storageId,
                             final String repositoryId); @Override void putOutOfService(final String storageId,
                                final String repositoryId); @Override void setArtifactMaxSize(final String storageId,
                                   final String repositoryId,
                                   final long value); @Override void set(final MutableRemoteRepositoryRetryArtifactDownloadConfiguration remoteRepositoryRetryArtifactDownloadConfiguration); @Override void addRepositoryArtifactCoordinateValidator(final String storageId,
                                                         final String repositoryId,
                                                         final String alias); @Override boolean removeRepositoryArtifactCoordinateValidator(final String storageId,
                                                               final String repositoryId,
                                                               final String alias); @Override void setCorsAllowedOrigins(final List<String> allowedOrigins); @Override void setSmtpSettings(MutableSmtpConfiguration smtpConfiguration);  }