PTP
Release 7.0

org.eclipse.ptp.services.core
Interface IServiceConfiguration


public interface IServiceConfiguration

An IServiceConfiguration represents a particular set of service providers for each known service. An IServiceConfiguration represents a mapping from IService to IServiceProvider. If there exists a mapping for a particular IService then that service is considered "enabled". If there is no mapping for a service then the service is considered "disabled" in this configuration. Disabling a service removes the service from the configuration. EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is no guarantee that this API will work or that it will remain the same. Please do not use this API without consulting with the RDT team.


Method Summary
 void disable(IService service)
          Disables (removes) the service provider from this configuration.
 java.lang.String getId()
          Get the unique ID for this configuration.
 java.lang.String getName()
          Get the name for this configuration.
 IServiceProvider getServiceProvider(IService service)
          Get the service provider for a particular service in this configuration.
 java.util.Set<IService> getServices()
          Returns all of the services that are enabled in this configuration.
 java.util.SortedSet<IService> getServicesByPriority()
          Return the set of services that are enabled in this configuration sorted by priority.
 boolean isDisabled(IService service)
          Returns true of the given service is not part of this configuration.
 void setName(java.lang.String name)
          Set the name for this configuration.
 void setServiceProvider(IService service, IServiceProvider provider)
          Set the service provider for a particular service in this configuration.
 

Method Detail

getId

java.lang.String getId()
Get the unique ID for this configuration.

Returns:
the unique ID of this configuration

getName

java.lang.String getName()
Get the name for this configuration.

Returns:
the name of this configuration

getServiceProvider

IServiceProvider getServiceProvider(IService service)
Get the service provider for a particular service in this configuration. If the service is disabled and the service has a null-provider then the null-provider will be returned, if the service does not have a null-provider then null will be returned.

Parameters:
service - service for which provider is required
Returns:
service provider for the service

getServices

java.util.Set<IService> getServices()
Returns all of the services that are enabled in this configuration.

Returns:
all of the services that are part of this configuration.

getServicesByPriority

java.util.SortedSet<IService> getServicesByPriority()
Return the set of services that are enabled in this configuration sorted by priority.

Parameters:
service - service containing providers
Returns:
sorted providers

setName

void setName(java.lang.String name)
Set the name for this configuration.

Parameters:
name - the name of this configuration

setServiceProvider

void setServiceProvider(IService service,
                        IServiceProvider provider)
Set the service provider for a particular service in this configuration. If the service was formerly disabled it becomes enabled. If the service already has a provider associated with it it will be replaced with the given provider, the old provider will be remembered and will be returned from getFormerServicePRoviders().

Parameters:
service - service to set the provider for
provider - provider for this service
Throws:
java.lang.NullPointerException - if service or provider is null
java.lang.IllegalArgumentException

isDisabled

boolean isDisabled(IService service)
Returns true of the given service is not part of this configuration. Equivalent to: !getServices().contains(service) If this method returns false then getServiceProvider() will not return null.


disable

void disable(IService service)
Disables (removes) the service provider from this configuration.


PTP
Release 7.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.