public interface IServiceModelManager
Modifier and Type | Method and Description |
---|---|
void |
addConfiguration(IProject project,
IServiceConfiguration conf)
Associate the service configuration with a project.
|
void |
addConfiguration(IServiceConfiguration conf)
Adds the given service configuration to the model without explicitly
associating it with a particular project.
|
void |
addEventListener(IServiceModelEventListener listener,
int type)
Adds the given listener for service model events.
|
boolean |
exportConfigurations(String filename,
IServiceConfiguration[] configs)
Export a set of service configurations to a file.
|
IServiceConfiguration |
getActiveConfiguration()
Get the global "active" service configuration.
|
IServiceConfiguration |
getActiveConfiguration(IProject project)
Get the configuration that is currently active for the project.
|
Set<IServiceCategory> |
getCategories()
Returns all the service categories that have been registered with
the system.
|
IServiceConfiguration |
getConfiguration(IProject project,
String name)
Get the named configuration for this project.
|
IServiceConfiguration |
getConfiguration(String id)
Get the configuration with the specified ID.
|
Set<IServiceConfiguration> |
getConfigurations()
Get all configurations available in the workspace.
|
Set<IServiceConfiguration> |
getConfigurations(IProject project)
Get all the configurations that are known by the project
|
Set<IProject> |
getProjectsForConfiguration(IServiceConfiguration serviceConfiguration)
Get the set of projects which use the specified service configuration
|
IService |
getService(String id)
Retrieves the service corresponding to a given id.
|
IServiceProvider |
getServiceProvider(IServiceProviderDescriptor desc)
Return a new instance of a service provider based on the descriptor.
|
Set<IService> |
getServices()
Get all the services that have been registered with the system.
|
Set<IService> |
getServices(IProject project)
Get all the services that are used by a particular project.
|
IServiceConfiguration[] |
importConfigurations(String filename)
Import a set of service configurations from a file.
|
boolean |
isConfigured(IProject project)
Returns true if the given project has a configuration.
|
boolean |
isValidConfigurationFile(String filename)
Validate a set of service configurations in a file
|
IServiceConfiguration |
newServiceConfiguration(String name)
Obtain a new service configuration with name 'name'.
|
void |
remap(IProject removedProject,
IProject addedProject)
Remaps all the configurations and services associated to the removed project to the added project.
|
void |
remove(IProject project)
Removes all the configurations and services associated to the given project.
|
void |
removeConfiguration(IProject project,
IServiceConfiguration conf)
TODO What happens if you try to remove the active configuration?
|
void |
removeEventListener(IServiceModelEventListener listener)
Removes the given listener for service model events.
|
void |
setActiveConfiguration(IProject project,
IServiceConfiguration configuration)
Set the active configuration for a project.
|
void |
setActiveConfiguration(IServiceConfiguration config)
Set the global "active" service configuration.
|
void addConfiguration(IProject project, IServiceConfiguration conf)
project
- the projectconf
- the configurationNullPointerException
- if project or conf is nullvoid addConfiguration(IServiceConfiguration conf)
project
- the projectconf
- the configurationNullPointerException
- if conf is nullvoid addEventListener(IServiceModelEventListener listener, int type)
Listeners can listen for several types of event as defined in
IServiceModelEvent
. Clients are free to register for
any number of event types. Clients are guaranteed to only receive
event types for which they are registered.
listener
- the listenereventMask
- the bit-wise OR of all event types of interest to the
listenerIServiceModelEventListener
,
IServiceModelEvent
,
removeEventListener(IServiceModelEventListener)
boolean exportConfigurations(String filename, IServiceConfiguration[] configs) throws InvocationTargetException
file
- file name used to save the configurationInvocationTargetException
- wraps any exceptions thrown during exportIServiceConfiguration getActiveConfiguration()
IServiceConfiguration getActiveConfiguration(IProject project)
project
- project for which the configuration will be obtainedNullPointerException
- if project is nullProjectNotConfiguredException
- if the project has not been configuredSet<IServiceCategory> getCategories()
IServiceConfiguration getConfiguration(IProject project, String name)
project
- project for which the configuration will be obtainedname
- name of the configurationNullPointerException
- if project is nullProjectNotConfiguredException
- if the project has not been configuredIServiceConfiguration getConfiguration(String id)
id
- ID of the configurationSet<IServiceConfiguration> getConfigurations()
Set<IServiceConfiguration> getConfigurations(IProject project)
project
- project containing the configurationsNullPointerException
- if project is nullProjectNotConfiguredException
- if the project has not been configuredSet<IProject> getProjectsForConfiguration(IServiceConfiguration serviceConfiguration)
serviceConfiguration
- Service configuration to query set of projects using itIService getService(String id)
id
- The unique id of the service to retrieve.IServiceProvider getServiceProvider(IServiceProviderDescriptor desc)
desc
- extension descriptionSet<IService> getServices()
Set<IService> getServices(IProject project)
project
- project using the servicesNullPointerException
- if project is nullProjectNotConfiguredException
- if the project has not been configuredIServiceConfiguration[] importConfigurations(String filename) throws InvocationTargetException
addConfiguration(IServiceConfiguration)
before they can be used. No model events will be generated while loading
the configurations.file
- file name containing the configurationInvocationTargetException
- wraps any exceptions thrown during importboolean isConfigured(IProject project)
boolean isValidConfigurationFile(String filename)
file
- file name of the file containing the configurationsIServiceConfiguration newServiceConfiguration(String name)
name
- name of service configurationvoid remap(IProject removedProject, IProject addedProject)
removedProject
- project removed from workspaceaddedProject
- project added to workspacevoid remove(IProject project)
NullPointerException
- if project is nullvoid removeConfiguration(IProject project, IServiceConfiguration conf)
project
- the projectconf
- the configurationNullPointerException
- if project or conf is nullProjectNotConfiguredException
- if the project has not been configuredvoid removeEventListener(IServiceModelEventListener listener)
listener
- the listenerIServiceModelEventListener
,
IServiceModelEvent
,
#addEventListener(IServiceModelEventListener)
void setActiveConfiguration(IProject project, IServiceConfiguration configuration)
project
- project for which the configuration will be obtainedconfiguration
- configuration to set as active for this projectNullPointerException
- if project or configuration is nullProjectNotConfiguredException
- if the project has not been configured yetIllegalArgumentException
- if the configuration was not part of the projectvoid setActiveConfiguration(IServiceConfiguration config)
config
- the service configuration to select as activeCopyright (c) 2011 IBM Corporation and others. All Rights Reserved.