Codota Logo
NameDescription.nd
Code IndexAdd Codota to your IDE (free)

How to use
nd
method
in
net.nemerosa.ontrack.model.structure.NameDescription

Best Java code snippets using net.nemerosa.ontrack.model.structure.NameDescription.nd (Showing top 15 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: net.nemerosa.ontrack/ontrack-model

  public NameDescription asNameDescription() {
    return NameDescription.nd(name, description);
  }
}
origin: net.nemerosa.ontrack/ontrack-model

public List<NameDescription> getDetailList() {
  return details.entrySet().stream()
      .map(entry -> NameDescription.nd(entry.getKey(), entry.getValue()))
      .collect(Collectors.toList());
}
origin: net.nemerosa.ontrack/ontrack-it-utils

public ValidationRun doValidateBuild(Build build, String vsName, ValidationRunStatusID statusId) throws Exception {
  ValidationStamp vs = doCreateValidationStamp(build.getBranch(), NameDescription.nd(vsName, ""));
  return doValidateBuild(build, vs, statusId);
}
origin: net.nemerosa.ontrack/ontrack-ui-support

  @Override
  public <T extends ProjectEntity> List<LinkDefinition<T>> getLinkDefinitions(ProjectEntityType projectEntityType) {
    List<LinkDefinition<T>> definitions = new ArrayList<>();
    contributors.forEach(contributor -> {
      if (contributor.applyTo(projectEntityType)) {
        try {
          @SuppressWarnings("unchecked")
          ResourceDecorationContributor<T> tResourceDecorationContributor = (ResourceDecorationContributor<T>) contributor;
          definitions.addAll(tResourceDecorationContributor.getLinkDefinitions());
        } catch (Exception ex) {
          // Logging
          logService.log(
              ApplicationLogEntry.fatal(
                  ex,
                  NameDescription.nd(
                      "ui-resource-decoration",
                      "Issue when collecting UI resource decoration"
                  ),
                  contributor.getClass().getName()
              )
                  .withDetail("ui-resource-type", projectEntityType.name())
                  .withDetail("ui-resource-decorator", contributor.getClass().getName())
          );
        }
      }
    });
    return definitions;
  }
}
origin: net.nemerosa.ontrack/ontrack-service

