congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Branch.getName
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: net.nemerosa.ontrack/ontrack-model

@NotNull
@Override
@JsonIgnore
public Map<String, String> getRunMetricTags() {
  return ImmutableMap.of(
      "project", branch.getProject().getName(),
      "branch", branch.getName()
  );
}
origin: net.nemerosa.ontrack/ontrack-extension-svn

@Override
public String getDescription() {
  return String.format(
      "Synchronisation of builds with SVN for branch %s/%s",
      branch.getProject().getName(),
      branch.getName()
  );
}
origin: net.nemerosa.ontrack/ontrack-model

@Override
public String getEntityDisplayName() {
  return String.format("Build %s/%s/%s", branch.getProject().getName(), branch.getName(), name);
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public String getDescription() {
  return format(
      "Template sync. from %s/%s",
      branch.getProject().getName(),
      branch.getName()
  );
}
origin: net.nemerosa.ontrack/ontrack-model

@Override
public String getEntityDisplayName() {
  return String.format("Promotion level %s/%s/%s", branch.getProject().getName(), branch.getName(), name);
}
origin: net.nemerosa.ontrack/ontrack-model

@Override
public String getEntityDisplayName() {
  return String.format("Validation stamp %s/%s/%s", branch.getProject().getName(), branch.getName(), name);
}
origin: net.nemerosa.ontrack/ontrack-model

@Override
public boolean isValid() {
  return structureService.findBranchByName(branch.getProject().getName(), branch.getName()).isPresent();
}
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-model

@NotNull
@Override
@JsonIgnore
public Map<String, String> getRunMetricTags() {
  return ImmutableMap.of(
      "project", validationStamp.getBranch().getProject().getName(),
      "branch", validationStamp.getBranch().getName(),
      "validationStamp", validationStamp.getName(),
      "status", getLastStatusId()
  );
}
origin: net.nemerosa.ontrack/ontrack-ui-graphql

private DataFetcher branchValidationStampsFetcher() {
  return environment -> {
    Object source = environment.getSource();
    Optional<String> name = GraphqlUtils.getStringArgument(environment, "name");
    if (source instanceof Branch) {
      Branch branch = (Branch) source;
      if (name.isPresent()) {
        return structureService.findValidationStampByName(
            branch.getProject().getName(), branch.getName(), name.get()
        )
            .map(Collections::singletonList)
            .orElse(Collections.emptyList());
      } else {
        return structureService.getValidationStampListForBranch(branch.getId());
      }
    } else {
      return Collections.emptyList();
    }
  };
}
origin: net.nemerosa.ontrack/ontrack-extension-svn

protected Optional<Build> getEarliestBuild(T data, Branch branch, SVNLocation location, SVNBranchConfigurationProperty branchConfigurationProperty) {
  return extractBuildName(data, location.getPath(), branch, branchConfigurationProperty)
      .flatMap(buildName ->
              structureService.findBuildByName(
                  branch.getProject().getName(),
                  branch.getName(),
                  buildName
              )
      );
}
origin: net.nemerosa.ontrack/ontrack-extension-general

@Override
public AutoPromotionProperty copy(ProjectEntity sourceEntity, AutoPromotionProperty value, ProjectEntity targetEntity, Function<String, String> replacementFn) {
  PromotionLevel targetPromotionLevel = (PromotionLevel) targetEntity;
  return new AutoPromotionProperty(
      value.getValidationStamps().stream()
          .map(vs -> structureService.findValidationStampByName(
              targetPromotionLevel.getBranch().getProject().getName(),
              targetPromotionLevel.getBranch().getName(),
              vs.getName()
          ))
          .filter(Optional::isPresent)
          .map(Optional::get)
          .collect(Collectors.toList()),
      value.getInclude(),
      value.getExclude()
  );
}
origin: net.nemerosa.ontrack/ontrack-extension-svn

private Optional<Build> createBuild(String tagsPath, SVNSyncProperty syncProperty, Branch branch, TCopyEvent copy, ConfiguredBuildSvnRevisionLink<?> revisionLink, SVNRepository repository) {
  // Extracts the build name from the copyTo path
  return getBuildNameFromPath(tagsPath, revisionLink, copy.copyToLocation())
      .flatMap(buildName -> {
        // Gets an existing build if any
        Optional<Build> build = structureService.findBuildByName(branch.getProject().getName(), branch.getName(), buildName);
        // If none exists, just creates it
        if (!build.isPresent()) {
          logger.debug("[svn-sync] Build {} does not exist - creating.", buildName);
          return Optional.of(doCreateBuild(branch, copy, buildName, repository));
        }
        // If Ok to override, deletes it and creates it
        else if (syncProperty.isOverride()) {
          logger.debug("[svn-sync] Build {} already exists - overriding.", buildName);
          // Deletes the build
          structureService.deleteBuild(build.get().getId());
          // Creates the build
          return Optional.of(doCreateBuild(branch, copy, buildName, repository));
        }
        // Else, just puts some log entry
        else {
          logger.debug("[svn-sync] Build {} already exists - not overriding.", buildName);
          return Optional.empty();
        }
      });
}
origin: net.nemerosa.ontrack/ontrack-model

@Override
public String getEntityDisplayName() {
  return String.format("Promotion run %s/%s/%s/%s",
      build.getBranch().getProject().getName(),
      build.getBranch().getName(),
      build.getName(),
      promotionLevel.getName()
  );
}
origin: net.nemerosa.ontrack/ontrack-model

@Override
public String getEntityDisplayName() {
  return String.format("Validation run %s#%d for %s/%s/%s",
      validationStamp.getName(),
      runOrder,
      build.getBranch().getProject().getName(),
      build.getBranch().getName(),
      build.getName()
  );
}
origin: net.nemerosa.ontrack/ontrack-repository-impl

@Override
public void saveBranch(Branch branch) {
  // Update
  try {
    getNamedParameterJdbcTemplate().update(
        "UPDATE BRANCHES SET NAME = :name, DESCRIPTION = :description, DISABLED = :disabled WHERE ID = :id",
        params("name", branch.getName())
            .addValue("description", branch.getDescription())
            .addValue("disabled", branch.isDisabled())
            .addValue("id", branch.id())
    );
  } catch (DuplicateKeyException ex) {
    throw new BranchNameAlreadyDefinedException(branch.getName());
  }
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public Branch connectTemplateInstance(ID branchId, BranchTemplateInstanceConnectRequest request) {
  // Gets the branch
  Branch branch = structureService.getBranch(branchId);
  // Checks it is not connected yet
  if (branch.getType() != BranchType.CLASSIC) {
    throw new BranchCannotConnectToTemplateException(branch.getName());
  }
  // Checks the rights
  securityService.checkProjectFunction(branch, BranchTemplateMgt.class);
  // Gets the template definition
  ID templateId = ID.of(request.getTemplateId());
  TemplateDefinition templateDefinition = getTemplateDefinition(templateId)
      .orElseThrow(() -> new BranchNotTemplateDefinitionException(templateId));
  // Loads the branch template
  Branch template = structureService.getBranch(templateId);
  // Update request
  BranchTemplateInstanceSingleRequest instanceSingleRequest = new BranchTemplateInstanceSingleRequest(
      branch.getName(),
      request.isManual(),
      request.getParameters()
  );
  // Updates the instance
  updateTemplateInstance(branch.getName(), branch, template, instanceSingleRequest, templateDefinition);
  // OK
  return structureService.getBranch(branchId);
}
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-extension-svn

protected String getSVNBuildPath(Build build) {
  // Gets the build path property value
  Property<SVNBranchConfigurationProperty> branchConfiguration = propertyService.getProperty(
      build.getBranch(),
      SVNBranchConfigurationPropertyType.class
  );
  if (branchConfiguration.isEmpty()) {
    throw new MissingSVNBranchConfigurationException(build.getBranch().getName());
  } else {
    // Gets the build revision link
    ConfiguredBuildSvnRevisionLink<Object> revisionLink = buildSvnRevisionLinkService.getConfiguredBuildSvnRevisionLink(
        branchConfiguration.getValue().getBuildRevisionLink()
    );
    // Gets the path to the build
    return revisionLink.getBuildPath(build, branchConfiguration.getValue());
  }
}
origin: net.nemerosa.ontrack/ontrack-repository-impl

@Override
public Branch newBranch(Branch branch) {
  // Creation
  try {
    int id = dbCreate(
        "INSERT INTO BRANCHES(PROJECTID, NAME, DESCRIPTION, DISABLED, CREATION, CREATOR) VALUES (:projectId, :name, :description, :disabled, :creation, :creator)",
        params("name", branch.getName())
            .addValue("description", branch.getDescription())
            .addValue("disabled", branch.isDisabled())
            .addValue("projectId", branch.getProject().id())
            .addValue("creation", dateTimeForDB(branch.getSignature().getTime()))
            .addValue("creator", branch.getSignature().getUser().getName())
    );
    // Returns with ID
    return branch.withId(id(id));
  } catch (DuplicateKeyException ex) {
    throw new BranchNameAlreadyDefinedException(branch.getName());
  }
}
net.nemerosa.ontrack.model.structureBranchgetName

Popular methods of Branch

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

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • runOnUiThread (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Option (scala)
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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