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

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

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

origin: net.nemerosa.ontrack/ontrack-extension-general

@Override
public List<Decoration<BranchType>> getDecorations(ProjectEntity entity) {
  if (entity instanceof Branch) {
    Branch branch = (Branch) entity;
    switch (branch.getType()) {
      case TEMPLATE_DEFINITION:
      case TEMPLATE_INSTANCE:
        return Collections.singletonList(
            Decoration.of(
                this,
                branch.getType()
            )
        );
      default:
        // No decoration by default
        return Collections.emptyList();
    }
  } else {
    return Collections.emptyList();
  }
}
origin: net.nemerosa.ontrack/ontrack-extension-artifactory

@Override
public Stream<JobRegistration> collectJobRegistrations() {
  if (artifactoryConfProperties.isBuildSyncDisabled()) {
    return Stream.empty();
  } else {
    return securityService.asAdmin(() ->
        // For all projects...
        structureService.getProjectList().stream()
            // ... and their branches
            .flatMap(project -> structureService.getBranchesForProject(project.getId()).stream())
            // ... only if not a template
            .filter(branch -> branch.getType() != BranchType.TEMPLATE_DEFINITION)
            // ... gets those with the sync. property
            .filter(branch -> propertyService.hasProperty(branch, ArtifactoryPromotionSyncPropertyType.class))
            // ... creates the job
            .map(this::scheduleArtifactoryBuildSync)
    );
  }
}
origin: net.nemerosa.ontrack/ontrack-extension-jenkins

@Override
public List<Decoration<JenkinsJob>> getDecorations(ProjectEntity entity) {
  // Gets the Jenkins Job property for this entity, if any
  Property<JenkinsJobProperty> property = propertyService.getProperty(entity, JenkinsJobPropertyType.class.getName());
  if (property.isEmpty()) {
    return Collections.emptyList();
  } else {
    // Template branch? Decoration cannot be computed
    if (entity instanceof Branch && ((Branch) entity).getType() == BranchType.TEMPLATE_DEFINITION) {
      return Collections.emptyList();
    }
    // Gets a client
    // FIXME getJob does not need a full HTTP client
    JenkinsClient jenkinsClient = jenkinsClientFactory.getClient(property.getValue().getConfiguration());
    // Gets the Jenkins job
    JenkinsJob job = jenkinsClient.getJob(property.getValue().getJob());
    // Gets the decoration for the job
    return Collections.singletonList(
        getDecoration(job)
    );
  }
}
origin: net.nemerosa.ontrack/ontrack-service

else if (existingBranch.get().getType() == BranchType.CLASSIC) {
  throw new BranchClassicCannotBeTemplateInstanceException(branchName);
else if (existingBranch.get().getType() == BranchType.TEMPLATE_DEFINITION) {
  throw new BranchTemplateDefinitionCannotBeTemplateInstanceException(branchName);
} else {
origin: net.nemerosa.ontrack/ontrack-service

if (targetBranch.get().getType() == BranchType.CLASSIC) {
  return BranchTemplateSyncResult.existingClassic(branchName, sourceName);
} else if (targetBranch.get().getType() == BranchType.TEMPLATE_DEFINITION) {
  return BranchTemplateSyncResult.existingDefinition(branchName, sourceName);
} else {
origin: net.nemerosa.ontrack/ontrack-extension-svn

if (branch.getType() != BranchType.TEMPLATE_DEFINITION &&
    propertyService.hasProperty(branch, SVNBranchConfigurationPropertyType.class)) {
origin: net.nemerosa.ontrack/ontrack-service

if (branch.getType() == BranchType.TEMPLATE_INSTANCE) {
  throw new BranchTemplateInstanceException(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);
}
net.nemerosa.ontrack.model.structureBranchgetType

Popular methods of Branch

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • Permission (java.security)
    Legacy security code; do not use.
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for WebStorm
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