summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/tags/kernel/2.0-alpha-incubating/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:26:33 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:26:33 +0000
commita40e527938d76ba71f211da7e327adb50384ba69 (patch)
treecb8f99f1727122b040a3f0fbb6649292b6a74302 /sca-java-1.x/tags/kernel/2.0-alpha-incubating/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
parent968721109881107520d7aefa91d7fcc0519d7739 (diff)
Moving 1.x tags
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835157 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/tags/kernel/2.0-alpha-incubating/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java')
-rw-r--r--sca-java-1.x/tags/kernel/2.0-alpha-incubating/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java96
1 files changed, 96 insertions, 0 deletions
diff --git a/sca-java-1.x/tags/kernel/2.0-alpha-incubating/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java b/sca-java-1.x/tags/kernel/2.0-alpha-incubating/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
new file mode 100644
index 0000000000..ee8ff958c2
--- /dev/null
+++ b/sca-java-1.x/tags/kernel/2.0-alpha-incubating/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.host.deployment;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
+
+
+/**
+ * Service interface that manages artifacts contributed to a Tuscany runtime.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ContributionService {
+ /**
+ * 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).
+ *
+ * @param contribution the location of the resource containing the artifact
+ * @param storeInRepository flag that identifies if you want to copy the contribution to the repository
+ * @return a URI that uniquely identifies this contribution within the SCA Domain
+ * @throws DeploymentException if there was a problem with the contribution
+ * @throws IOException if there was a problem reading the resource
+ */
+ URI contribute(URL contribution, boolean storeInRepository) throws DeploymentException, IOException;
+
+ /**
+ * Contribute an artifact to the SCA Domain.
+ *
+ * @param source an identifier for the source of this contribution
+ * @param contribution a stream containing the resource being contributed; the stream will not be closed but the
+ * read position after the call is undefined
+ * @param storeInRepository flag that identifies if you want to copy the contribution to the repository
+ * @return a URI that uniquely identifies this contribution within the SCA Domain
+ * @throws DeploymentException if there was a problem with the contribution
+ * @throws IOException if there was a problem reading the stream
+ */
+ URI contribute(URI source, InputStream contribution, boolean storeInRepository)
+ throws DeploymentException, IOException;
+
+ /**
+ * Remove a contribution from the SCA domain
+ * @param contribution The URI of the contribution
+ * @throws DeploymentException if there was a problem with the contribution
+ */
+ void remove(URI contribution) throws DeploymentException;
+
+ /**
+ * Resolve an artifact by QName within the contribution
+ *
+ * @param <T> The java type of the artifact such as javax.wsdl.Definition
+ * @param contribution The URI of the contribution
+ * @param definitionType The java type of the artifact
+ * @param namespace The namespace of the artifact
+ * @param name The name of the artifact
+ * @return The resolved artifact
+ */
+ <T> T resolve(URI contribution, Class<T> definitionType, String namespace, String name);
+
+ /**
+ * Resolve the reference to an artifact by the location URI within the given contribution.
+ * Some typical use cases are:
+ * <ul>
+ * <li>Reference a XML schema using
+ * {http://www.w3.org/2001/XMLSchema-instance}schemaLocation or
+ * <li>Reference a list of WSDLs using
+ * {http://www.w3.org/2004/08/wsdl-instance}wsdlLocation
+ * </ul>
+ * @param contribution The URI of the contribution
+ * @param namespace The namespace of the artifact. This is for validation purpose. If the namespace is null,
+ * then no check will be performed.
+ * @param uri The location URI
+ * @param baseURI The URI of the base artifact where the reference is declared
+ * @return The URL of the resolved artifact
+ */
+ URL resolve(URI contribution, String namespace, URI uri, URI baseURI);
+}