@Test public void testGetPolicy() { RepositoryPolicy snapshotPolicy = new RepositoryPolicy( true, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_IGNORE ); RepositoryPolicy releasePolicy = new RepositoryPolicy( true, RepositoryPolicy.UPDATE_POLICY_NEVER, RepositoryPolicy.CHECKSUM_POLICY_FAIL ); RemoteRepository repo = new RemoteRepository.Builder( "id", "type", "http: .setSnapshotPolicy( snapshotPolicy ).setReleasePolicy( releasePolicy ).build(); RepositoryPolicy effectivePolicy = manager.getPolicy( session, repo, true, true ); assertEquals( true, effectivePolicy.isEnabled() ); assertEquals( RepositoryPolicy.CHECKSUM_POLICY_IGNORE, effectivePolicy.getChecksumPolicy() ); assertEquals( RepositoryPolicy.UPDATE_POLICY_ALWAYS, effectivePolicy.getUpdatePolicy() ); }
public RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases, boolean snapshots ) { RepositoryPolicy policy1 = releases ? repository.getPolicy( false ) : null; RepositoryPolicy policy2 = snapshots ? repository.getPolicy( true ) : null; RepositoryPolicy policy = merge( session, policy1, policy2, true ); return policy; }
DefaultRemoteRepositoryManager implements RemoteRepositoryManager, Service { public RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases, boolean snapshots ) { RepositoryPolicy policy1 = releases ? repository.getPolicy( false ) : null; RepositoryPolicy policy2 = snapshots ? repository.getPolicy( true ) : null; RepositoryPolicy policy = merge( session, policy1, policy2, true ); return policy; } }
DefaultRemoteRepositoryManager implements RemoteRepositoryManager, Service { public RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases, boolean snapshots ) { RepositoryPolicy policy1 = releases ? repository.getPolicy( false ) : null; RepositoryPolicy policy2 = snapshots ? repository.getPolicy( true ) : null; RepositoryPolicy policy = merge( session, policy1, policy2, true ); return policy; } DefaultRemoteRepositoryManager(); @Inject  DefaultRemoteRepositoryManager( UpdatePolicyAnalyzer updatePolicyAnalyzer,
                                    ChecksumPolicyProvider checksumPolicyProvider, LoggerFactory loggerFactory ); }
DefaultRemoteRepositoryManager implements RemoteRepositoryManager, Service { public RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases, boolean snapshots ) { RepositoryPolicy policy1 = releases ? repository.getPolicy( false ) : null; RepositoryPolicy policy2 = snapshots ? repository.getPolicy( true ) : null; RepositoryPolicy policy = merge( session, policy1, policy2, true ); return policy; } DefaultRemoteRepositoryManager(); @Inject  DefaultRemoteRepositoryManager( UpdatePolicyAnalyzer updatePolicyAnalyzer,
                                    ChecksumPolicyProvider checksumPolicyProvider, LoggerFactory loggerFactory ); void initService( ServiceLocator locator ); DefaultRemoteRepositoryManager setLoggerFactory( LoggerFactory loggerFactory ); DefaultRemoteRepositoryManager setUpdatePolicyAnalyzer( UpdatePolicyAnalyzer updatePolicyAnalyzer ); DefaultRemoteRepositoryManager setChecksumPolicyProvider( ChecksumPolicyProvider checksumPolicyProvider ); List<RemoteRepository> aggregateRepositories( RepositorySystemSession session,
                                                         List<RemoteRepository> dominantRepositories,
                                                         List<RemoteRepository> recessiveRepositories,
                                                         boolean recessiveIsRaw ); RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases,
                                       boolean snapshots ); }
DefaultRemoteRepositoryManager implements RemoteRepositoryManager, Service { public RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases, boolean snapshots ) { RepositoryPolicy policy1 = releases ? repository.getPolicy( false ) : null; RepositoryPolicy policy2 = snapshots ? repository.getPolicy( true ) : null; RepositoryPolicy policy = merge( session, policy1, policy2, true ); return policy; } DefaultRemoteRepositoryManager(); @Inject  DefaultRemoteRepositoryManager( UpdatePolicyAnalyzer updatePolicyAnalyzer,
                                    ChecksumPolicyProvider checksumPolicyProvider, LoggerFactory loggerFactory ); void initService( ServiceLocator locator ); DefaultRemoteRepositoryManager setLoggerFactory( LoggerFactory loggerFactory ); DefaultRemoteRepositoryManager setUpdatePolicyAnalyzer( UpdatePolicyAnalyzer updatePolicyAnalyzer ); DefaultRemoteRepositoryManager setChecksumPolicyProvider( ChecksumPolicyProvider checksumPolicyProvider ); List<RemoteRepository> aggregateRepositories( RepositorySystemSession session,
                                                         List<RemoteRepository> dominantRepositories,
                                                         List<RemoteRepository> recessiveRepositories,
                                                         boolean recessiveIsRaw ); RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases,
                                       boolean snapshots );  }