protected Branch createBranchForTemplateInstance(Branch templateBranch, String branchName) {
  return structureService.newBranch(
      Branch.of(
          templateBranch.getProject(),
          NameDescription.nd(
              NameDescription.escapeName(branchName),
              ""
          )
      )
  );
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public void createTargetItem(PromotionLevel sourcePromotionLevel) {
  PromotionLevel targetPromotionLevel = structureService.newPromotionLevel(
      PromotionLevel.of(
          targetBranch,
          NameDescription.nd(
              sourcePromotionLevel.getName(),
              replacementFn.apply(sourcePromotionLevel.getDescription())
          )
      )
  );
  copyPromotionLevelContent(sourcePromotionLevel, targetPromotionLevel);
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public void createTargetItem(ValidationStamp sourceValidationStamp) {
  ValidationStamp targetValidationStamp = structureService.newValidationStamp(
      ValidationStamp.of(
          targetBranch,
          NameDescription.nd(
              sourceValidationStamp.getName(),
              replacementFn.apply(sourceValidationStamp.getDescription())
          )
      )
  );
  copyValidationStampContent(sourceValidationStamp, targetValidationStamp);
}
origin: net.nemerosa.ontrack/ontrack-extension-general

@Override
public Optional<ValidationStamp> getOrCreateValidationStamp(AutoValidationStampProperty value, Branch branch, String validationStampName) {
  if (value.isAutoCreate()) {
    Optional<PredefinedValidationStamp> oPredefinedValidationStamp = predefinedValidationStampService.findPredefinedValidationStampByName(validationStampName);
    if (oPredefinedValidationStamp.isPresent()) {
      // Creates the validation stamp
      return Optional.of(
          securityService.asAdmin(() ->
              structureService.newValidationStampFromPredefined(
                  branch,
                  oPredefinedValidationStamp.get()
              )
          )
      );
    } else if (value.isAutoCreateIfNotPredefined()) {
      // Creates a validation stamp even without a predefined one
      return Optional.of(
          securityService.asAdmin(() ->
              structureService.newValidationStamp(
                  ValidationStamp.of(
                      branch,
                      NameDescription.nd(validationStampName, "Validation automatically created on demand.")
                  )
              )
          )
      );
    }
  }
  return Optional.empty();
}
origin: net.nemerosa.ontrack/ontrack-it-utils

protected AccountGroup doCreateAccountGroup() throws Exception {
  return asUser().with(AccountGroupManagement.class).call(() -> {
    String name = uid("G");
    return accountService.createGroup(
        NameDescription.nd(name, "")
    );
  });
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public Project cloneProject(Project sourceProject, ProjectCloneRequest request) {
  // Replacement function
  Function<String, String> replacementFn = replacementFn(request.getReplacements());
  // Description of the target project
  String targetProjectDescription = replacementFn.apply(sourceProject.getDescription());
  // Creates the project
  Project targetProject = structureService.newProject(
      Project.of(
          NameDescription.nd(request.getName(), targetProjectDescription)
      )
  );
  // Copies the properties for the project
  doCopyProperties(sourceProject, targetProject, replacementFn, SyncPolicy.COPY);
  // Creates a copy of the branch
  Branch sourceBranch = structureService.getBranch(request.getSourceBranchId());
  String targetBranchName = replacementFn.apply(sourceBranch.getName());
  String targetBranchDescription = replacementFn.apply(sourceBranch.getDescription());
  Branch targetBranch = structureService.newBranch(
      Branch.of(
          targetProject,
          NameDescription.nd(targetBranchName, targetBranchDescription)
      )
  );
  // Configuration of the new branch
  doCopy(sourceBranch, targetBranch, replacementFn, SyncPolicy.COPY);
  // OK
  return targetProject;
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public Branch cloneBranch(Branch sourceBranch, BranchCloneRequest request) {
  // Replacement function
  Function<String, String> replacementFn = replacementFn(request.getReplacements());
  // Description of the target branch
  String targetDescription = replacementFn.apply(sourceBranch.getDescription());
  // Creates the branch
  Branch targetBranch = structureService.newBranch(
      Branch.of(
          sourceBranch.getProject(),
          NameDescription.nd(request.getName(), targetDescription)
      )
  );
  // Copies the configuration
  doCopy(sourceBranch, targetBranch, replacementFn, SyncPolicy.COPY);
  // OK
  return targetBranch;
}
origin: net.nemerosa.ontrack/ontrack-repository-impl

dateTimeFromDB(rs.getString("TIMESTAMP")),
rs.getString("AUTHENTICATION"),
NameDescription.nd(
    rs.getString("NAME"),
    rs.getString("DESCRIPTION")
origin: net.nemerosa.ontrack/ontrack-extension-ldap

ApplicationLogEntry.error(
    ex,
    NameDescription.nd(
        "ldap-authentication",
        "LDAP Authentication problem"
origin: net.nemerosa.ontrack/ontrack-extension-github

  @Override
  protected ConnectionResult validate(GitHubEngineConfiguration configuration) {
    try {
      // Gets the client
      OntrackGitHubClient client = gitHubClientFactory.create(configuration);
      // Gets the list of repositories
      client.getRepositories();
      // OK
      return ConnectionResult.ok();
    } catch (Exception ex) {
      applicationLogService.log(
          ApplicationLogEntry.error(
              ex,
              NameDescription.nd("github", "GitHub connection issue"),
              configuration.getUrl()
          )
              .withDetail("github-config-name", configuration.getName())
              .withDetail("github-config-url", configuration.getUrl())
      );
      return ConnectionResult.error(ex.getMessage());
    }
  }
}
origin: net.nemerosa.ontrack/ontrack-extension-gitlab

  @Override
  protected ConnectionResult validate(GitLabConfiguration configuration) {
    try {
      // Gets the client
      OntrackGitLabClient client = gitLabClientFactory.create(configuration);
      // Gets the list of repositories
      client.getRepositories();
      // OK
      return ConnectionResult.ok();
    } catch (Exception ex) {
      applicationLogService.log(
          ApplicationLogEntry.error(
              ex,
              NameDescription.nd("gitlab", "GitLab connection issue"),
              configuration.getUrl()
          )
              .withDetail("gitlab-config-name", configuration.getName())
              .withDetail("gitlab-config-url", configuration.getUrl())
      );
      return ConnectionResult.error(ex.getMessage());
    }
  }
}
net.nemerosa.ontrack.model.structureNameDescriptionnd

Javadoc

Simple builder

Popular methods of NameDescription

  • <init>
  • getDescription
  • getName
  • asState
  • escapeName
    Makes sure the given name is escaped properly before being used as a valid name.

Popular in Java

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now