public abstract class SCMHeadMigration<S extends SCMSource,H extends SCMHead,R extends SCMRevision> extends Object implements ExtensionPoint
SCMSource plugin needs to migrate the implementation classes for SCMHead this extension
point allows the plugin to register type migrations. For speed of migration implementations should just jump directly
to the final end-point and not expect recursive chain walking.ExtensionPoint.LegacyInstancesAreScopedToHudson| Modifier | Constructor and Description |
|---|---|
protected |
SCMHeadMigration(Class<S> sourceClass,
Class<H> headClass,
Class<R> revisionClass)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Class<H> |
getSCMHeadClass()
Gets the
SCMHead that the migration applies to. |
Class<R> |
getSCMRevisionClass()
Gets the
SCMRevision that the migration applies to. |
Class<S> |
getSCMSourceClass()
Gets the
SCMSource that the migration applies to. |
abstract SCMHead |
migrate(S source,
H head)
Perform a migration.
|
SCMRevision |
migrate(S source,
R revision)
Perform a migration.
|
static SCMHead |
readResolveSCMHead(SCMSource source,
SCMHead head)
Perform a migration.
|
static SCMRevision |
readResolveSCMRevision(SCMSource source,
SCMRevision revision)
Perform a migration.
|
protected SCMHeadMigration(Class<S> sourceClass, Class<H> headClass, Class<R> revisionClass)
sourceClass - the SCMSource that the migration applies to.headClass - the SCMHead that the migration applies to.revisionClass - the SCMRevision that the migration applies to.public final Class<S> getSCMSourceClass()
SCMSource that the migration applies to.SCMSource that the migration applies to.public final Class<H> getSCMHeadClass()
SCMHead that the migration applies to.SCMHead that the migration applies to.public final Class<R> getSCMRevisionClass()
SCMRevision that the migration applies to.SCMRevision that the migration applies to.@CheckForNull public abstract SCMHead migrate(@NonNull S source, @NonNull H head)
Note: if you migrate a SCMHead then most likely you will also want to migrate the
SCMRevision instances associated with that SCMHead - at the very least to update
SCMRevision.getHead().
source - the source instance.head - the candidate head.null if the migration was not appropriate.@CheckForNull public SCMRevision migrate(@NonNull S source, @NonNull R revision)
source - the source instance.revision - the candidate revision.null if the migration was not appropriate.@NonNull public static SCMHead readResolveSCMHead(@NonNull SCMSource source, @NonNull SCMHead head)
source - the source instance.head - the candidate head.@CheckForNull public static SCMRevision readResolveSCMRevision(@NonNull SCMSource source, @CheckForNull SCMRevision revision)
source - the source instance.revision - the candidate revision.Copyright © 2016–2019. All rights reserved.