Package hudson.model
Class RunMap<R extends Run<?,R>>
- java.lang.Object
-
- java.util.AbstractMap<Integer,R>
-
- jenkins.model.lazy.AbstractLazyLoadRunMap<R>
-
- hudson.model.RunMap<R>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
RunMap.Constructor<R extends Run<?,R>>
Run
factory.-
Nested classes/interfaces inherited from class jenkins.model.lazy.AbstractLazyLoadRunMap
AbstractLazyLoadRunMap.Direction
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Comparable>
COMPARATOR
Deprecated.as of 1.485 UseComparator.reverseOrder()
RunIdMigrator
runIdMigrator
Normally overwritten byLazyBuildMixIn.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)
orLazyBuildMixIn.onCreatedFromScratch()
, in turn created duringJob.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)
.-
Fields inherited from class jenkins.model.lazy.AbstractLazyLoadRunMap
dir
-
-
Constructor Summary
Constructors Constructor Description RunMap()
Deprecated.as of 1.485 UseRunMap(File, Constructor)
.RunMap(File baseDir, RunMap.Constructor cons)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected BuildReference<R>
createReference(R r)
Reuses the same reference as much as we can.R
getById(String id)
protected String
getIdOf(R r)
Subtype to provideRun.getId()
so that this class doesn't have to depend on it.protected int
getNumberOf(R r)
Subtype to provideRun.getNumber()
so that this class doesn't have to depend on it.SortedMap<Integer,R>
getView()
Gets the read-only view of this map.Iterator<R>
iterator()
Walks through builds, newer ones first.void
load(Job job, RunMap.Constructor<R> cons)
Deprecated.as of 1.485 UseRunMap(File, Constructor)
R
newestValue()
This is the newest build (with the biggest build number)R
oldestValue()
This is the oldest build (with the smallest build number)R
put(R r)
Add a new build to the map.boolean
remove(R run)
boolean
removeValue(R run)
protected R
retrieve(File d)
ParsesR
instance from data in the specified directory.-
Methods inherited from class jenkins.model.lazy.AbstractLazyLoadRunMap
_put, baseDirInitialized, comparator, entrySet, equals, firstKey, get, get, getByNumber, getLoadedBuilds, hashCode, headMap, initBaseDir, isEmpty, keySet, lastKey, maxNumberOnDisk, newestBuild, oldestBuild, proposeNewNumber, purgeCache, put, putAll, reset, runExists, search, subMap, tailMap, updateBaseDir, values
-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, remove, size, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, getOrDefault, merge, putIfAbsent, remove, remove, replace, replace, replaceAll, size
-
-
-
-
Field Detail
-
runIdMigrator
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public RunIdMigrator runIdMigrator
Normally overwritten byLazyBuildMixIn.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)
orLazyBuildMixIn.onCreatedFromScratch()
, in turn created duringJob.onLoad(hudson.model.ItemGroup<? extends hudson.model.Item>, java.lang.String)
.
-
COMPARATOR
@Deprecated public static final Comparator<Comparable> COMPARATOR
Deprecated.as of 1.485 UseComparator.reverseOrder()
-
-
Constructor Detail
-
RunMap
@Deprecated public RunMap()
Deprecated.as of 1.485 UseRunMap(File, Constructor)
.
-
RunMap
public RunMap(File baseDir, RunMap.Constructor cons)
- Parameters:
cons
- Used to create new instance ofRun
.
-
-
Method Detail
-
remove
public boolean remove(R run)
-
removeValue
public boolean removeValue(R run)
- Overrides:
removeValue
in classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
newestValue
public R newestValue()
This is the newest build (with the biggest build number)
-
oldestValue
public R oldestValue()
This is the oldest build (with the smallest build number)
-
getNumberOf
protected int getNumberOf(R r)
Description copied from class:AbstractLazyLoadRunMap
Subtype to provideRun.getNumber()
so that this class doesn't have to depend on it.- Specified by:
getNumberOf
in classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
getIdOf
protected String getIdOf(R r)
Description copied from class:AbstractLazyLoadRunMap
Subtype to provideRun.getId()
so that this class doesn't have to depend on it.- Overrides:
getIdOf
in classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
put
public R put(R r)
Add a new build to the map. Do not use when loading existing builds (useAbstractLazyLoadRunMap.put(Integer, Object)
).- Overrides:
put
in classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
getById
public R getById(String id)
- Overrides:
getById
in classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
createReference
protected BuildReference<R> createReference(R r)
Reuses the same reference as much as we can.If concurrency ends up creating a few extra, that's OK, because we are really just trying to reduce the # of references we create.
- Overrides:
createReference
in classAbstractLazyLoadRunMap<R extends Run<?,R>>
-
retrieve
protected R retrieve(File d) throws IOException
Description copied from class:AbstractLazyLoadRunMap
ParsesR
instance from data in the specified directory.- Specified by:
retrieve
in classAbstractLazyLoadRunMap<R extends Run<?,R>>
- Returns:
- null if the parsing failed.
- Throws:
IOException
- if the parsing failed. This is just like returning null except the caller will catch the exception and report it.
-
load
@Deprecated public void load(Job job, RunMap.Constructor<R> cons)
Deprecated.as of 1.485 UseRunMap(File, Constructor)
Backward compatibility method that notifiesRunMap
of who the owner is. Traditionally, this method blocked and loaded all the build records on the disk, but now all the actual loading happens lazily.- Parameters:
job
- Job that owns this map.cons
- Used to create new instance ofRun
.
-
-