Class RepositoryResolver
- java.lang.Object
-
- org.jenkinsci.plugins.gitserver.RepositoryResolver
-
- All Implemented Interfaces:
ExtensionPoint
public abstract class RepositoryResolver extends Object implements ExtensionPoint
Resolves the full name of the repository as given by Git clients to actualRepository
.This extension point allows multiple plugins to expose their Git repositories via SSH/Git protocol.
Repository Name
Both methods of this interface uses the parameter 'fullRepositoryName'.
This parameter represents the repository path name as given by git client. For example, "foo/bar.git" for client running "git push jenkins:foo/bar.git" and "/foo/bar.git" for client running "git push ssh://jenkins/foo/bar.git".
To avoid conflicts, plugins are highly encouraged to require a known prefix. For example, if you are implementing acme-plugin, you should only recognize "acme/foo.git" or "acme/foo/bar.git" but not "foo.git"
Similarly, because of the difference in the way the leading '/' appears based on the protocol, most implementations should support both "/acme/foo.git" and "acme/foo.git".
- Author:
- Kohsuke Kawaguchi
- See Also:
HttpGitRepository
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description RepositoryResolver()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExtensionList<RepositoryResolver>
all()
abstract org.eclipse.jgit.transport.ReceivePack
createReceivePack(String fullRepositoryName)
ReturnsReceivePack
used to handle "git push" operation from a client.abstract org.eclipse.jgit.transport.UploadPack
createUploadPack(String fullRepositoryName)
ReturnsUploadPack
used to handle "git fetch" operation from a client.
-
-
-
Method Detail
-
createReceivePack
public abstract org.eclipse.jgit.transport.ReceivePack createReceivePack(String fullRepositoryName) throws IOException, InterruptedException
ReturnsReceivePack
used to handle "git push" operation from a client.- Parameters:
fullRepositoryName
- The repository path name as given by git client. See class javadoc for details.- Returns:
- null if this resolver doesn't recognize the given path name.
This will allow other
RepositoryResolver
s to get a shot at the repository. - Throws:
IOException
InterruptedException
-
createUploadPack
public abstract org.eclipse.jgit.transport.UploadPack createUploadPack(String fullRepositoryName) throws IOException, InterruptedException
ReturnsUploadPack
used to handle "git fetch" operation from a client.- Parameters:
fullRepositoryName
- The repository path name as given by git client. See class javadoc for details.- Returns:
- null if this resolver doesn't recognize the given path name.
This will allow other
RepositoryResolver
s to get a shot at the repository. - Throws:
IOException
InterruptedException
-
all
public static ExtensionList<RepositoryResolver> all() throws IllegalStateException
- Throws:
IllegalStateException
-
-