Package com.mooltiverse.oss.nyx.services
Class GitServiceFactory
- java.lang.Object
-
- com.mooltiverse.oss.nyx.services.GitServiceFactory
-
public class GitServiceFactory extends Object
The generic entry point to retrieve service implementations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GitService
instance(GitProvider provider)
Returns an instance for the given provider using the default API URI.static GitService
instance(GitProvider provider, String apiURI)
Returns an instance for the given provider using the given API URI.static GitService
instance(GitProvider provider, URI apiURI)
Returns an instance for the given provider using the given API URI.
-
-
-
Method Detail
-
instance
public static GitService instance(GitProvider provider) throws GitTransportException
Returns an instance for the given provider using the default API URI.- Parameters:
provider
- the provider to retrieve the instance for.- Returns:
- an instance using the default API URI.
- Throws:
GitTransportException
- if the default URI can't be reached or does not expose valid APIsNullPointerException
- if the given provider isnull
IllegalArgumentException
- if the given provider is not supported
-
instance
public static GitService instance(GitProvider provider, String apiURI) throws GitTransportException
Returns an instance for the given provider using the given API URI.- Parameters:
provider
- the provider to retrieve the instance for.apiURI
- the API URI, which is usually the endpoint to a private or on premise installation- Returns:
- an instance using the given API URI
- Throws:
GitTransportException
- if the given URI can't be reached or does not expose valid APIsNullPointerException
- if the given URI or provider isnull
IllegalArgumentException
- if the given provider is not supported or the given URI is illegal (i.e. empty or malformed)UnsupportedOperationException
- if the requested provider does not support theGitServiceFeature.CUSTOM_ENDPOINT
feature
-
instance
public static GitService instance(GitProvider provider, URI apiURI) throws GitTransportException
Returns an instance for the given provider using the given API URI.- Parameters:
provider
- the provider to retrieve the instance for.apiURI
- the API URI, which is usually the endpoint to a private or on premise installation- Returns:
- an instance using the given API URI
- Throws:
GitTransportException
- if the given URI can't be reached or does not expose valid APIsNullPointerException
- if the given URI provider isnull
IllegalArgumentException
- if the given provider is not supported or the given URI is illegal (i.e. empty or malformed)UnsupportedOperationException
- if the requested provider does not support theGitServiceFeature.CUSTOM_ENDPOINT
feature
-
-