hudson.model.Fingerprint.getOriginal()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(13.1k)|赞(0)|评价(0)|浏览(123)

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

Fingerprint.getOriginal介绍

[英]The first build in which this file showed up, if the file looked like it's created there.

This is considered as the "source" of this file, or the owner, in the sense that this project "owns" this file.
[中]显示此文件的第一个版本,如果该文件看起来像是在那里创建的。
从这个项目“拥有”这个文件的意义上说,这被认为是这个文件的“来源”,或者说是所有者。

代码示例

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

/**
 * Gets the dependency relationship from this build (as the sink)
 * and that project (as the source.)
 *
 * @return
 *      Build number of the upstream build that feed into this build,
 *      or -1 if no record is available (for example if there is no {@link FingerprintAction}, even if there is an {@link Cause.UpstreamCause}).
 */
public int getUpstreamRelationship(AbstractProject that) {
  FingerprintAction f = getAction(FingerprintAction.class);
  if (f==null)     return -1;
  int n = -1;
  // look for fingerprints that point to the given project as the source, and merge them all
  for (Fingerprint e : f.getFingerprints().values()) {
    if (upstreamCulprits) {
      // With upstreamCulprits, we allow upstream relationships
      // from intermediate jobs
      Fingerprint.RangeSet rangeset = e.getRangeSet(that);
      if (!rangeset.isEmpty()) {
        n = Math.max(n, rangeset.listNumbersReverse().iterator().next());
      }
    } else {
      BuildPtr o = e.getOriginal();
      if (o!=null && o.belongsTo(that))
        n = Math.max(n,o.getNumber());
    }
  }
  return n;
}

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

BuildPtr bp = fp.getOriginal();
if(bp==null)    continue;       // outside Hudson
if(bp.is(build))    continue;   // we are the owner

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

/**
 * Gets the dependency relationship from this build (as the source)
 * and that project (as the sink.)
 *
 * @return
 *      range of build numbers that represent which downstream builds are using this build.
 *      The range will be empty if no build of that project matches this (or there is no {@link FingerprintAction}), but it'll never be null.
 */
public RangeSet getDownstreamRelationship(AbstractProject that) {
  RangeSet rs = new RangeSet();
  FingerprintAction f = getAction(FingerprintAction.class);
  if (f==null)     return rs;
  // look for fingerprints that point to this build as the source, and merge them all
  for (Fingerprint e : f.getFingerprints().values()) {
    if (upstreamCulprits) {
      // With upstreamCulprits, we allow downstream relationships
      // from intermediate jobs
      rs.add(e.getRangeSet(that));
    } else {
      BuildPtr o = e.getOriginal();
      if (o!=null && o.is(this))
        rs.add(e.getRangeSet(that));
    }
  }
  return rs;
}

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

/**
   * Gets the dependency to other builds in a map.
   * Returns build numbers instead of {@link Build}, since log records may be gone.
   */
  public Map<AbstractProject,Integer> getDependencies() {
    Map<AbstractProject,Integer> r = new HashMap<AbstractProject,Integer>();
    for (Fingerprint fp : getFingerprints().values()) {
      BuildPtr bp = fp.getOriginal();
      if(bp==null)    continue;       // outside Hudson
      if(bp.is(build))    continue;   // we are the owner
      AbstractProject job = bp.getJob();
      if (job==null)  continue;   // no longer exists
      if (job.getParent()==build.getParent())
        continue;   // we are the parent of the build owner, that is almost like we are the owner 
      Integer existing = r.get(job);
      if(existing!=null && existing>bp.getNumber())
        continue;   // the record in the map is already up to date
      r.put(job,bp.getNumber());
    }
    
    return r;
  }
}

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

/**
 * Gets the dependency relationship from this build (as the sink)
 * and that project (as the source.)
 *
 * @return
 *      Build number of the upstream build that feed into this build,
 *      or -1 if no record is available.
 */
