IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.ras.profile.core
Interface IRASProfileService


public interface IRASProfileService

The profile factory is used to create or load instances of the profiles. It handles the version upgrade (if required) and identification of the type of profile. This interface is not intended to be implemented by clients.


Method Summary
 ComposeableAdapterFactory getAdapterFactory(String theProfileId)
          Retrieves the ComposeableAdapterFactory factory for the specified profile id.
 IAssetFactory getAssetFactory(String theProfileId)
          Retrieves the asset factory for the specified profile id.
 IRASAssetReader getAssetReader(String theResourcePath)
          Get the asset reader for the specified resource path
 IRASAssetReader getAssetReader(String theResourcePath, String theManifestReference)
          Get the asset reader for the specified resource path
 IRASAssetWriter getAssetWriter(String theStorageFormat)
          Get the asset writer for the specified storage format.
 IProfileExtension getProfile(String theProfileId)
          Retrieves the profile extension registered with the specified profile id.
 IProfileExtension[] getProfiles()
          Retrieves all valid profile extensions registered with the profile service.
 IProfileFormat[] getReaderFormats()
          Returns an array of the supported formats for reading an asset.
 IProfileFormat[] getWriterFormats()
          Returns an array of the supported formats for writing an asset.
 IStatus initializeAsset(EObject theAsset)
          Initializes the asset by invoking the IAssetInitializer associated with the asset's profile ID.
 

Method Detail

getAssetReader

public IRASAssetReader getAssetReader(String theResourcePath)
                               throws IOException,
                                      IllegalArgumentException
Get the asset reader for the specified resource path

Parameters:
theResourcePath - the path to the resource. For instance a file path for file based assets.
Returns:
the reader or null if none was found
Throws:
IOException - if there is an error reading the resource path
IllegalArgumentException - if theResourcePath is null

getAssetReader

public IRASAssetReader getAssetReader(String theResourcePath,
                                      String theManifestReference)
                               throws IOException,
                                      IllegalArgumentException
Get the asset reader for the specified resource path

Parameters:
theResourcePath - the path to the resource. For instance a file path for file based assets.
theManifestReference - optional; the manifest to use in the asset. This may be null in which case the reader should use the default manifest.
Returns:
the reader or null if none was found
Throws:
IOException - if there is an error reading the resource path
IllegalArgumentException - if theResourcePath is null

getAssetWriter

public IRASAssetWriter getAssetWriter(String theStorageFormat)
                               throws IOException,
                                      IllegalArgumentException
Get the asset writer for the specified storage format. The storage format indicates the type of writer to create.

Parameters:
theStorageFormat - indicates the format in which the asset will be stored.
Returns:
IRASAssetWriter the writer or null if none was found
Throws:
IOException - if an error occurred getting the asset writer
IllegalArgumentException - if theStorageFormat is null

getAssetFactory

public IAssetFactory getAssetFactory(String theProfileId)
                              throws IllegalArgumentException
Retrieves the asset factory for the specified profile id.

Parameters:
theProfileId - the id of the profile
Returns:
the asset factory or null if the profile id is not supported
Throws:
IllegalArgumentException - if the theProfileId is null

getAdapterFactory

public ComposeableAdapterFactory getAdapterFactory(String theProfileId)
                                            throws IllegalArgumentException
Retrieves the ComposeableAdapterFactory factory for the specified profile id. If one has not been properly registered for the specified profile id then null is returned.

Parameters:
theProfileId - the id of the profile
Returns:
the adapter factory or null if an adapter factory has not been properly registered for the profile id
Throws:
IllegalArgumentException - if the theProfileId is null

getProfile

public IProfileExtension getProfile(String theProfileId)
                             throws IllegalArgumentException
Retrieves the profile extension registered with the specified profile id.

Parameters:
theProfileId - of the profile to retrieve
Returns:
the profile extension or null if the profile id is not supported
Throws:
IllegalArgumentException - if the theProfileId is null

getProfiles

public IProfileExtension[] getProfiles()
Retrieves all valid profile extensions registered with the profile service.

Returns:
all valid profile extenstions registered with the profile service.

initializeAsset

public IStatus initializeAsset(EObject theAsset)
                        throws IllegalArgumentException
Initializes the asset by invoking the IAssetInitializer associated with the asset's profile ID. Each initializer that is part of the ancestry of the profile ID will be invoked. They are invoked from least to most derived profile.

Parameters:
theAsset - the asset instance to initialize with
Returns:
a status indicating if the asset initialized successfully
Throws:
IllegalArgumentException - if theAsset is null

getReaderFormats

public IProfileFormat[] getReaderFormats()
Returns an array of the supported formats for reading an asset.

Returns:
the array of formats that are supported

getWriterFormats

public IProfileFormat[] getWriterFormats()
Returns an array of the supported formats for writing an asset.

Returns:
the array of formats that are supported

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.