Class GiteaConnectionFactory
java.lang.Object
org.jenkinsci.plugin.gitea.client.spi.GiteaConnectionFactory
- Direct Known Subclasses:
DefaultGiteaConnectionFactory
The SPI for instantiating
GiteaConnection implementations from Gitea.
All the ServiceLoader registered implementations will be filtered to only those that
canOpen(Gitea). In the event of multiple implementations, the one with the highest
priority(Gitea) will be selected and then open(Gitea) will be
called.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanSPI: confirm that this factory can open connections to the supplied builder.abstract GiteaConnectionSPI: open the connection to the supplied URL with the supplied authentication.longSPI: return the priority with which this factory claims ownership of the supplied URL and authentication.
-
Constructor Details
-
GiteaConnectionFactory
public GiteaConnectionFactory()
-
-
Method Details
-
canOpen
SPI: confirm that this factory can open connections to the supplied builder.- Parameters:
gitea- the builder.- Returns:
trueif connections can be opened.
-
priority
SPI: return the priority with which this factory claims ownership of the supplied URL and authentication. This method's return value is only valid aftercanOpen(Gitea)has returnedtrue.- Parameters:
gitea- the builder.- Returns:
- the priority.
-
open
@NonNull public abstract GiteaConnection open(@NonNull Gitea gitea) throws IOException, InterruptedException SPI: open the connection to the supplied URL with the supplied authentication.- Parameters:
gitea- the builder.- Returns:
- the connection.
- Throws:
IOException- if the connection could not be opened.InterruptedException- if interrupted while opening the connection.
-