public int getUpstreamRelationship(AbstractProject that) {
  FingerprintAction f = getAction(FingerprintAction.class);
  if (f==null)     return -1;
  int n = -1;
  // look for fingerprints that point to the given project as the source, and merge them all
  for (Fingerprint e : f.getFingerprints().values()) {
    if (upstreamCulprits) {
      // With upstreamCulprits, we allow upstream relationships
      // from intermediate jobs
      Fingerprint.RangeSet rangeset = e.getRangeSet(that);
      if (!rangeset.isEmpty()) {
        n = Math.max(n, rangeset.listNumbersReverse().iterator().next());
      }
    } else {
      BuildPtr o = e.getOriginal();
      if (o!=null && o.belongsTo(that))
        n = Math.max(n,o.getNumber());
    }
  }
  return n;
}

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

/**
 * Gets the dependency relationship from this build (as the sink)
 * and that project (as the source.)
 *
 * @return
 *      Build number of the upstream build that feed into this build,
 *      or -1 if no record is available (for example if there is no {@link FingerprintAction}, even if there is an {@link Cause.UpstreamCause}).
 */
public int getUpstreamRelationship(AbstractProject that) {
  FingerprintAction f = getAction(FingerprintAction.class);
  if (f==null)     return -1;
  int n = -1;
  // look for fingerprints that point to the given project as the source, and merge them all
  for (Fingerprint e : f.getFingerprints().values()) {
    if (upstreamCulprits) {
      // With upstreamCulprits, we allow upstream relationships
      // from intermediate jobs
      Fingerprint.RangeSet rangeset = e.getRangeSet(that);
      if (!rangeset.isEmpty()) {
        n = Math.max(n, rangeset.listNumbersReverse().iterator().next());
      }
    } else {
      BuildPtr o = e.getOriginal();
      if (o!=null && o.belongsTo(that))
        n = Math.max(n,o.getNumber());
    }
  }
  return n;
}

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

/**
 * Gets the dependency relationship from this build (as the sink)
 * and that project (as the source.)
 *
 * @return
 *      Build number of the upstream build that feed into this build,
 *      or -1 if no record is available.
 */
public int getUpstreamRelationship(AbstractProject that) {
  FingerprintAction f = getAction(FingerprintAction.class);
  if (f==null)     return -1;
  int n = -1;
  // look for fingerprints that point to the given project as the source, and merge them all
  for (Fingerprint e : f.getFingerprints().values()) {
    if (upstreamCulprits) {
      // With upstreamCulprits, we allow upstream relationships
      // from intermediate jobs
      Fingerprint.RangeSet rangeset = e.getRangeSet(that);
      if (!rangeset.isEmpty()) {
        n = Math.max(n, rangeset.listNumbersReverse().iterator().next());
      }
    } else {
      BuildPtr o = e.getOriginal();
      if (o!=null && o.belongsTo(that))
        n = Math.max(n,o.getNumber());
    }
  }
  return n;
}

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

BuildPtr o = e.getOriginal();
if (o != null && o.belongsTo(that)) {
  n = Math.max(n, o.getNumber());

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

/**
   * Gets the dependency to other builds in a map.
   * Returns build numbers instead of {@link Build}, since log records may be gone.
   */
  public Map<AbstractProject,Integer> getDependencies() {
    Map<AbstractProject,Integer> r = new HashMap<AbstractProject,Integer>();
    for (Fingerprint fp : getFingerprints().values()) {
      BuildPtr bp = fp.getOriginal();
      if(bp==null)    continue;       // outside Hudson
      if(bp.is(build))    continue;   // we are the owner
      AbstractProject job = bp.getJob();
      if (job==null)  continue;   // no longer exists
      if (job.getParent()==build.getParent())
        continue;   // we are the parent of the build owner, that is almost like we are the owner 
      Integer existing = r.get(job);
      if(existing!=null && existing>bp.getNumber())
        continue;   // the record in the map is already up to date
      r.put(job,bp.getNumber());
    }
    
    return r;
  }
}

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

