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


public interface ContributionRepository

Contribution repository

Version:
$Rev$ $Date$

Method Summary
 java.net.URL find(java.lang.String contribution)
          Look up the contribution by URI
 java.net.URI getDomain()
          Get the URI of the SCA domain
 java.util.List<java.lang.String> list()
          Get list of URIs for all the contributions in the repository
 void remove(java.lang.String contribution)
          Remove a contribution from the repository
 java.net.URL store(java.lang.String contribution, java.net.URL sourceURL)
          Copy a contribution from the source URL to the repository
 java.net.URL store(java.lang.String contribution, java.net.URL sourceURL, java.io.InputStream contributionStream)
          Copies a contribution to the repository.
 

Method Detail

getDomain

java.net.URI getDomain()
Get the URI of the SCA domain

Returns:
The domain URI

store

java.net.URL store(java.lang.String contribution,
                   java.net.URL sourceURL,
                   java.io.InputStream contributionStream)
                   throws java.io.IOException
Copies a contribution to the repository.

Parameters:
contribution - A URl pointing to the contribution being copied to the repository
sourceURL - url of the source. this would be used to calculate the right filename to be stored on the repository when a inputStream is being provided
contributionStream - InputStream with the content of the distribution
Returns:
A URL pointing to the content of the contribution in the repository
Throws:
java.io.IOException

store

java.net.URL store(java.lang.String contribution,
                   java.net.URL sourceURL)
                   throws java.io.IOException
Copy a contribution from the source URL to the repository

Parameters:
contribution - A URl pointing to the contribution being copied to the repository
sourceURL - url of the source. this would be used to calculate the right filename to be stored on the repository when a inputStream is being provided
Returns:
A URL pointing to the content of the contribution in the repository
Throws:
java.io.IOException

find

java.net.URL find(java.lang.String contribution)
Look up the contribution by URI

Parameters:
contribution - The URI of the contribution
Returns:
A URL pointing to the content of the contribution in the repository, it will be null if the contribution cannot be found in the repository

remove

void remove(java.lang.String contribution)
Remove a contribution from the repository

Parameters:
contribution - The URI of the contribution to be removed

list

java.util.List<java.lang.String> list()
Get list of URIs for all the contributions in the repository

Returns:
A list of contribution URIs