Tabnine Logo
Branch.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
net.nemerosa.ontrack.model.structure.Branch

Best Java code snippets using net.nemerosa.ontrack.model.structure.Branch.getId (Showing top 20 results out of 315)

origin: net.nemerosa.ontrack/ontrack-service

protected void doCopyUserBuildFilters(Branch sourceBranch, Branch targetBranch) {
  buildFilterService.copyToBranch(sourceBranch.getId(), targetBranch.getId());
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public Collection<PromotionLevel> getSourceItems() {
  return structureService.getPromotionLevelListForBranch(sourceBranch.getId());
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public Collection<ValidationStamp> getSourceItems() {
  return structureService.getValidationStampListForBranch(sourceBranch.getId());
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public JobRun getTask() {
  return runListener -> syncTemplateDefinition(branch.getId(), runListener);
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public Collection<PromotionLevel> getTargetItems() {
  return structureService.getPromotionLevelListForBranch(targetBranch.getId());
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public Collection<ValidationStamp> getTargetItems() {
  return structureService.getValidationStampListForBranch(targetBranch.getId());
}
origin: net.nemerosa.ontrack/ontrack-extension-svn

protected JobKey getSvnBuildSyncJobKey(Branch branch) {
  return SVN_BUILD_SYNC_JOB.getKey(String.valueOf(branch.getId()));
}
origin: net.nemerosa.ontrack/ontrack-repository-impl

@Override
public List<PromotionRun> getLastPromotionRunsForBuild(Build build) {
  // Branch
  Branch branch = build.getBranch();
  // Promotion levels for the branch
  List<PromotionLevel> promotionLevels = getPromotionLevelListForBranch(branch.getId());
  // Gets the last promotion run for each promotion level
  return promotionLevels.stream()
      .map(promotionLevel -> getLastPromotionRun(build, promotionLevel))
      .filter(Optional::isPresent)
      .map(Optional::get)
      .collect(Collectors.toList());
}
origin: net.nemerosa.ontrack/ontrack-service

  @Override
  public boolean isValid() {
    return super.isValid() &&
        getTemplateDefinition(branch.getId()).isPresent();
  }
};
origin: net.nemerosa.ontrack/ontrack-ui-graphql

private DataFetcher branchPromotionLevelsFetcher() {
  return environment -> {
    Object source = environment.getSource();
    if (source instanceof Branch) {
      Branch branch = (Branch) source;
      return structureService.getPromotionLevelListForBranch(branch.getId());
    } else {
      return Collections.emptyList();
    }
  };
}
origin: net.nemerosa.ontrack/ontrack-extension-svn

  @Override
  public Optional<Build> getEarliestBuild(NoConfig data, Branch branch, SVNLocation location, SVNLocation firstCopy, SVNBranchConfigurationProperty branchConfigurationProperty) {
    // Checks the path
    if (StringUtils.equals(branchConfigurationProperty.getCuredBranchPath(), location.getPath())) {
      String buildName = String.valueOf(location.getRevision());
      return structureService.findBuildAfterUsingNumericForm(branch.getId(), buildName);
    } else {
      return Optional.empty();
    }
  }
}
origin: net.nemerosa.ontrack/ontrack-extension-artifactory

private JobKey getBranchSyncJobKey(Branch branch) {
  return ARTIFACTORY_BUILD_SYNC_JOB.getKey(branch.getId().toString());
}
origin: net.nemerosa.ontrack/ontrack-extension-general

private void onDeleteValidationStamp(Event event) {
  // Gets the validation stamp ID
  int validationStampId = event.getIntValue("validation_stamp_id");
  // Branch
  Branch branch = event.getEntity(ProjectEntityType.BRANCH);
  // Gets all promotion levels for this branch
  List<PromotionLevel> promotionLevels = structureService.getPromotionLevelListForBranch(branch.getId());
  // Checks all promotion levels
  promotionLevels.forEach(promotionLevel -> cleanPromotionLevel(promotionLevel, validationStampId));
}
origin: net.nemerosa.ontrack/ontrack-extension-svn

@Override
public List<LinkDefinition<Branch>> getLinkDefinitions() {
  return Collections.singletonList(
      LinkDefinitions.link(
          "_download",
          branch -> MvcUriComponentsBuilder.on(SVNController.class).download(
              branch.getId(), ""
          ),
          (branch, rc) -> rc.isProjectFunctionGranted(branch, ProjectConfig.class) &&
              svnService.getSVNRepository(branch).isPresent()
      )
  );
}
origin: net.nemerosa.ontrack/ontrack-extension-svn

  @Override
  public Optional<Build> getEarliestBuild(RevisionPattern data, Branch branch, SVNLocation location, SVNLocation firstCopy, SVNBranchConfigurationProperty branchConfigurationProperty) {
    // Checks the path
    if (StringUtils.equals(branchConfigurationProperty.getCuredBranchPath(), location.getPath())) {
      return structureService.findBuild(
          branch.getId(),
          build -> {
            OptionalLong oRevision = getRevision(data, build, branchConfigurationProperty);
            return oRevision.isPresent() && oRevision.getAsLong() >= location.getRevision();
          },
          BuildSortDirection.FROM_OLDEST
      );
    } else {
      return Optional.empty();
    }
  }
}
origin: net.nemerosa.ontrack/ontrack-extension-general

private void onNewValidationRun(Event event) {
  // Passed validation?
  ValidationRun validationRun = event.getEntity(ProjectEntityType.VALIDATION_RUN);
  if (Objects.equals(
      validationRun.getLastStatus().getStatusID(),
      ValidationRunStatusID.STATUS_PASSED)) {
    // Branch
    Branch branch = event.getEntity(ProjectEntityType.BRANCH);
    // Build
    Build build = event.getEntity(ProjectEntityType.BUILD);
    // Gets all promotion levels for this branch
    List<PromotionLevel> promotionLevels = structureService.getPromotionLevelListForBranch(branch.getId());
    // Gets all validation stamps for this branch
    List<ValidationStamp> validationStamps = structureService.getValidationStampListForBranch(branch.getId());
    // Gets the promotion levels which have an auto promotion property
    promotionLevels.forEach(promotionLevel -> checkPromotionLevel(build, promotionLevel, validationStamps));
  }
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public Branch update(Branch branch, BranchBulkUpdateRequest request) {
  // Replacement function
  Function<String, String> replacementFn = replacementFn(request.getReplacements());
  // Description update
  Branch updatedBranch = branch.withDescription(
      replacementFn.apply(branch.getDescription())
  );
  structureService.saveBranch(updatedBranch);
  // Updating
  doCopy(branch, updatedBranch, replacementFn, new SyncPolicy(
      SyncPolicy.TargetPresentPolicy.REPLACE,
      SyncPolicy.UnknownTargetPolicy.IGNORE
  ));
  // Reloads the branch
  return structureService.getBranch(branch.getId());
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public Event deleteBranch(Branch branch) {
  return Event.of(DELETE_BRANCH)
      .withProject(branch.getProject())
      .with("branch", branch.getName())
      .with("branch_id", branch.getId().toString())
      .get();
}
origin: net.nemerosa.ontrack/ontrack-service

protected BranchTemplateSyncResult applyMissingPolicy(Branch branch, TemplateSynchronisationAbsencePolicy absencePolicy) {
  if (branch.isDisabled()) {
    return BranchTemplateSyncResult.ignored(branch.getName());
  } else {
    switch (absencePolicy) {
      case DELETE:
        structureService.deleteBranch(branch.getId());
        return BranchTemplateSyncResult.deleted(branch.getName());
      case DISABLE:
      default:
        structureService.saveBranch(branch.withDisabled(true));
        return BranchTemplateSyncResult.disabled(branch.getName());
    }
  }
}
origin: net.nemerosa.ontrack/ontrack-extension-svn

@Override
public List<Link> links(SVNChangeLog changeLog, ResourceContext resourceContext) {
  return resourceContext.links()
      .link("_revisions", on(SVNController.class).changeLogRevisions(changeLog.getUuid()))
      .link("_issues", on(SVNController.class).changeLogIssues(changeLog.getUuid()), changeLog.getRepository().getConfiguredIssueService() != null)
      .link("_files", on(SVNController.class).changeLogFiles(changeLog.getUuid()))
      .link("_changeLogFileFilters", on(SCMController.class).getChangeLogFileFilters(changeLog.getProject().getId()))
      .link("_diff", on(SVNController.class).diff(null))
      .link("_exportFormats", on(SVNController.class).changeLogExportFormats(changeLog.getBranch().getId()))
      .link("_exportIssues", on(SVNController.class).changeLog(new IssueChangeLogExportRequest()))
      .page(
          "_page",
          "extension/svn/changelog?from=%d&to=%d",
          changeLog.getFrom().getBuild().id(),
          changeLog.getTo().getBuild().id()
      )
      .build();
}
net.nemerosa.ontrack.model.structureBranchgetId

Popular methods of Branch

  • getProject
  • getName
  • getType
  • id
  • of
  • isDisabled
  • projectId
  • withDisabled
  • getDescription
  • getSignature
  • withId
  • <init>
  • withId,
  • <init>,
  • form,
  • withDescription,
  • withSignature,
  • withType

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Notification (javax.management)
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now