hudson.model.Project.getParent()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中hudson.model.Project.getParent()方法的一些代码示例,展示了Project.getParent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getParent()方法的具体详情如下:
包路径:hudson.model.Project
类名称:Project
方法名:getParent

Project.getParent介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

private void locationChanged(Item item, String oldFullName, String newFullName) {
    // update BuildTrigger of other projects that point to this object.
    // can't we generalize this?
    for( Project<?,?> p : Jenkins.getInstance().allItems(Project.class) ) {
      BuildTrigger t = p.getPublishersList().get(BuildTrigger.class);
      if(t!=null) {
        String cp2 = Items.computeRelativeNamesAfterRenaming(oldFullName, newFullName, t.childProjects, p.getParent());
        if (!cp2.equals(t.childProjects)) {
          t.childProjects = cp2;
          try {
            p.save();
          } catch (IOException e) {
            LOGGER.log(Level.WARNING, "Failed to persist project setting during rename from "+oldFullName+" to "+newFullName,e);
          }
        }
      }
    }
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

@Override
public MatrixProject getParent() {
  return (MatrixProject)super.getParent();
}

代码示例来源:origin: org.jenkins-ci.plugins/matrix-project

@Override
public MatrixProject getParent() {
  return (MatrixProject)super.getParent();
}

代码示例来源:origin: hudson/hudson-2.x

@Override
public MatrixProject getParent() {
  return (MatrixProject)super.getParent();
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

@Override
public MatrixProject getParent() {
  return (MatrixProject)super.getParent();
}

代码示例来源:origin: etsy/jenkins-master-project

@Override
public Hudson getParent() {
 return (Hudson) super.getParent();
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

@Override
public MatrixProject getParent() {
  return (MatrixProject) super.getParent();
}

代码示例来源:origin: jenkinsci/parameterized-trigger-plugin

/**
* removes the project references within all {@link TriggerBuilder}s which are wrapped by a conditional buildsteps
* @param p the project the check
* @param oldName the old project name
* @return whether a change has been made
*/
private boolean deleteInConditionalBuildStep(Project<?,?> p, String oldName) {
  boolean changed = false;
  final List<TriggerBuilder> containedBuilders = ConditionalBuildStepHelper.getContainedBuilders(p, TriggerBuilder.class);
  for (TriggerBuilder triggerBuilder : containedBuilders) {
    for (ListIterator<BlockableBuildTriggerConfig> bbtc = triggerBuilder.getConfigs().listIterator(); bbtc.hasNext();) {
      BuildTriggerConfig c = bbtc.next();
      if (c.onDeleted(p.getParent(), oldName)) {
        changed = true;
        if (c.getProjects().length() == 0){
          bbtc.remove();
        }
      }
    }
  }
  return changed;
}

代码示例来源:origin: jenkinsci/parameterized-trigger-plugin

/**
* renames the project references within all {@link TriggerBuilder}s which are wrapped by a conditional buildsteps
* @param p the project the check
* @param oldName the old project name
* @param newName the new project name
* @return whether a change has been made
*/
private boolean renameInConditionalBuildStep(Project<?,?> p, String oldName, String newName) {
  boolean changed = false;
  final List<TriggerBuilder> containedBuilders = ConditionalBuildStepHelper.getContainedBuilders(p, TriggerBuilder.class);
  for (TriggerBuilder triggerBuilder : containedBuilders) {
    for (BuildTriggerConfig co : triggerBuilder.getConfigs()){
      changed |= co.onJobRenamed(p.getParent(), oldName, newName);
    }
  }
  return changed;
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

private void locationChanged(Item item, String oldFullName, String newFullName) {
    // update BuildTrigger of other projects that point to this object.
    // can't we generalize this?
    for( Project<?,?> p : Jenkins.getInstance().allItems(Project.class) ) {
      BuildTrigger t = p.getPublishersList().get(BuildTrigger.class);
      if(t!=null) {
        String cp2 = Items.computeRelativeNamesAfterRenaming(oldFullName, newFullName, t.childProjects, p.getParent());
        if (!cp2.equals(t.childProjects)) {
          t.childProjects = cp2;
          try {
            p.save();
          } catch (IOException e) {
            LOGGER.log(Level.WARNING, "Failed to persist project setting during rename from "+oldFullName+" to "+newFullName,e);
          }
        }
      }
    }
  }
}

代码示例来源:origin: jenkinsci/parameterized-trigger-plugin

for (ListIterator<BuildTriggerConfig> btc = bt.getConfigs().listIterator(); btc.hasNext();) {
  BuildTriggerConfig c = btc.next();
  if (c.onDeleted(p.getParent(), oldName)) {
    changed = true;
    if (c.getProjects().length() == 0){
for (ListIterator<BlockableBuildTriggerConfig> bbtc = tb.getConfigs().listIterator(); bbtc.hasNext();) {
  BuildTriggerConfig c = bbtc.next();
  if (c.onDeleted(p.getParent(), oldName)) {
    changed = true;
    if (c.getProjects().length() == 0){

代码示例来源:origin: jenkinsci/parameterized-trigger-plugin

if (bt != null) {
  for (BuildTriggerConfig c : bt.getConfigs()){
    changed |= c.onJobRenamed(p.getParent(), fullOldName, fullNewName);
if (tb != null) {
  for (BuildTriggerConfig co : tb.getConfigs()){
    changed |= co.onJobRenamed(p.getParent(), fullOldName, fullNewName);

相关文章