Examples of PublishingStatus


Examples of org.sonatype.nexus.proxy.maven.routing.PublishingStatus

    }
    else {
      remoteDiscoveryEnabled = false;
    }

    PublishingStatus publishingStatus = null;
    DiscoveryStatus discoveryStatus = null;

    // publish status
    final FilePrefixSource publishedEntrySource = getPrefixSourceFor(mavenRepository);
    if (!publishedEntrySource.supported()) {
      final String message;
      if (isMavenRepositorySupported(mavenRepository)) {
        if (mavenRepository.getRepositoryKind().isFacetAvailable(MavenGroupRepository.class)) {
          final MavenGroupRepository mavenGroupRepository =
              mavenRepository.adaptToFacet(MavenGroupRepository.class);
          final List<String> membersWithoutPrefixFiles = new ArrayList<String>();
          for (Repository member : mavenGroupRepository.getMemberRepositories()) {
            final MavenRepository memberMavenRepository = member.adaptToFacet(MavenRepository.class);
            if (null != memberMavenRepository) {
              final PrefixSource ps = getPrefixSourceFor(memberMavenRepository);
              if (!ps.supported()) {
                membersWithoutPrefixFiles.add(memberMavenRepository.getName());
              }
            }
          }
          message =
              "Publishing not possible, following members have no published prefix file: "
                  + Joiner.on(", ").join(membersWithoutPrefixFiles);
        }
        else if (mavenRepository.getRepositoryKind().isFacetAvailable(MavenProxyRepository.class)) {
          if (remoteDiscoveryEnabled) {
            message = "Discovery in progress or unable to discover remote content (see discovery status).";
          }
          else {
            message = "Remote discovery not enabled.";
          }
        }
        else if (mavenRepository.getRepositoryKind().isFacetAvailable(MavenHostedRepository.class)) {
          message = "Check Nexus logs for more details."; // hosted reposes must be discovered always
        }
        else if (mavenRepository.getRepositoryKind().isFacetAvailable(ShadowRepository.class)) {
          message = "Unsupported repository type (only hosted, proxy and groups are supported).";
        }
        else {
          message = "Check Nexus logs for more details.";
        }
      }
      else {
        message = "Unsupported repository format (only Maven2 format is supported).";
      }
      publishingStatus = new PublishingStatus(PStatus.NOT_PUBLISHED, message, -1, null);
    }
    else {
      publishingStatus =
          new PublishingStatus(PStatus.PUBLISHED, "Prefix file published successfully.",
              publishedEntrySource.getLostModifiedTimestamp(), publishedEntrySource.getFilePath());
    }

    if (mavenProxyRepository == null) {
      discoveryStatus = new DiscoveryStatus(DStatus.NOT_A_PROXY);
View Full Code Here

Examples of org.sonatype.nexus.proxy.maven.routing.PublishingStatus

      default:
        payload.setPublishedStatus(0);
        break;
    }
    payload.setPublishedMessage(status.getPublishingStatus().getLastPublishedMessage());
    final PublishingStatus pstatus = status.getPublishingStatus();
    if (PStatus.PUBLISHED == pstatus.getStatus()) {
      payload.setPublishedTimestamp(pstatus.getLastPublishedTimestamp());
      if (mavenRepository.isExposed() && pstatus.getLastPublishedFilePath() != null) {
        final String repositoryUrl = repositoryURLBuilder.getExposedRepositoryContentUrl(mavenRepository);
        if (repositoryUrl != null) {
          payload.setPublishedUrl(repositoryUrl + pstatus.getLastPublishedFilePath());
        }
      }
    }
    else {
      payload.setPublishedTimestamp(-1);
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.