org.sonatype.nexus.repository.manager.RepositoryManager Java Examples

The following examples show how to use org.sonatype.nexus.repository.manager.RepositoryManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RestoreMetadataTask.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public RestoreMetadataTask(final BlobStoreManager blobStoreManager,
                           final RepositoryManager repositoryManager,
                           final Map<String, RestoreBlobStrategy> restoreBlobStrategies,
                           final BlobStoreUsageChecker blobStoreUsageChecker,
                           final DryRunPrefix dryRunPrefix,
                           final Map<String, IntegrityCheckStrategy> integrityCheckStrategies,
                           final BucketStore bucketStore,
                           final MaintenanceService maintenanceService)
{
  this.blobStoreManager = checkNotNull(blobStoreManager);
  this.repositoryManager = checkNotNull(repositoryManager);
  this.restoreBlobStrategies = checkNotNull(restoreBlobStrategies);
  this.blobStoreUsageChecker = checkNotNull(blobStoreUsageChecker);
  this.dryRunPrefix = checkNotNull(dryRunPrefix);
  this.defaultIntegrityCheckStrategy = checkNotNull(integrityCheckStrategies.get(DEFAULT_NAME));
  this.integrityCheckStrategies = checkNotNull(integrityCheckStrategies);
  this.bucketStore = checkNotNull(bucketStore);
  this.maintenanceService = checkNotNull(maintenanceService);
}
 
Example #2
Source File: BlobStoreManagerImpl.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public BlobStoreManagerImpl(final EventManager eventManager, //NOSONAR
                            final BlobStoreConfigurationStore store,
                            final Map<String, BlobStoreDescriptor> blobStoreDescriptors,
                            final Map<String, Provider<BlobStore>> blobStorePrototypes,
                            final FreezeService freezeService,
                            final Provider<RepositoryManager> repositoryManagerProvider,
                            final NodeAccess nodeAccess,
                            @Nullable @Named("${nexus.blobstore.provisionDefaults}") final Boolean provisionDefaults)
{
  this.eventManager = checkNotNull(eventManager);
  this.store = checkNotNull(store);
  this.blobStoreDescriptors = checkNotNull(blobStoreDescriptors);
  this.blobStorePrototypes = checkNotNull(blobStorePrototypes);
  this.freezeService = checkNotNull(freezeService);
  this.repositoryManagerProvider = checkNotNull(repositoryManagerProvider);

  if (provisionDefaults != null) {
    // explicit true/false setting, so honour that
    this.provisionDefaults = provisionDefaults::booleanValue;
  }
  else {
    // otherwise only create in non-clustered mode
    this.provisionDefaults = () -> !nodeAccess.isClustered();
  }
}
 
Example #3
Source File: SearchQueryServiceImpl.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * @param client source for a {@link Client}
 * @param repositoryManager the repositoryManager
 * @param securityHelper the securityHelper
 * @param searchSubjectHelper the searchSubjectHelper
 * @param indexNamingPolicy the index naming policy
 * @param profile whether or not to profile elasticsearch queries (default: false)
 */
@Inject
public SearchQueryServiceImpl(final Provider<Client> client,
                              final RepositoryManager repositoryManager,
                              final SecurityHelper securityHelper,
                              final SearchSubjectHelper searchSubjectHelper,
                              final IndexNamingPolicy indexNamingPolicy,
                              @Named("${nexus.elasticsearch.profile:-false}") final boolean profile)
{
  this.client = checkNotNull(client);
  this.repositoryManager = checkNotNull(repositoryManager);
  this.securityHelper = checkNotNull(securityHelper);
  this.searchSubjectHelper = checkNotNull(searchSubjectHelper);
  this.indexNamingPolicy = checkNotNull(indexNamingPolicy);
  this.profile = profile;
}
 
Example #4
Source File: RepositoryViewPrivilegeDescriptor.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public RepositoryViewPrivilegeDescriptor(final RepositoryManager repositoryManager, final List<Format> formats) {
  super(TYPE, repositoryManager, formats);
  this.formFields = ImmutableList.of(
      new StringTextFormField(
          P_FORMAT,
          messages.format(),
          messages.formatHelp(),
          FormField.MANDATORY
      ),
      new RepositoryCombobox(
          P_REPOSITORY,
          messages.repository(),
          messages.repositoryHelp(),
          true
      ).includeAnEntryForAllRepositories(),
      new StringTextFormField(
          P_ACTIONS,
          messages.actions(),
          messages.actionsHelp(),
          FormField.MANDATORY
      )
  );
}
 
