Examples of NFCRepositoryResource


Examples of org.sonatype.nexus.rest.model.NFCRepositoryResource

      // check reposes
      if (getRepositoryGroupId(request) != null) {
        for (Repository repository : getRepositoryRegistry()
            .getRepositoryWithFacet(getRepositoryGroupId(request), GroupRepository.class)
            .getMemberRepositories()) {
          NFCRepositoryResource repoNfc = createNFCRepositoryResource(repository);

          resource.addNfcContent(repoNfc);
        }
      }
      else if (getRepositoryId(request) != null) {
        Repository repository = getRepositoryRegistry().getRepository(getRepositoryId(request));

        NFCRepositoryResource repoNfc = createNFCRepositoryResource(repository);

        resource.addNfcContent(repoNfc);
      }

      NFCResourceResponse result = new NFCResourceResponse();
View Full Code Here

Examples of org.sonatype.nexus.rest.model.NFCRepositoryResource

      throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, e.getMessage());
    }
  }

  protected NFCRepositoryResource createNFCRepositoryResource(Repository repository) {
    NFCRepositoryResource repoNfc = new NFCRepositoryResource();

    repoNfc.setRepositoryId(repository.getId());

    CacheStatistics stats = repository.getNotFoundCache().getStatistics();

    NFCStats restStats = new NFCStats();

    restStats.setSize(stats.getSize());

    restStats.setHits(stats.getHits());

    restStats.setMisses(stats.getMisses());

    repoNfc.setNfcStats(restStats);

    repoNfc.getNfcPaths().addAll(repository.getNotFoundCache().listKeysInCache());

    return repoNfc;
  }
View Full Code Here

Examples of org.sonatype.nexus.rest.model.NFCRepositoryResource

  @Test
  public void testNFCResourceResponse() {
    NFCResourceResponse resourceResponse = new NFCResourceResponse();

    NFCRepositoryResource nfcRepoResource1 = new NFCRepositoryResource();
    nfcRepoResource1.setRepositoryId("repoId1");
    nfcRepoResource1.addNfcPath("path1");
    nfcRepoResource1.addNfcPath("path2");

    NFCStats stats = new NFCStats();
    stats.setHits(1000);
    stats.setMisses(5000);
    stats.setSize(44);
    nfcRepoResource1.setNfcStats(stats);

    NFCRepositoryResource nfcRepoResource2 = new NFCRepositoryResource();
    nfcRepoResource2.setRepositoryId("repoId2");
    nfcRepoResource2.addNfcPath("path3");
    nfcRepoResource2.addNfcPath("path4");

    NFCStats stats2 = new NFCStats();
    stats2.setHits(1000);
    stats2.setMisses(5000);
    stats2.setSize(44);
    nfcRepoResource2.setNfcStats(stats2);

    NFCResource resource = new NFCResource();
    resource.addNfcContent(nfcRepoResource1);
    resource.addNfcContent(nfcRepoResource2);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.