Class ServiceFactory

java.lang.Object
com.mooltiverse.oss.nyx.services.ServiceFactory

public class ServiceFactory extends Object
The generic entry point to inspect and retrieve service implementations.
  • 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 be null 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 is null or the given options map is null and the service instance does not allow null options
      IllegalArgumentException - if the given provider is not supported or some entries in the given options map are illegal for some reason
      UnsupportedOperationException - if the service provider does not support the Service.Feature.GIT_HOSTING feature.
    • instance

      public static Service instance(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 be null 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 is null or the given options map is null and the service instance does not allow null options
      IllegalArgumentException - if some entries in the given options map are missing or illegal for some reason
    • releaseServiceInstance

      public static ReleaseService releaseServiceInstance(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 be null 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 is null or the given options map is null and the service instance does not allow null options
      IllegalArgumentException - if the given provider is not supported or some entries in the given options map are illegal for some reason
      UnsupportedOperationException - if the service provider does not support the Service.Feature.RELEASES feature.
    • userServiceInstance

      public static UserService userServiceInstance(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 be null 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 is null or the given options map is null and the service instance does not allow null options
      IllegalArgumentException - if the given provider is not supported or some entries in the given options map are illegal for some reason
      UnsupportedOperationException - if the service provider does not support the Service.Feature.USERS feature.