Example #5
Source File: RepositoryAdminPrivilegeDescriptor.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public RepositoryAdminPrivilegeDescriptor(final RepositoryManager repositoryManager, final List<Format> formats) {
  super(TYPE, repositoryManager, formats);
  this.formFields = ImmutableList.of(
      new StringTextFormField(
          P_FORMAT,
          messages.format(),
          messages.formatHelp(),
          FormField.MANDATORY
      ),
      new RepositoryCombobox(
          P_REPOSITORY,
          messages.repository(),
          messages.repositoryHelp(),
          true
      ).includeAnEntryForAllRepositories(),
      new StringTextFormField(
          P_ACTIONS,
          messages.actions(),
          messages.actionsHelp(),
          FormField.MANDATORY
      )
  );
}
 
Example #6
Source File: DatastoreBrowseNodeStoreImpl.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public DatastoreBrowseNodeStoreImpl(
    final DataSessionSupplier sessionSupplier,
    final SecurityHelper securityHelper,
    final SelectorManager selectorManager,
    final BrowseNodeConfiguration configuration,
    final RepositoryManager repositoryManager,
    final DatastoreContentAuthHelper contentAuthHelper,
    final Map<String, ContentRepositoryStore<? extends ContentRepositoryDAO>> contentRepositoryStores,
    final Map<String, BrowseNodeFilter> browseNodeFilters,
    final Map<String, BrowseNodeComparator> browseNodeComparators)
{
  super(sessionSupplier, "content");
  this.securityHelper = checkNotNull(securityHelper);
  this.selectorManager = checkNotNull(selectorManager);
  this.browseNodeFilters = checkNotNull(browseNodeFilters);
  this.browseNodeComparators = checkNotNull(browseNodeComparators);
  this.repositoryManager = checkNotNull(repositoryManager);
  this.contentAuthHelper = checkNotNull(contentAuthHelper);
  this.contentRepositoryStores = checkNotNull(contentRepositoryStores);
  this.deletePageSize = checkNotNull(configuration).getDeletePageSize();
  this.defaultBrowseNodeComparator = checkNotNull(browseNodeComparators.get(DefaultBrowseNodeComparator.NAME));
}
 
Example #7
Source File: BrowseServiceImpl.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public BrowseServiceImpl(@Named(GroupType.NAME) final Type groupType,
                         final ComponentEntityAdapter componentEntityAdapter,
                         final VariableResolverAdapterManager variableResolverAdapterManager,
                         final ContentPermissionChecker contentPermissionChecker,
                         final AssetEntityAdapter assetEntityAdapter,
                         final BrowseAssetIterableFactory browseAssetIterableFactory,
                         final BrowseAssetsSqlBuilder browseAssetsSqlBuilder,
                         final BrowseComponentsSqlBuilder browseComponentsSqlBuilder,
                         final BucketStore bucketStore,
                         final RepositoryManager repositoryManager)
{
  this.groupType = checkNotNull(groupType);
  this.componentEntityAdapter = checkNotNull(componentEntityAdapter);
  this.variableResolverAdapterManager = checkNotNull(variableResolverAdapterManager);
  this.contentPermissionChecker = checkNotNull(contentPermissionChecker);
  this.assetEntityAdapter = checkNotNull(assetEntityAdapter);
  this.browseAssetIterableFactory = checkNotNull(browseAssetIterableFactory);
  this.browseAssetsSqlBuilder = checkNotNull(browseAssetsSqlBuilder);
  this.browseComponentsSqlBuilder = checkNotNull(browseComponentsSqlBuilder);
  this.bucketStore = checkNotNull(bucketStore);
  this.repositoryManager = checkNotNull(repositoryManager);
}
 
Example #8
Source File: ViewServletTest.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
  defaultResponseSender = spy(new DefaultHttpResponseSender());

  when(descriptionRenderer.renderHtml(any(Description.class))).thenReturn("HTML");
  when(descriptionRenderer.renderJson(any(Description.class))).thenReturn("JSON");

  underTest = spy(new ViewServlet(mock(RepositoryManager.class),
      new HttpResponseSenderSelector(Collections.<String, HttpResponseSender>emptyMap(), defaultResponseSender),
      mock(DescriptionHelper.class),
      descriptionRenderer, true
  ));

  when(request.getPath()).thenReturn("/test");

  parameters = new Parameters();
  when(request.getParameters()).thenReturn(parameters);

  BaseUrlHolder.set("http://placebo");
}
 