/**
   * Gets the dependency to other builds in a map.
   * Returns build numbers instead of {@link Build}, since log records may be gone.
   */
  public Map<AbstractProject,Integer> getDependencies() {
    Map<AbstractProject,Integer> r = new HashMap<AbstractProject,Integer>();
    for (Fingerprint fp : getFingerprints().values()) {
      BuildPtr bp = fp.getOriginal();
      if(bp==null)    continue;       // outside Hudson
      if(bp.is(build))    continue;   // we are the owner
      AbstractProject job = bp.getJob();
      if (job==null)  continue;   // no longer exists
      if (job.getParent()==build.getParent())
        continue;   // we are the parent of the build owner, that is almost like we are the owner 
      Integer existing = r.get(job);
      if(existing!=null && existing>bp.getNumber())
        continue;   // the record in the map is already up to date
      r.put(job,bp.getNumber());
    }
    
    return r;
  }
}

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

/**
 * Gets the dependency relationship from this build (as the sink)
 * and that project (as the source.)
 *
 * @return
 *      Build number of the upstream build that feed into this build,
 *      or -1 if no record is available.
 */
public int getUpstreamRelationship(AbstractProject that) {
  FingerprintAction f = getAction(FingerprintAction.class);
  if (f==null)     return -1;
  int n = -1;
  // look for fingerprints that point to the given project as the source, and merge them all
  for (Fingerprint e : f.getFingerprints().values()) {
    if (upstreamCulprits) {
      // With upstreamCulprits, we allow upstream relationships
      // from intermediate jobs
      Fingerprint.RangeSet rangeset = e.getRangeSet(that);
      if (!rangeset.isEmpty()) {
        n = Math.max(n, rangeset.listNumbersReverse().iterator().next());
      }
    } else {
      BuildPtr o = e.getOriginal();
      if (o!=null && o.belongsTo(that))
        n = Math.max(n,o.getNumber());
    }
  }
  return n;
}

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

/**
   * Gets the dependency to other builds in a map. Returns build numbers
   * instead of {@link Build}, since log records may be gone.
   */
  public Map<AbstractProject, Integer> getDependencies() {
    Map<AbstractProject, Integer> r = new HashMap<AbstractProject, Integer>();
    for (Fingerprint fp : getFingerprints().values()) {
      BuildPtr bp = fp.getOriginal();
      if (bp == null) {
        continue;       // outside Hudson
      }
      if (bp.is(build)) {
        continue;   // we are the owner
      }
      AbstractProject job = bp.getJob();
      if (job == null) {
        continue;   // no longer exists
      }
      if (job.getParent() == build.getParent()) {
        continue;   // we are the parent of the build owner, that is almost like we are the owner 
      }
      Integer existing = r.get(job);
      if (existing != null && existing > bp.getNumber()) {
        continue;   // the record in the map is already up to date
      }
      r.put(job, bp.getNumber());
    }
    return r;
  }
}

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

BuildPtr bp = fp.getOriginal();
if(bp==null)    continue;       // outside Hudson
if(bp.is(build))    continue;   // we are the owner

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

/**
 * Gets the dependency relationship from this build (as the source)
 * and that project (as the sink.)
 *
 * @return
 *      range of build numbers that represent which downstream builds are using this build.
 *      The range will be empty if no build of that project matches this (or there is no {@link FingerprintAction}), but it'll never be null.
 */
public RangeSet getDownstreamRelationship(AbstractProject that) {
  RangeSet rs = new RangeSet();
  FingerprintAction f = getAction(FingerprintAction.class);
  if (f==null)     return rs;
  // look for fingerprints that point to this build as the source, and merge them all
  for (Fingerprint e : f.getFingerprints().values()) {
    if (upstreamCulprits) {
      // With upstreamCulprits, we allow downstream relationships
      // from intermediate jobs
      rs.add(e.getRangeSet(that));
    } else {
      BuildPtr o = e.getOriginal();
      if (o!=null && o.is(this))
        rs.add(e.getRangeSet(that));
    }
  }
  return rs;
}

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

