org.sca4j.host.contribution
Interface ContributionService


public interface ContributionService

Service interface that manages artifacts contributed to a SCA4J domain.

Version:
$Rev: 4336 $ $Date: 2008-05-25 10:06:15 +0100 (Sun, 25 May 2008) $

Method Summary
 java.net.URI contribute(ContributionSource source)
          Contribute an artifact to the SCA Domain.
 java.util.List<java.net.URI> contribute(java.util.List<ContributionSource> sources)
          Contribute a collection of artifacts to a domain.
 boolean exists(java.net.URI uri)
          Returns true if a contribution for the given URI exists.
 long getContributionTimestamp(java.net.URI uri)
          Returns the contribution timestamp.
 java.util.List<Deployable> getDeployables(java.net.URI uri)
          Returns a list of deployables in a contribution.
 void remove(java.net.URI uri)
          Remove a contribution from the SCA domain.
<T> T
resolve(java.net.URI uri, java.lang.Class<T> definitionType, javax.xml.namespace.QName name)
          Resolve an artifact by QName within the contribution
 java.net.URL resolve(java.net.URI uri, java.lang.String namespace, java.net.URI locationUri, java.net.URI baseURI)
          Resolve the reference to an artifact by the location URI within the given contribution.
 void update(ContributionSource source)
          Updates a previously contributed artifact if its timestamp and checksum have changed.
 

Method Detail

contribute

java.net.URI contribute(ContributionSource source)
                        throws ContributionException
Contribute an artifact to the SCA Domain.

Parameters:
source - the contribution source
Returns:
a URI that uniquely identifies this contribution within the SCA Domain
Throws:
ContributionException - if there was a problem with the contribution

contribute

java.util.List<java.net.URI> contribute(java.util.List<ContributionSource> sources)
                                        throws ContributionException
Contribute a collection of artifacts to a domain. Artifacts will be ordered by import dependencies.

Parameters:
sources - the artifacts to contribute
Returns:
a list of contributed URIs.
Throws:
ContributionException - if an error is encountered contributing the artifacts

update

void update(ContributionSource source)
            throws ContributionException
Updates a previously contributed artifact if its timestamp and checksum have changed.

Parameters:
source - the contribution source
Throws:
ContributionException - if an error occurs during the update procecedure, for example, a previuous contribution is not found

exists

boolean exists(java.net.URI uri)
Returns true if a contribution for the given URI exists.

Parameters:
uri - the contribution URI
Returns:
true if a contribution for the given URI exists

getContributionTimestamp

long getContributionTimestamp(java.net.URI uri)
Returns the contribution timestamp.

Parameters:
uri - the contribution URI
Returns:
the timestamp or -1 if no contribution was found

getDeployables

java.util.List<Deployable> getDeployables(java.net.URI uri)
                                          throws ContributionException
Returns a list of deployables in a contribution.

Parameters:
uri - the URI of the contribution to search
Returns:
a list of deployables in a contribution. If no deployables are found, an empty list is returned.
Throws:
ContributionNotFoundException - if a contribution corresponding to the URI is not found
ContributionException

remove

void remove(java.net.URI uri)
            throws ContributionException
Remove a contribution from the SCA domain.

Parameters:
uri - The URI of the contribution
Throws:
ContributionException - if there was a problem with the contribution

resolve

<T> T resolve(java.net.URI uri,
              java.lang.Class<T> definitionType,
              javax.xml.namespace.QName name)
Resolve an artifact by QName within the contribution

Type Parameters:
T - The java type of the artifact such as javax.wsdl.Definition
Parameters:
uri - The URI of the contribution
definitionType - The java type of the artifact
name - The name of the artifact
Returns:
The resolved artifact

resolve

java.net.URL resolve(java.net.URI uri,
                     java.lang.String namespace,
                     java.net.URI locationUri,
                     java.net.URI baseURI)
Resolve the reference to an artifact by the location URI within the given contribution. Some typical use cases are:

Parameters:
uri - The URI of the contribution
namespace - The namespace of the artifact. This is for validation purpose. If the namespace is null, then no check will be performed.
locationUri - The location URI
baseURI - The URI of the base artifact where the reference is declared
Returns:
The URL of the resolved artifact


Copyright © 2008-2010 Service Symphony. All Rights Reserved.