Example #9
Source File: RepositoryBrowseResource.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public RepositoryBrowseResource(
    final RepositoryManager repositoryManager,
    final BrowseNodeStore<EntityId> browseNodeStore,
    final BrowseNodeConfiguration configuration,
    final BucketStore bucketStore,
    final TemplateHelper templateHelper,
    final SecurityHelper securityHelper)
{
  this.repositoryManager = checkNotNull(repositoryManager);
  this.browseNodeStore = checkNotNull(browseNodeStore);
  this.configuration = checkNotNull(configuration);
  this.templateHelper = checkNotNull(templateHelper);
  this.securityHelper = checkNotNull(securityHelper);
  this.bucketStore = checkNotNull(bucketStore);
  this.template = getClass().getResource(TEMPLATE_RESOURCE);
  checkNotNull(template);
}
 
Example #10
Source File: OrientBrowseNodeStoreImpl.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public OrientBrowseNodeStoreImpl(
    @Named("component") final Provider<DatabaseInstance> databaseInstance,
    final BrowseNodeEntityAdapter entityAdapter,
    final SecurityHelper securityHelper,
    final SelectorManager selectorManager,
    final BrowseNodeConfiguration configuration,
    final RepositoryManager repositoryManager,
    final Map<String, BrowseNodeFilter> browseNodeFilters,
    final Map<String, BrowseNodeComparator> browseNodeComparators)
{
  this.databaseInstance = checkNotNull(databaseInstance);
  this.entityAdapter = checkNotNull(entityAdapter);
  this.securityHelper = checkNotNull(securityHelper);
  this.selectorManager = checkNotNull(selectorManager);
  this.browseNodeFilters = checkNotNull(browseNodeFilters);
  this.browseNodeComparators = checkNotNull(browseNodeComparators);
  this.repositoryManager = checkNotNull(repositoryManager);
  this.deletePageSize = configuration.getDeletePageSize();
  this.defaultBrowseNodeComparator = checkNotNull(browseNodeComparators.get(DefaultBrowseNodeComparator.NAME));
}
 
Example #11
Source File: RepairMetadataComponentTest.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
public RepairMetadataComponentForTest(final RepositoryManager repositoryManager,
                                      final AssetEntityAdapter assetEntityAdapter,
                                      final Type type,
                                      final Format format)
{
  super(repositoryManager, assetEntityAdapter, type, format);
}
 
Example #12
Source File: AbstractGroupRepositoriesApiResource.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public AbstractGroupRepositoriesApiResource(
    final AuthorizingRepositoryManager authorizingRepositoryManager,
    final GroupRepositoryApiRequestToConfigurationConverter<T> configurationAdapter,
    final ConstraintViolationFactory constraintViolationFactory,
    final RepositoryManager repositoryManager)
{
  super(authorizingRepositoryManager, configurationAdapter);
  this.constraintViolationFactory = checkNotNull(constraintViolationFactory);
  this.repositoryManager = checkNotNull(repositoryManager);
}
 
Example #13
Source File: ContentAuthPluginScript.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
public ContentAuthPluginScript(final Subject subject,
                               final ContentPermissionChecker contentPermissionChecker,
                               final VariableResolverAdapterManager variableResolverAdapterManager,
                               final RepositoryManager repositoryManager,
                               final boolean contentAuthSleep)
{
  this.subject = checkNotNull(subject);
  this.contentPermissionChecker = checkNotNull(contentPermissionChecker);
  this.variableResolverAdapterManager = checkNotNull(variableResolverAdapterManager);
  this.repositoryManager = checkNotNull(repositoryManager);
  this.contentAuthSleep = contentAuthSleep;
}
 
Example #14
Source File: ContentAuthPlugin.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
public static void setDependencies(final ContentPermissionChecker contentPermissionChecker,
                                   final VariableResolverAdapterManager variableResolverAdapterManager,
                                   final SearchSubjectHelper searchSubjectHelper,
                                   final RepositoryManager repositoryManager,
                                   final boolean contentAuthSleep)
{
  ContentAuthPlugin.contentPermissionChecker = checkNotNull(contentPermissionChecker);
  ContentAuthPlugin.variableResolverAdapterManager = checkNotNull(variableResolverAdapterManager);
  ContentAuthPlugin.searchSubjectHelper = checkNotNull(searchSubjectHelper);
  ContentAuthPlugin.repositoryManager = checkNotNull(repositoryManager);
  ContentAuthPlugin.contentAuthSleep = contentAuthSleep;
}
 
