org.apache.tuscany.sca.contribution.service
Interface ContributionService


public interface ContributionService

Service interface that manages artifacts contributed to a Tuscany runtime.

Version:
$Rev: 527398 $ $Date: 2007-04-10 23:43:31 -0700 (Tue, 10 Apr 2007) $

Method Summary
 void addDeploymentComposite(Contribution contribution, Composite composite)
          Adds or updates a deployment composite using a supplied composite ("composite by value" - a data structure, not an existing resource in the domain) to the contribution identified by a supplied contribution URI.
 Contribution contribute(java.lang.String contributionURI, java.net.URL sourceURL, java.io.InputStream contributionContent, ModelResolver modelResolver)
          Contribute an artifact to the SCA Domain.
 Contribution contribute(java.lang.String contributionURI, java.net.URL sourceURL, ModelResolver modelResolver, boolean storeInRepository)
          Contribute an artifact to the SCA Domain.
 Contribution getContribution(java.lang.String contribution)
          Get the model for an installed contribution
 void remove(java.lang.String contribution)
          Remove a contribution from the SCA domain
 

Method Detail

contribute

Contribution contribute(java.lang.String contributionURI,
                        java.net.URL sourceURL,
                        ModelResolver modelResolver,
                        boolean storeInRepository)
                        throws ContributionException,
                               java.io.IOException
Contribute an artifact to the SCA Domain. The type of the contribution is determined by the Content-Type of the resource or, if that is undefined, by some implementation-specific means (such as mapping an extension in the URL's path).

Parameters:
contributionURI - The URI that is used as the contribution unique ID.
sourceURL - The location of the resource containing the artifact
modelResolver - The model resolver to use to resolve models in the scope of this contribution
storeInRepository - Flag that identifies if you want to copy the contribution to the repository
Returns:
The contribution model representing the contribution
Throws:
DeploymentException - if there was a problem with the contribution
java.io.IOException - if there was a problem reading the resource
ContributionException

contribute

Contribution contribute(java.lang.String contributionURI,
                        java.net.URL sourceURL,
                        java.io.InputStream contributionContent,
                        ModelResolver modelResolver)
                        throws ContributionException,
                               java.io.IOException
Contribute an artifact to the SCA Domain.

Parameters:
contributionURI - The URI that is used as the contribution unique ID.
sourceURL - The location of the resource containing the artifact. This is used to identify what name should be used when storing the contribution on the repository
modelResolver - The model resolver to use to resolve models in the scope of this contribution
contributionContent - A stream containing the resource being contributed; the stream will not be closed but the read position after the call is undefined
Returns:
The contribution model representing the contribution
Throws:
DeploymentException - if there was a problem with the contribution
java.io.IOException - if there was a problem reading the stream
ContributionException

getContribution

Contribution getContribution(java.lang.String contribution)
Get the model for an installed contribution

Parameters:
contribution - The URI of an installed contribution
Returns:
The model for the contribution or null if there is no such contribution

addDeploymentComposite

void addDeploymentComposite(Contribution contribution,
                            Composite composite)
                            throws ContributionException
Adds or updates a deployment composite using a supplied composite ("composite by value" - a data structure, not an existing resource in the domain) to the contribution identified by a supplied contribution URI. The added or updated deployment composite is given a relative URI that matches the "name" attribute of the composite, with a ".composite" suffix.

Parameters:
contribution - The contribution to where
composite -
Throws:
ContributionException

remove

void remove(java.lang.String contribution)
            throws ContributionException
Remove a contribution from the SCA domain

Parameters:
contribution - The URI of the contribution
Throws:
DeploymentException
ContributionException