Package com.mooltiverse.oss.nyx.services
Class ServiceFactory
java.lang.Object
com.mooltiverse.oss.nyx.services.ServiceFactory
The generic entry point to inspect and retrieve service implementations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic GitHostingService
gitHostingServiceInstance
(Provider provider, Map<String, String> options) Returns an instance for the given provider using the given options.static Service
Returns an instance for the given provider using the given options.static ReleaseService
releaseServiceInstance
(Provider provider, Map<String, String> options) Returns an instance for the given provider using the given options.static UserService
userServiceInstance
(Provider provider, Map<String, String> options) Returns an instance for the given provider using the given options.
-
Method Details
-
gitHostingServiceInstance
public static GitHostingService gitHostingServiceInstance(Provider provider, Map<String, String> options) Returns an instance for the given provider using the given options.- Parameters:
provider
- the provider to retrieve the instance for.options
- the map of options for the requested service. It may benull
if the requested service does not require the options map. To know if the service needs rhese options and, if so, which entries are to be present please check with the specific service.- Returns:
- a service instance initialized with the given options.
- Throws:
NullPointerException
- if the given provider isnull
or the given options map isnull
and the service instance does not allownull
optionsIllegalArgumentException
- if the given provider is not supported or some entries in the given options map are illegal for some reasonUnsupportedOperationException
- if the service provider does notsupport
theService.Feature.GIT_HOSTING
feature.
-
instance
Returns an instance for the given provider using the given options.- Parameters:
provider
- the provider to retrieve the instance for.options
- the map of options for the requested service. It may benull
if the requested service does not require the options map. To know if the service needs rhese options and, if so, which entries are to be present please check with the specific service.- Returns:
- a service instance initialized with the given options.
- Throws:
NullPointerException
- if the given provider isnull
or the given options map isnull
and the service instance does not allownull
optionsIllegalArgumentException
- if some entries in the given options map are missing or illegal for some reason
-
releaseServiceInstance
Returns an instance for the given provider using the given options.- Parameters:
provider
- the provider to retrieve the instance for.options
- the map of options for the requested service. It may benull
if the requested service does not require the options map. To know if the service needs rhese options and, if so, which entries are to be present please check with the specific service.- Returns:
- a service instance initialized with the given options.
- Throws:
NullPointerException
- if the given provider isnull
or the given options map isnull
and the service instance does not allownull
optionsIllegalArgumentException
- if the given provider is not supported or some entries in the given options map are illegal for some reasonUnsupportedOperationException
- if the service provider does notsupport
theService.Feature.RELEASES
feature.
-
userServiceInstance
Returns an instance for the given provider using the given options.- Parameters:
provider
- the provider to retrieve the instance for.options
- the map of options for the requested service. It may benull
if the requested service does not require the options map. To know if the service needs rhese options and, if so, which entries are to be present please check with the specific service.- Returns:
- a service instance initialized with the given options.
- Throws:
NullPointerException
- if the given provider isnull
or the given options map isnull
and the service instance does not allownull
optionsIllegalArgumentException
- if the given provider is not supported or some entries in the given options map are illegal for some reasonUnsupportedOperationException
- if the service provider does notsupport
theService.Feature.USERS
feature.
-