Example #15
Source File: ContentAuthPluginLocator.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public ContentAuthPluginLocator(final ContentPermissionChecker contentPermissionChecker,
                                final VariableResolverAdapterManager variableResolverAdapterManager,
                                final SearchSubjectHelper searchSubjectHelper,
                                final RepositoryManager repositoryManager,
                                @Named("${nexus.elasticsearch.contentAuthSleep:-false}") final boolean contentAuthSleep)
{
  ContentAuthPlugin.setDependencies(contentPermissionChecker, variableResolverAdapterManager,
      searchSubjectHelper, repositoryManager, contentAuthSleep);
}
 
Example #16
Source File: RoutingRuleHelperImpl.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public RoutingRuleHelperImpl(
    final RoutingRuleCache routingRuleCache,
    final RepositoryManager repositoryManager,
    final RepositoryPermissionChecker repositoryPermissionChecker)
{
  this.routingRuleCache = checkNotNull(routingRuleCache);
  this.repositoryManager = checkNotNull(repositoryManager);
  this.repositoryPermissionChecker = checkNotNull(repositoryPermissionChecker);
}
 
Example #17
Source File: GroupFacetImpl.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public GroupFacetImpl(final RepositoryManager repositoryManager,
                      final ConstraintViolationFactory constraintViolationFactory,
                      @Named(GroupType.NAME) final Type groupType)
{
  this.repositoryManager = checkNotNull(repositoryManager);
  this.groupType = checkNotNull(groupType);
  this.constraintViolationFactory = checkNotNull(constraintViolationFactory);
}
 
Example #18
Source File: SearchResultComponentGeneratorSupport.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
public SearchResultComponentGeneratorSupport(final VariableResolverAdapterManager variableResolverAdapterManager,
                                             final RepositoryManager repositoryManager,
                                             final ContentPermissionChecker contentPermissionChecker)
{
  this.variableResolverAdapterManager = checkNotNull(variableResolverAdapterManager);
  this.repositoryManager = checkNotNull(repositoryManager);
  this.contentPermissionChecker = checkNotNull(contentPermissionChecker);
}
 
Example #19
Source File: RepositoryContentSelectorPrivilegeDescriptor.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public RepositoryContentSelectorPrivilegeDescriptor(final RepositoryManager repositoryManager,
                                                    final SelectorManager selectorManager,
                                                    final List<Format> formats)
{
  super(TYPE, repositoryManager, formats);
  this.selectorManager = checkNotNull(selectorManager);
  this.formFields = ImmutableList.of(
      new SelectorComboFormField(
          P_CONTENT_SELECTOR,
          messages.contentSelector(),
          messages.contentSelectorHelp(),
          FormField.MANDATORY
      ),
      new RepositoryCombobox(
          P_REPOSITORY,
          messages.repository(),
          messages.repositoryHelp(),
          true
      ).includeEntriesForAllFormats(),
      new StringTextFormField(
          P_ACTIONS,
          messages.actions(),
          messages.actionsHelp(),
          FormField.MANDATORY
      )
  );
}
 
Example #20
Source File: AuthorizingRepositoryManagerImpl.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public AuthorizingRepositoryManagerImpl(
    final RepositoryManager repositoryManager,
    final RepositoryPermissionChecker repositoryPermissionChecker,
    final TaskScheduler taskScheduler)
{
  this.repositoryManager = checkNotNull(repositoryManager);
  this.repositoryPermissionChecker = checkNotNull(repositoryPermissionChecker);
  this.taskScheduler = checkNotNull(taskScheduler);
}
 
Example #21
Source File: RepositoryConditionSupport.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
public RepositoryConditionSupport(final EventManager eventManager,
                                  final RepositoryManager repositoryManager,
                                  final Supplier<String> repositoryName)
{
  super(eventManager, false);
  this.repositoryManager = checkNotNull(repositoryManager);
  this.repositoryName = checkNotNull(repositoryName);
  bindLock = new ReentrantReadWriteLock();
}
 
Example #22
Source File: RepairMetadataComponent.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
public RepairMetadataComponent(final RepositoryManager repositoryManager,
                               final AssetEntityAdapter assetEntityAdapter,
                               final Type type,
                               final Format format)
{
  this.repositoryManager = checkNotNull(repositoryManager);
  this.assetEntityAdapter = checkNotNull(assetEntityAdapter);
  this.type = checkNotNull(type);
  this.format = checkNotNull(format);
}
 
