Package org.sonatype.nexus.plugins.p2.repository.metadata

Examples of org.sonatype.nexus.plugins.p2.repository.metadata.Content


                                   final String id,
                                   final String description,
                                   final Class<? extends P2GroupRepository> mainFacet,
                                   final String providerHint)
  {
    super(provider, id, description, new P2ContentClass(), mainFacet);
    this.providerHint = checkNotNull(providerHint);
  }
View Full Code Here


    extends AbstractRepositoryTemplate
{
  public UpdateSiteRepositoryTemplate(final P2RepositoryTemplateProvider provider, final String id,
                                      final String description)
  {
    super(provider, id, description, new P2ContentClass(), UpdateSiteProxyRepository.class);
  }
View Full Code Here

    extends AbstractRepositoryTemplate
{
  public P2ProxyRepositoryTemplate(final P2RepositoryTemplateProvider provider, final String id,
                                   final String description)
  {
    super(provider, id, description, new P2ContentClass(), P2ProxyRepository.class);
  }
View Full Code Here

    FileUtils.deleteDirectory(tempP2Repository);
  }

  @Test
  public void Test_NEXUS_5995() throws IOException, NoSuchRepositoryException {
    P2MetadataGeneratorConfiguration config = mock(P2MetadataGeneratorConfiguration.class);
    when(config.repositoryId()).thenReturn("mockId");
    Repository repo = mock(Repository.class);
    DefaultFSLocalRepositoryStorage local = mock(DefaultFSLocalRepositoryStorage.class);
    when(local.getFileFromBase(any(Repository.class), any(ResourceStoreRequest.class))).thenReturn(tempFile);
    when(repo.getLocalStorage()).thenReturn(local);
    when(repo.getId()).thenReturn("mockId");
View Full Code Here

    this.repositoryRegistry = checkNotNull(repositoryRegistry);
  }

  @Override
  protected P2MetadataGeneratorConfiguration createConfig(final Map<String, String> properties) throws Exception {
    return new P2MetadataGeneratorConfiguration(properties);
  }
View Full Code Here

    configurations.remove(configuration.repositoryId());
  }

  @Override
  public void generateP2Metadata(final StorageItem item) {
    final P2MetadataGeneratorConfiguration configuration = getConfiguration(item.getRepositoryId());
    if (configuration == null) {
      return;
    }
    logger.debug("Generate P2 metadata for [{}:{}]", item.getRepositoryId(), item.getPath());
View Full Code Here

    }
  }

  @Override
  public void removeP2Metadata(final StorageItem item) {
    final P2MetadataGeneratorConfiguration configuration = getConfiguration(item.getRepositoryId());
    if (configuration == null) {
      return;
    }
    logger.debug("Removing P2 metadata for [{}:{}]", item.getRepositoryId(), item.getPath());
    // TODO implement
View Full Code Here

  @Override
  public void scanAndRebuild(final String repositoryId, final String resourceStorePath) {
    logger.debug("Rebuilding P2 metadata for repository [{}], path [{}]", repositoryId, resourceStorePath);

    final P2MetadataGeneratorConfiguration configuration = getConfiguration(repositoryId);
    if (configuration == null) {
      logger.warn(
          "Rebuilding P2 metadata for [{}] not executed as P2 Metadata Generator capability is not enabled for this repository",
          repositoryId);
      return;
View Full Code Here

    if (!proxy.getRepositoryKind().isFacetAvailable(P2ProxyRepository.class)) {
      return ChecksumPolicy.IGNORE;
    }

    final P2ProxyRepository p2repo = proxy.adaptToFacet(P2ProxyRepository.class);

    final ChecksumPolicy checksumPolicy = p2repo.getChecksumPolicy();

    if (checksumPolicy == null || !checksumPolicy.shouldCheckChecksum()
        || !(item instanceof DefaultStorageFileItem)) {
      // there is either no need to validate or we can't validate the item content
      return ChecksumPolicy.IGNORE;
    }

    final ResourceStoreRequest req = new ResourceStoreRequest(P2Constants.ARTIFACT_MAPPINGS_XML);
    req.setRequestLocalOnly(true);
    try {
      p2repo.retrieveItem(true, req);
    }
    catch (final Exception e) {
      // no way to calculate
      log.debug("Unable to find artifact-mapping.xml", e);
      return ChecksumPolicy.IGNORE;
View Full Code Here

  @Override
  protected RemoteHashResponse retrieveRemoteHash(final AbstractStorageItem item, final ProxyRepository proxy,
                                                  final String baseUrl)
      throws LocalStorageException
  {
    final P2ProxyRepository p2repo = proxy.adaptToFacet(P2ProxyRepository.class);

    Map<String, ArtifactPath> paths;
    try {
      final ArtifactMapping artifactMapping = p2repo.getArtifactMappings().get(baseUrl);
      if (artifactMapping == null) {
        log.debug("Unable to retrive remote has for " + item.getPath());
        return null;
      }
      paths = artifactMapping.getArtifactsPath();
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.plugins.p2.repository.metadata.Content

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.