/**
 * Gets the dependency relationship from this build (as the source)
 * and that project (as the sink.)
 *
 * @return
 *      range of build numbers that represent which downstream builds are using this build.
 *      The range will be empty if no build of that project matches this, but it'll never be null.
 */
public RangeSet getDownstreamRelationship(AbstractProject that) {
  RangeSet rs = new RangeSet();
  FingerprintAction f = getAction(FingerprintAction.class);
  if (f==null)     return rs;
  // look for fingerprints that point to this build as the source, and merge them all
  for (Fingerprint e : f.getFingerprints().values()) {
    if (upstreamCulprits) {
      // With upstreamCulprits, we allow downstream relationships
      // from intermediate jobs
      rs.add(e.getRangeSet(that));
    } else {
      BuildPtr o = e.getOriginal();
      if (o!=null && o.is(this))
        rs.add(e.getRangeSet(that));
    }
  }
  return rs;
}

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

/**
 * Gets the dependency relationship from this build (as the source)
 * and that project (as the sink.)
 *
 * @return
 *      range of build numbers that represent which downstream builds are using this build.
 *      The range will be empty if no build of that project matches this, but it'll never be null.
 */
public RangeSet getDownstreamRelationship(AbstractProject that) {
  RangeSet rs = new RangeSet();
  FingerprintAction f = getAction(FingerprintAction.class);
  if (f==null)     return rs;
  // look for fingerprints that point to this build as the source, and merge them all
  for (Fingerprint e : f.getFingerprints().values()) {
    if (upstreamCulprits) {
      // With upstreamCulprits, we allow downstream relationships
      // from intermediate jobs
      rs.add(e.getRangeSet(that));
    } else {
      BuildPtr o = e.getOriginal();
      if (o!=null && o.is(this))
        rs.add(e.getRangeSet(that));
    }
  }
  return rs;
}

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

/**
 * Gets the dependency relationship from this build (as the source)
 * and that project (as the sink.)
 *
 * @return
 *      range of build numbers that represent which downstream builds are using this build.
 *      The range will be empty if no build of that project matches this, but it'll never be null.
 */
public RangeSet getDownstreamRelationship(AbstractProject that) {
  RangeSet rs = new RangeSet();
  FingerprintAction f = getAction(FingerprintAction.class);
  if (f==null)     return rs;
  // look for fingerprints that point to this build as the source, and merge them all
  for (Fingerprint e : f.getFingerprints().values()) {
    if (upstreamCulprits) {
      // With upstreamCulprits, we allow downstream relationships
      // from intermediate jobs
      rs.add(e.getRangeSet(that));
    } else {
      BuildPtr o = e.getOriginal();
      if (o!=null && o.is(this))
        rs.add(e.getRangeSet(that));
    }
  }
  return rs;
}

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

/**
 * Gets the dependency relationship from this build (as the source) and that
 * project (as the sink.)
 *
 * @return range of build numbers that represent which downstream builds are
 * using this build. The range will be empty if no build of that project
 * matches this, but it'll never be null.
 */
public RangeSet getDownstreamRelationship(AbstractProject that) {
  RangeSet rs = new RangeSet();
  FingerprintAction f = getAction(FingerprintAction.class);
  if (f == null) {
    return rs;
  }
  // look for fingerprints that point to this build as the source, and merge them all
  for (Fingerprint e : f.getFingerprints().values()) {
    if (upstreamCulprits) {
      // With upstreamCulprits, we allow downstream relationships
      // from intermediate jobs
      rs.add(e.getRangeSet(that));
    } else {
      BuildPtr o = e.getOriginal();
      if (o != null && o.is(this)) {
        rs.add(e.getRangeSet(that));
      }
    }
  }
  return rs;
}

相关文章