Example #23
Source File: IndexRequestProcessor.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public IndexRequestProcessor(final RepositoryManager repositoryManager,
                             final EventManager eventManager,
                             final SearchIndexService searchIndexService,
                             @Named("${nexus.elasticsearch.bulkProcessing:-true}") final boolean bulkProcessing)
{
  this.repositoryManager = checkNotNull(repositoryManager);
  this.eventManager = checkNotNull(eventManager);
  this.searchIndexService = checkNotNull(searchIndexService);
  this.bulkProcessing = bulkProcessing;
}
 
Example #24
Source File: CleanupPolicyComponent.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public CleanupPolicyComponent(final CleanupPolicyStorage cleanupPolicyStorage,
                              final RepositoryManager repositoryManager,
                              final Map<String, CleanupPolicyConfiguration> cleanupPolicyConfiguration,
                              final RepositoryPermissionChecker repositoryPermissionChecker)
{
  this.cleanupPolicyStorage = checkNotNull(cleanupPolicyStorage);
  this.repositoryManager = checkNotNull(repositoryManager);
  this.cleanupPolicyConfiguration = checkNotNull(cleanupPolicyConfiguration);
  this.defaultCleanupPolicyConfiguration = checkNotNull(cleanupPolicyConfiguration.get("default"));
  this.repositoryPermissionChecker = repositoryPermissionChecker;
}
 
Example #25
Source File: CleanupConfigurationValidator.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public CleanupConfigurationValidator(final ConstraintViolationFactory constraintViolationFactory,
                                     final RepositoryManager repositoryManager,
                                     final CleanupPolicyStorage cleanupPolicyStorage)
{
  this.constraintViolationFactory = checkNotNull(constraintViolationFactory);
  this.repositoryManager = checkNotNull(repositoryManager);
  this.cleanupPolicyStorage = checkNotNull(cleanupPolicyStorage);
}
 
Example #26
Source File: CleanupPreviewComponent.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public CleanupPreviewComponent(final Provider<CleanupPreviewHelper> cleanupPreviewHelper,
                               final RepositoryManager repositoryManager)
{
  this.cleanupPreviewHelper = checkNotNull(cleanupPreviewHelper);
  this.repositoryManager = checkNotNull(repositoryManager);
}
 
Example #27
Source File: CleanupServiceImpl.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public CleanupServiceImpl(final RepositoryManager repositoryManager,
                          final CleanupComponentBrowse browseService,
                          final CleanupPolicyStorage cleanupPolicyStorage,
                          final CleanupMethod cleanupMethod,
                          final GroupType groupType,
                          @Named("${nexus.cleanup.retries:-3}") final int cleanupRetryLimit)
{
  this.repositoryManager = checkNotNull(repositoryManager);
  this.browseService = checkNotNull(browseService);
  this.cleanupPolicyStorage = checkNotNull(cleanupPolicyStorage);
  this.cleanupMethod = checkNotNull(cleanupMethod);
  this.groupType = checkNotNull(groupType);
  this.cleanupRetryLimit = cleanupRetryLimit;
}
 
Example #28
Source File: MavenRestoreBlobStrategy.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public MavenRestoreBlobStrategy(
    final MavenPathParser mavenPathParser,
    final NodeAccess nodeAccess,
    final RepositoryManager repositoryManager,
    final BlobStoreManager blobStoreManager,
    final DryRunPrefix dryRunPrefix)
{
  super(nodeAccess, repositoryManager, blobStoreManager, dryRunPrefix);
  this.mavenPathParser = checkNotNull(mavenPathParser);
}
 
Example #29
Source File: HelmComponentDirector.java    From nexus-repository-helm with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public HelmComponentDirector(
    final BucketStore bucketStore,
    final RepositoryManager repositoryManager)
{
  this.bucketStore = checkNotNull(bucketStore);
  this.repositoryManager = checkNotNull(repositoryManager);
}
 
Example #30
Source File: RepositoryManagerRESTAdapterImpl.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public RepositoryManagerRESTAdapterImpl(final RepositoryManager repositoryManager,
                                        final RepositoryPermissionChecker repositoryPermissionChecker)
{
  this.repositoryManager = checkNotNull(repositoryManager);
  this.repositoryPermissionChecker = checkNotNull(repositoryPermissionChecker);
}