You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/02/23 11:35:44 UTC
[29/58] [abbrv] incubator-taverna-plugin-component git commit:
org.apache.taverna.component.api.*
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/ComponentVersionTest.java
----------------------------------------------------------------------
diff --git a/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/ComponentVersionTest.java b/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/ComponentVersionTest.java
index 4d3e8e3..962f8dd 100644
--- a/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/ComponentVersionTest.java
+++ b/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/ComponentVersionTest.java
@@ -25,10 +25,9 @@ import static org.junit.Assert.assertNotNull;
import java.net.URL;
-import net.sf.taverna.t2.component.api.Family;
-import net.sf.taverna.t2.component.api.profile.Profile;
-import net.sf.taverna.t2.component.api.Version;
-
+import org.apache.taverna.component.api.Family;
+import org.apache.taverna.component.api.Version;
+import org.apache.taverna.component.api.profile.Profile;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/Harness.java
----------------------------------------------------------------------
diff --git a/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/Harness.java b/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/Harness.java
index 40a94de..3bad69b 100644
--- a/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/Harness.java
+++ b/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/Harness.java
@@ -2,7 +2,7 @@ package net.sf.taverna.t2.component.registry;
import java.net.URL;
-import net.sf.taverna.t2.component.api.Registry;
+import org.apache.taverna.component.api.Registry;
public class Harness {
public static URL componentRegistryUrl;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/local/LocalComponentRegistryTest.java
----------------------------------------------------------------------
diff --git a/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/local/LocalComponentRegistryTest.java b/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/local/LocalComponentRegistryTest.java
index 3dcefda..157edf7 100644
--- a/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/local/LocalComponentRegistryTest.java
+++ b/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/local/LocalComponentRegistryTest.java
@@ -21,9 +21,9 @@
package net.sf.taverna.t2.component.registry.local;
import static org.junit.Assert.assertSame;
-import net.sf.taverna.t2.component.api.Registry;
import net.sf.taverna.t2.component.registry.ComponentRegistryTest;
+import org.apache.taverna.component.api.Registry;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/standard/NewComponentRegistryTest.java
----------------------------------------------------------------------
diff --git a/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/standard/NewComponentRegistryTest.java b/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/standard/NewComponentRegistryTest.java
index 54aab8a..188e2e1 100644
--- a/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/standard/NewComponentRegistryTest.java
+++ b/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/standard/NewComponentRegistryTest.java
@@ -25,9 +25,9 @@ import static org.junit.Assert.assertSame;
import java.net.URL;
-import net.sf.taverna.t2.component.api.Version;
import net.sf.taverna.t2.component.registry.ComponentRegistryTest;
+import org.apache.taverna.component.api.Version;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/standard/RegistrySupport.java
----------------------------------------------------------------------
diff --git a/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/standard/RegistrySupport.java b/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/standard/RegistrySupport.java
index e5ff86a..18902e1 100644
--- a/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/standard/RegistrySupport.java
+++ b/taverna-component-activity/src/test/java/net/sf/taverna/t2/component/registry/standard/RegistrySupport.java
@@ -5,9 +5,9 @@ import static net.sf.taverna.t2.component.registry.Harness.componentRegistryUrl;
import java.net.URL;
-import net.sf.taverna.t2.component.api.Component;
-import net.sf.taverna.t2.component.api.Family;
-import net.sf.taverna.t2.component.api.profile.Profile;
+import org.apache.taverna.component.api.Component;
+import org.apache.taverna.component.api.Family;
+import org.apache.taverna.component.api.profile.Profile;
class RegistrySupport {
static final String DEPLOYMENT = "http://aeon.cs.man.ac.uk:3006";
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Component.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Component.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Component.java
deleted file mode 100644
index 47bc7e9..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Component.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package net.sf.taverna.t2.component.api;
-
-import java.net.URL;
-import java.util.SortedMap;
-
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-
-/**
- * The abstract interface supported by a component.
- *
- * @author Donal Fellows
- * @author David Withers
- */
-public interface Component extends NamedItem {
- /**
- * @return the name of the Component.
- */
- @Override
- String getName();
-
- /**
- * Returns the URL for the Component.
- *
- * @return the URL for the Component.
- */
- URL getComponentURL();
-
- /**
- * Creates a new version of this Component.
- *
- * @param bundle
- * the workflow that the new ComponentVersion will use.
- * @return a new version of this Component.
- * @throws ComponentException
- * if there is a problem accessing the ComponentRegistry.
- */
- Version addVersionBasedOn(WorkflowBundle bundle, String revisionComment)
- throws ComponentException;
-
- /**
- * Returns the ComponentVersion that has the specified version number.
- *
- * @param version
- * the version number of the ComponentVersion to return.
- * @return the ComponentVersion that has the specified version number.
- * @throws ComponentException
- * if there is a problem accessing the ComponentRegistry.
- */
- Version getComponentVersion(Integer version) throws ComponentException;
-
- /**
- * @return the description of the Component.
- */
- @Override
- String getDescription();
-
- /**
- * Returns a SortedMap of version number to ComponentVersion.
- * <p>
- * The returned map is sorted increasing numeric order.
- *
- * @return a SortedMap of version number to ComponentVersion.
- */
- SortedMap<Integer, Version> getComponentVersionMap();
-
- Registry getRegistry();
-
- Family getFamily();
-
- void delete() throws ComponentException;
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentException.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentException.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentException.java
deleted file mode 100644
index 2b5d829..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentException.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2012 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.component.api;
-
-/**
- * Thrown when there is a problem interacting with a ComponentRegistry.
- *
- * @author David Withers
- */
-public class ComponentException extends Exception {
- private static final long serialVersionUID = -5222074350812438467L;
-
- public ComponentException() {
- super();
- }
-
- public ComponentException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ComponentException(String message) {
- super(message);
- }
-
- public ComponentException(Throwable cause) {
- super(cause);
- }
-
- public ComponentException(String messageTemplate, Object...parameters) {
- super(String.format(messageTemplate, parameters));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentFactory.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentFactory.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentFactory.java
deleted file mode 100644
index 8c7d533..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/ComponentFactory.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package net.sf.taverna.t2.component.api;
-
-import java.net.URL;
-
-import net.sf.taverna.t2.component.api.profile.Profile;
-
-public interface ComponentFactory {
- public Registry getRegistry(URL registryBase) throws ComponentException;
-
- public Family getFamily(URL registryBase, String familyName)
- throws ComponentException;
-
- public Component getComponent(URL registryBase, String familyName,
- String componentName) throws ComponentException;
-
- public Version getVersion(URL registryBase, String familyName,
- String componentName, Integer componentVersion)
- throws ComponentException;
-
- public Version getVersion(Version.ID ident) throws ComponentException;
-
- public Component getComponent(Version.ID ident) throws ComponentException;
-
- public Profile getProfile(URL url) throws ComponentException;
-
- public Profile getBaseProfile() throws ComponentException;
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Family.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Family.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Family.java
deleted file mode 100644
index f618af7..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Family.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package net.sf.taverna.t2.component.api;
-
-import java.util.List;
-
-import net.sf.taverna.t2.component.api.profile.Profile;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-
-public interface Family extends NamedItem {
- /**
- * Creates a new Component and adds it to this ComponentFamily.
- *
- * @param componentName
- * the name of the Component to create. Must not be null.
- * @param bundle
- * the workflow for the Component. Must not be null.
- * @return the new Component.
- * @throws ComponentException
- * <ul>
- * <li>if componentName is null,
- * <li>if dataflow is null,
- * <li>if a Component with this name already exists,
- * <li>if there is a problem accessing the ComponentRegistry.
- * </ul>
- */
- Version createComponentBasedOn(String componentName, String description,
- WorkflowBundle bundle) throws ComponentException;
-
- /**
- * Returns the Component with the specified name.
- * <p>
- * If this ComponentFamily does not contain a Component with the specified
- * name <code>null</code> is returned.
- *
- * @param componentName
- * the name of the Component to return. Must not be null.
- * @return the Component with the specified name.
- * @throws ComponentException
- * if there is a problem accessing the ComponentRegistry.
- */
- Component getComponent(String componentName) throws ComponentException;
-
- /**
- * Removes the specified Component from this ComponentFamily.
- * <p>
- * If this ComponentFamily does not contain the Component this method has no
- * effect.
- *
- * @param component
- * the Component to remove.
- * @throws ComponentException
- * if there is a problem accessing the ComponentRegistry.
- */
- void removeComponent(Component component) throws ComponentException;
-
- /**
- * Returns all the Components in this ComponentFamily.
- * <p>
- * If this ComponentFamily does not contain any Components an empty list is
- * returned.
- *
- * @return all the Components in this ComponentFamilies.
- * @throws ComponentException
- * if there is a problem accessing the ComponentRegistry.
- */
- List<Component> getComponents() throws ComponentException;
-
- /**
- * Returns the ComponentProfile for this ComponentFamily.
- *
- * @return the ComponentProfile for this ComponentFamily.
- * @throws ComponentException
- */
- Profile getComponentProfile() throws ComponentException;
-
- /**
- * Returns the ComponentRegistry that contains this ComponentFamily.
- *
- * @return the ComponentRegistry that contains this ComponentFamily.
- */
- Registry getComponentRegistry();
-
- /**
- * @return the name of the component Family.
- */
- @Override
- String getName();
-
- /**
- * @return the description of the component Family.
- */
- @Override
- String getDescription();
-
- /**
- * Delete this family from its registry.
- * @throws ComponentException
- */
- void delete() throws ComponentException;
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/License.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/License.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/License.java
deleted file mode 100644
index 7e7594d..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/License.java
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.component.api;
-
-/**
- * @author alson
- *
- */
-public interface License extends NamedItem {
- public String getAbbreviation();
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/NamedItem.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/NamedItem.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/NamedItem.java
deleted file mode 100644
index a31ad4d..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/NamedItem.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package net.sf.taverna.t2.component.api;
-
-public interface NamedItem {
- /** Name this entity. */
- public String getName();
- /** Describe this entity. */
- public String getDescription();
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Registry.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Registry.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Registry.java
deleted file mode 100644
index f7b5be4..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Registry.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package net.sf.taverna.t2.component.api;
-
-import java.net.URL;
-import java.util.List;
-import java.util.Set;
-
-import net.sf.taverna.t2.component.api.profile.Profile;
-
-public interface Registry {
-
- License getPreferredLicense() throws ComponentException;
-
- Set<Version.ID> searchForComponents(String prefixString, String text)
- throws ComponentException;
-
- /**
- * Returns all the ComponentFamilies in this ComponetRegistry.
- * <p>
- * If this ComponentRegistry does not contain any ComponentFamilies an empty
- * list is returned.
- *
- * @return all the ComponentFamilies in this ComponetRegistry.
- * @throws ComponentException
- * if there is a problem accessing the ComponentRegistry.
- */
- List<Family> getComponentFamilies() throws ComponentException;
-
- List<License> getLicenses() throws ComponentException;
-
- List<SharingPolicy> getPermissions() throws ComponentException;
-
- /**
- * Adds a ComponentProfile to this ComponentRegistry.
- *
- * @param componentProfile
- * the ComponentProfile to add. Must not be null.
- * @param sharingPolicy
- * @param license
- * @return the ComponentProfile added to this ComponentRegistry.
- * @throws ComponentException
- * <ul>
- * <li>if componentProfile is null,
- * <li>if there is a problem accessing the ComponentRegistry.
- * </ul>
- */
- Profile addComponentProfile(Profile componentProfile, License license,
- SharingPolicy sharingPolicy) throws ComponentException;
-
- /**
- * Returns all the ComponentProfiles in this ComponetRegistry.
- * <p>
- * If this ComponentRegistry does not contain any ComponentProfiles an empty
- * list is returned.
- *
- * @return all the ComponentProfiles in this ComponetRegistry.
- * @throws ComponentException
- * if there is a problem accessing the ComponentRegistry.
- */
- List<Profile> getComponentProfiles() throws ComponentException;
-
- /**
- * Returns the ComponentProfile with the given ID in this ComponetRegistry.
- * <p>
- * If this ComponentRegistry does not contain the ComponentProfile, a
- * <tt>null</tt> is returned.
- *
- * @return the matching ComponentProfile in this ComponetRegistry, or
- * <tt>null</tt> if there is no such thing.
- * @throws ComponentException
- * if there is a problem accessing the ComponentRegistry.
- */
- Profile getComponentProfile(String id) throws ComponentException;
-
- String getRegistryBaseString();
-
- /**
- * Returns the location of this ComponentRepository.
- *
- * @return the location of this ComponentRepository
- */
- URL getRegistryBase();
-
- /**
- * Removes a the ComponentFamily with the specified name from this
- * ComponentRegistry.
- * <p>
- * If this ComponentRegistry does not contain a ComponentFamily with the
- * specified name this method has no effect.
- *
- * @param componentFamily
- * the ComponentFamily to remove.
- * @throws ComponentException
- * if there is a problem accessing the ComponentRegistry.
- */
- void removeComponentFamily(Family componentFamily) throws ComponentException;
-
- /**
- * Creates a new ComponentFamily and adds it to this ComponentRegistry.
- *
- * @param familyName
- * the name of the ComponentFamily to create. Must not be null.
- * @param componentProfile
- * the ComponentProfile for the new ComponentFamily. Must not be
- * null.
- * @param sharingPolicy
- * the SharingPolicy to use for the new ComponentFamily.
- * @return the new ComponentFamily
- * @throws ComponentException
- * <ul>
- * <li>if familyName is null,
- * <li>if componentProfile is null,
- * <li>if a ComponentFamily with this name already exists,
- * <li>if there is a problem accessing the ComponentRegistry.
- * </ul>
- */
- Family createComponentFamily(String familyName, Profile componentProfile,
- String description, License license, SharingPolicy sharingPolicy)
- throws ComponentException;
-
- /**
- * Returns the ComponentFamily with the specified name.
- * <p>
- * If this ComponentRegistry does not contain a ComponentFamily with the
- * specified name <code>null</code> is returned.
- *
- * @param familyName
- * the name of the ComponentFamily to return. Must not be null.
- * @return the ComponentFamily with the specified name in this
- * ComponentRepository or null if none exists.
- * @throws ComponentException
- * if there is a problem accessing the ComponentRegistry.
- */
- Family getComponentFamily(String familyName) throws ComponentException;
-
- /**
- * @return A description of the type of registry this is.
- */
- String getRegistryTypeName();
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/SharingPolicy.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/SharingPolicy.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/SharingPolicy.java
deleted file mode 100644
index ba91276..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/SharingPolicy.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.component.api;
-
-/**
- * @author alanrw
- *
- */
-public interface SharingPolicy {
-
- /**
- * @return The user-relevant name of the permission
- */
- public abstract String getName();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Version.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Version.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Version.java
deleted file mode 100644
index 3f81739..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/Version.java
+++ /dev/null
@@ -1,206 +0,0 @@
-package net.sf.taverna.t2.component.api;
-
-import java.io.Serializable;
-import java.net.URL;
-
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-
-public interface Version {
- /** @return The version number of this version */
- Integer getVersionNumber();
-
- /** @return The description of this version */
- String getDescription();
-
- /** @return The implementation for this version */
- WorkflowBundle getImplementation() throws ComponentException;
-
- /** @return The component of which this is a version */
- Component getComponent();
-
- /** @return The identification token for this version */
- ID getID();
-
- URL getHelpURL();
-
- interface ID extends Serializable {
- /** @return The name of the family of the component to which we refer to */
- String getFamilyName();
-
- /** @return The base URL of the registry containing the component */
- URL getRegistryBase();
-
- /**
- * @return The name of the component referred to, unique within its
- * family
- */
- String getComponentName();
-
- /**
- * @return The version number of the version of the component referred
- * to
- */
- Integer getComponentVersion();
-
- /**
- * Tests whether this ID is equal to the given one, <i>excluding</i> the
- * version.
- *
- * @param id
- * The ID to compare to.
- * @return A boolean
- */
- boolean mostlyEqualTo(ID id);
-
- /**
- * Tests whether this ID is equal to the given component,
- * <i>excluding</i> the version.
- *
- * @param component
- * The component to compare to.
- * @return A boolean
- */
- boolean mostlyEqualTo(Component component);
- }
-
- class Identifier implements ID {
- private static final long serialVersionUID = 1139928258250264997L;
-
- private final URL registryBase;
- private final String familyName;
- private final String componentName;
- private final Integer componentVersion;
-
- public Identifier(URL registryBase, String familyName,
- String componentName, Integer componentVersion) {
- super();
- this.registryBase = registryBase;
- this.familyName = familyName;
- this.componentName = componentName;
- this.componentVersion = componentVersion;
- }
-
- /**
- * @return the registryBase
- */
- @Override
- public URL getRegistryBase() {
- return registryBase;
- }
-
- /**
- * @return the familyName
- */
- @Override
- public String getFamilyName() {
- return familyName;
- }
-
- /**
- * @return the componentName
- */
- @Override
- public String getComponentName() {
- return componentName;
- }
-
- /**
- * @return the componentVersion
- */
- @Override
- public Integer getComponentVersion() {
- return componentVersion;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result *= prime;
- result += (componentName == null) ? 0 : componentName.hashCode();
- result *= prime;
- result += (componentVersion == null) ? 0 : componentVersion
- .hashCode();
- result *= prime;
- result += (familyName == null) ? 0 : familyName.hashCode();
- result *= prime;
- result += (registryBase == null) ? 0 : registryBase.hashCode();
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!ID.class.isAssignableFrom(obj.getClass()))
- return false;
- ID other = (ID) obj;
- if (componentName == null) {
- if (other.getComponentName() != null)
- return false;
- } else if (!componentName.equals(other.getComponentName()))
- return false;
- if (componentVersion == null) {
- if (other.getComponentVersion() != null)
- return false;
- } else if (!componentVersion.equals(other.getComponentVersion()))
- return false;
- if (familyName == null) {
- if (other.getFamilyName() != null)
- return false;
- } else if (!familyName.equals(other.getFamilyName()))
- return false;
- if (registryBase == null) {
- if (other.getRegistryBase() != null)
- return false;
- } else if (!registryBase.toString().equals(
- other.getRegistryBase().toString()))
- // NB: Comparison of URLs is on their string form!
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return getComponentName() + " V. " + getComponentVersion()
- + " in family " + getFamilyName() + " on "
- + getRegistryBase().toExternalForm();
- }
-
- @Override
- public boolean mostlyEqualTo(ID id) {
- if (this == id)
- return true;
- if (id == null)
- return false;
- if (getClass() != id.getClass())
- return false;
- if (componentName == null) {
- if (id.getFamilyName() != null)
- return false;
- } else if (!componentName.equals(id.getComponentName()))
- return false;
- if (familyName == null) {
- if (id.getFamilyName() != null)
- return false;
- } else if (!familyName.equals(id.getFamilyName()))
- return false;
- if (registryBase == null) {
- if (id.getRegistryBase() != null)
- return false;
- } else if (!registryBase.toString().equals(
- id.getRegistryBase().toString()))
- // NB: Comparison of URLs is on their string form!
- return false;
- return true;
- }
-
- @Override
- public boolean mostlyEqualTo(Component c) {
- return mostlyEqualTo(new Identifier(c.getRegistry()
- .getRegistryBase(), c.getFamily().getName(), c.getName(), 0));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentConfig.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentConfig.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentConfig.java
deleted file mode 100644
index 172662d..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentConfig.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package net.sf.taverna.t2.component.api.config;
-
-public interface ComponentConfig {
- String URI = "http://ns.taverna.org.uk/2010/activity/component";
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentPropertyNames.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentPropertyNames.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentPropertyNames.java
deleted file mode 100644
index baa8bb3..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/config/ComponentPropertyNames.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package net.sf.taverna.t2.component.api.config;
-
-/**
- * The names of properties used in JSON configurations associated with
- * components.
- *
- * @author Donal Fellows
- */
-public interface ComponentPropertyNames {
- String REGISTRY_BASE = "registryBase";
- String FAMILY_NAME = "familyName";
- String COMPONENT_NAME = "componentName";
- String COMPONENT_VERSION = "componentVersion";
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/package-info.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/package-info.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/package-info.java
deleted file mode 100644
index 4af7984..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/package-info.java
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * An abstract API for working with components in a registry.
- * @author Donal Fellows
- * @author David Withers
- */
-package net.sf.taverna.t2.component.api;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ActivityProfile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ActivityProfile.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ActivityProfile.java
deleted file mode 100644
index f656dd0..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ActivityProfile.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package net.sf.taverna.t2.component.api.profile;
-
-public interface ActivityProfile extends AnnotatedElement {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/AnnotatedElement.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/AnnotatedElement.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/AnnotatedElement.java
deleted file mode 100644
index dafec43..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/AnnotatedElement.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package net.sf.taverna.t2.component.api.profile;
-
-import java.util.List;
-
-import net.sf.taverna.t2.component.api.ComponentException;
-
-public interface AnnotatedElement {
- List<SemanticAnnotationProfile> getSemanticAnnotations()
- throws ComponentException;
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionHandling.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionHandling.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionHandling.java
deleted file mode 100644
index 5172f94..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionHandling.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.component.api.profile;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author alanrw
- *
- */
-public class ExceptionHandling {
- private final boolean failLists;
- private final List<HandleException> remapped = new ArrayList<HandleException>();
-
- public ExceptionHandling(
- net.sf.taverna.t2.component.api.profile.doc.ExceptionHandling proxied) {
- for (net.sf.taverna.t2.component.api.profile.doc.HandleException he : proxied
- .getHandleException())
- remapped.add(new HandleException(he));
- this.failLists = proxied.getFailLists() != null;
- }
-
- public boolean failLists() {
- return failLists;
- }
-
- public List<HandleException> getHandleExceptions() {
- return remapped;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionReplacement.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionReplacement.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionReplacement.java
deleted file mode 100644
index e71c5ec..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/ExceptionReplacement.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.component.api.profile;
-
-import net.sf.taverna.t2.component.api.profile.doc.Replacement;
-
-/**
- * @author alanrw
- *
- */
-public class ExceptionReplacement {
- private final String id, message;
-
- public ExceptionReplacement(Replacement replacement) {
- id = replacement.getReplacementId();
- message = replacement.getReplacementMessage();
- }
-
- public String getReplacementId() {
- return id;
- }
-
- public String getReplacementMessage() {
- return message;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/HandleException.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/HandleException.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/HandleException.java
deleted file mode 100644
index 1c3332b..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/HandleException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.component.api.profile;
-
-import static java.util.regex.Pattern.DOTALL;
-import static java.util.regex.Pattern.compile;
-
-import java.util.regex.Pattern;
-
-/**
- * @author alanrw
- *
- */
-public class HandleException {
- private final Pattern pattern;
- private ExceptionReplacement replacement;
- private final boolean pruneStack;
-
- public HandleException(
- net.sf.taverna.t2.component.api.profile.doc.HandleException proxied) {
- pruneStack = proxied.getPruneStack() != null;
- pattern = compile(proxied.getPattern(), DOTALL);
- if (proxied.getReplacement() != null)
- replacement = new ExceptionReplacement(proxied.getReplacement());
- }
-
- public boolean matches(String s) {
- return pattern.matcher(s).matches();
- }
-
- public boolean pruneStack() {
- return pruneStack;
- }
-
- public ExceptionReplacement getReplacement() {
- return replacement;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/PortProfile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/PortProfile.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/PortProfile.java
deleted file mode 100644
index 5d66de8..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/PortProfile.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package net.sf.taverna.t2.component.api.profile;
-
-
-public interface PortProfile extends AnnotatedElement {
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/Profile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/Profile.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/Profile.java
deleted file mode 100644
index c0899f8..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/Profile.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package net.sf.taverna.t2.component.api.profile;
-
-import java.util.List;
-import java.util.Map;
-
-import net.sf.taverna.t2.component.api.NamedItem;
-import net.sf.taverna.t2.component.api.Registry;
-import net.sf.taverna.t2.component.api.ComponentException;
-
-import com.hp.hpl.jena.ontology.OntModel;
-
-public interface Profile extends NamedItem, AnnotatedElement {
-
- Registry getComponentRegistry();
-
- String getXML() throws ComponentException;
-
- net.sf.taverna.t2.component.api.profile.doc.Profile getProfileDocument()
- throws ComponentException;
-
- String getId();
-
- String getOntologyLocation(String ontologyId);
-
- Map<String, String> getPrefixMap() throws ComponentException;
-
- OntModel getOntology(String ontologyId);
-
- List<PortProfile> getInputPortProfiles();
-
- List<SemanticAnnotationProfile> getInputSemanticAnnotationProfiles()
- throws ComponentException;
-
- List<PortProfile> getOutputPortProfiles();
-
- List<SemanticAnnotationProfile> getOutputSemanticAnnotationProfiles()
- throws ComponentException;
-
- List<ActivityProfile> getActivityProfiles();
-
- List<SemanticAnnotationProfile> getActivitySemanticAnnotationProfiles()
- throws ComponentException;
-
- ExceptionHandling getExceptionHandling();
-
- void delete() throws ComponentException;
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/SemanticAnnotationProfile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/SemanticAnnotationProfile.java b/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/SemanticAnnotationProfile.java
deleted file mode 100644
index 3000576..0000000
--- a/taverna-component-repository-api/src/main/java/net/sf/taverna/t2/component/api/profile/SemanticAnnotationProfile.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package net.sf.taverna.t2.component.api.profile;
-
-import java.util.List;
-
-import com.hp.hpl.jena.ontology.Individual;
-import com.hp.hpl.jena.ontology.OntClass;
-import com.hp.hpl.jena.ontology.OntModel;
-import com.hp.hpl.jena.ontology.OntProperty;
-
-public interface SemanticAnnotationProfile {
-
- /**
- * Returns the ontology that defines semantic annotation.
- *
- * @return the ontology that defines semantic annotation
- */
- OntModel getOntology();
-
- /**
- * Returns the predicate for the semantic annotation.
- *
- * @return the predicate for the semantic annotation
- */
- OntProperty getPredicate();
-
- String getPredicateString();
-
- String getClassString();
-
- /**
- * Returns the individual that the semantic annotation must use.
- *
- * May be null if no explicit individual is required.
- *
- * @return the individual that the semantic annotation must use
- */
- Individual getIndividual();
-
- /**
- * Returns the individuals in the range of the predicate defined in the
- * ontology.
- *
- * @return the individuals in the range of the predicate defined in the
- * ontology
- */
- List<Individual> getIndividuals();
-
- Integer getMinOccurs();
-
- Integer getMaxOccurs();
-
- OntClass getRangeClass();
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Component.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Component.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Component.java
new file mode 100644
index 0000000..4b88d0a
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Component.java
@@ -0,0 +1,71 @@
+package org.apache.taverna.component.api;
+
+import java.net.URL;
+import java.util.SortedMap;
+
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+
+/**
+ * The abstract interface supported by a component.
+ *
+ * @author Donal Fellows
+ * @author David Withers
+ */
+public interface Component extends NamedItem {
+ /**
+ * @return the name of the Component.
+ */
+ @Override
+ String getName();
+
+ /**
+ * Returns the URL for the Component.
+ *
+ * @return the URL for the Component.
+ */
+ URL getComponentURL();
+
+ /**
+ * Creates a new version of this Component.
+ *
+ * @param bundle
+ * the workflow that the new ComponentVersion will use.
+ * @return a new version of this Component.
+ * @throws ComponentException
+ * if there is a problem accessing the ComponentRegistry.
+ */
+ Version addVersionBasedOn(WorkflowBundle bundle, String revisionComment)
+ throws ComponentException;
+
+ /**
+ * Returns the ComponentVersion that has the specified version number.
+ *
+ * @param version
+ * the version number of the ComponentVersion to return.
+ * @return the ComponentVersion that has the specified version number.
+ * @throws ComponentException
+ * if there is a problem accessing the ComponentRegistry.
+ */
+ Version getComponentVersion(Integer version) throws ComponentException;
+
+ /**
+ * @return the description of the Component.
+ */
+ @Override
+ String getDescription();
+
+ /**
+ * Returns a SortedMap of version number to ComponentVersion.
+ * <p>
+ * The returned map is sorted increasing numeric order.
+ *
+ * @return a SortedMap of version number to ComponentVersion.
+ */
+ SortedMap<Integer, Version> getComponentVersionMap();
+
+ Registry getRegistry();
+
+ Family getFamily();
+
+ void delete() throws ComponentException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/ComponentException.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/ComponentException.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/ComponentException.java
new file mode 100644
index 0000000..3294cdd
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/ComponentException.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package org.apache.taverna.component.api;
+
+/**
+ * Thrown when there is a problem interacting with a ComponentRegistry.
+ *
+ * @author David Withers
+ */
+public class ComponentException extends Exception {
+ private static final long serialVersionUID = -5222074350812438467L;
+
+ public ComponentException() {
+ super();
+ }
+
+ public ComponentException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public ComponentException(String message) {
+ super(message);
+ }
+
+ public ComponentException(Throwable cause) {
+ super(cause);
+ }
+
+ public ComponentException(String messageTemplate, Object...parameters) {
+ super(String.format(messageTemplate, parameters));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/ComponentFactory.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/ComponentFactory.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/ComponentFactory.java
new file mode 100644
index 0000000..d88b36b
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/ComponentFactory.java
@@ -0,0 +1,27 @@
+package org.apache.taverna.component.api;
+
+import java.net.URL;
+
+import org.apache.taverna.component.api.profile.Profile;
+
+public interface ComponentFactory {
+ public Registry getRegistry(URL registryBase) throws ComponentException;
+
+ public Family getFamily(URL registryBase, String familyName)
+ throws ComponentException;
+
+ public Component getComponent(URL registryBase, String familyName,
+ String componentName) throws ComponentException;
+
+ public Version getVersion(URL registryBase, String familyName,
+ String componentName, Integer componentVersion)
+ throws ComponentException;
+
+ public Version getVersion(Version.ID ident) throws ComponentException;
+
+ public Component getComponent(Version.ID ident) throws ComponentException;
+
+ public Profile getProfile(URL url) throws ComponentException;
+
+ public Profile getBaseProfile() throws ComponentException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Family.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Family.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Family.java
new file mode 100644
index 0000000..d27260f
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Family.java
@@ -0,0 +1,100 @@
+package org.apache.taverna.component.api;
+
+import java.util.List;
+
+import org.apache.taverna.component.api.profile.Profile;
+
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+
+public interface Family extends NamedItem {
+ /**
+ * Creates a new Component and adds it to this ComponentFamily.
+ *
+ * @param componentName
+ * the name of the Component to create. Must not be null.
+ * @param bundle
+ * the workflow for the Component. Must not be null.
+ * @return the new Component.
+ * @throws ComponentException
+ * <ul>
+ * <li>if componentName is null,
+ * <li>if dataflow is null,
+ * <li>if a Component with this name already exists,
+ * <li>if there is a problem accessing the ComponentRegistry.
+ * </ul>
+ */
+ Version createComponentBasedOn(String componentName, String description,
+ WorkflowBundle bundle) throws ComponentException;
+
+ /**
+ * Returns the Component with the specified name.
+ * <p>
+ * If this ComponentFamily does not contain a Component with the specified
+ * name <code>null</code> is returned.
+ *
+ * @param componentName
+ * the name of the Component to return. Must not be null.
+ * @return the Component with the specified name.
+ * @throws ComponentException
+ * if there is a problem accessing the ComponentRegistry.
+ */
+ Component getComponent(String componentName) throws ComponentException;
+
+ /**
+ * Removes the specified Component from this ComponentFamily.
+ * <p>
+ * If this ComponentFamily does not contain the Component this method has no
+ * effect.
+ *
+ * @param component
+ * the Component to remove.
+ * @throws ComponentException
+ * if there is a problem accessing the ComponentRegistry.
+ */
+ void removeComponent(Component component) throws ComponentException;
+
+ /**
+ * Returns all the Components in this ComponentFamily.
+ * <p>
+ * If this ComponentFamily does not contain any Components an empty list is
+ * returned.
+ *
+ * @return all the Components in this ComponentFamilies.
+ * @throws ComponentException
+ * if there is a problem accessing the ComponentRegistry.
+ */
+ List<Component> getComponents() throws ComponentException;
+
+ /**
+ * Returns the ComponentProfile for this ComponentFamily.
+ *
+ * @return the ComponentProfile for this ComponentFamily.
+ * @throws ComponentException
+ */
+ Profile getComponentProfile() throws ComponentException;
+
+ /**
+ * Returns the ComponentRegistry that contains this ComponentFamily.
+ *
+ * @return the ComponentRegistry that contains this ComponentFamily.
+ */
+ Registry getComponentRegistry();
+
+ /**
+ * @return the name of the component Family.
+ */
+ @Override
+ String getName();
+
+ /**
+ * @return the description of the component Family.
+ */
+ @Override
+ String getDescription();
+
+ /**
+ * Delete this family from its registry.
+ * @throws ComponentException
+ */
+ void delete() throws ComponentException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/License.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/License.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/License.java
new file mode 100644
index 0000000..84ca472
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/License.java
@@ -0,0 +1,12 @@
+/**
+ *
+ */
+package org.apache.taverna.component.api;
+
+/**
+ * @author alson
+ *
+ */
+public interface License extends NamedItem {
+ public String getAbbreviation();
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/NamedItem.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/NamedItem.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/NamedItem.java
new file mode 100644
index 0000000..7cb62f1
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/NamedItem.java
@@ -0,0 +1,8 @@
+package org.apache.taverna.component.api;
+
+public interface NamedItem {
+ /** Name this entity. */
+ public String getName();
+ /** Describe this entity. */
+ public String getDescription();
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Registry.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Registry.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Registry.java
new file mode 100644
index 0000000..48fc8f6
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Registry.java
@@ -0,0 +1,139 @@
+package org.apache.taverna.component.api;
+
+import java.net.URL;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.taverna.component.api.profile.Profile;
+
+public interface Registry {
+
+ License getPreferredLicense() throws ComponentException;
+
+ Set<Version.ID> searchForComponents(String prefixString, String text)
+ throws ComponentException;
+
+ /**
+ * Returns all the ComponentFamilies in this ComponetRegistry.
+ * <p>
+ * If this ComponentRegistry does not contain any ComponentFamilies an empty
+ * list is returned.
+ *
+ * @return all the ComponentFamilies in this ComponetRegistry.
+ * @throws ComponentException
+ * if there is a problem accessing the ComponentRegistry.
+ */
+ List<Family> getComponentFamilies() throws ComponentException;
+
+ List<License> getLicenses() throws ComponentException;
+
+ List<SharingPolicy> getPermissions() throws ComponentException;
+
+ /**
+ * Adds a ComponentProfile to this ComponentRegistry.
+ *
+ * @param componentProfile
+ * the ComponentProfile to add. Must not be null.
+ * @param sharingPolicy
+ * @param license
+ * @return the ComponentProfile added to this ComponentRegistry.
+ * @throws ComponentException
+ * <ul>
+ * <li>if componentProfile is null,
+ * <li>if there is a problem accessing the ComponentRegistry.
+ * </ul>
+ */
+ Profile addComponentProfile(Profile componentProfile, License license,
+ SharingPolicy sharingPolicy) throws ComponentException;
+
+ /**
+ * Returns all the ComponentProfiles in this ComponetRegistry.
+ * <p>
+ * If this ComponentRegistry does not contain any ComponentProfiles an empty
+ * list is returned.
+ *
+ * @return all the ComponentProfiles in this ComponetRegistry.
+ * @throws ComponentException
+ * if there is a problem accessing the ComponentRegistry.
+ */
+ List<Profile> getComponentProfiles() throws ComponentException;
+
+ /**
+ * Returns the ComponentProfile with the given ID in this ComponetRegistry.
+ * <p>
+ * If this ComponentRegistry does not contain the ComponentProfile, a
+ * <tt>null</tt> is returned.
+ *
+ * @return the matching ComponentProfile in this ComponetRegistry, or
+ * <tt>null</tt> if there is no such thing.
+ * @throws ComponentException
+ * if there is a problem accessing the ComponentRegistry.
+ */
+ Profile getComponentProfile(String id) throws ComponentException;
+
+ String getRegistryBaseString();
+
+ /**
+ * Returns the location of this ComponentRepository.
+ *
+ * @return the location of this ComponentRepository
+ */
+ URL getRegistryBase();
+
+ /**
+ * Removes a the ComponentFamily with the specified name from this
+ * ComponentRegistry.
+ * <p>
+ * If this ComponentRegistry does not contain a ComponentFamily with the
+ * specified name this method has no effect.
+ *
+ * @param componentFamily
+ * the ComponentFamily to remove.
+ * @throws ComponentException
+ * if there is a problem accessing the ComponentRegistry.
+ */
+ void removeComponentFamily(Family componentFamily) throws ComponentException;
+
+ /**
+ * Creates a new ComponentFamily and adds it to this ComponentRegistry.
+ *
+ * @param familyName
+ * the name of the ComponentFamily to create. Must not be null.
+ * @param componentProfile
+ * the ComponentProfile for the new ComponentFamily. Must not be
+ * null.
+ * @param sharingPolicy
+ * the SharingPolicy to use for the new ComponentFamily.
+ * @return the new ComponentFamily
+ * @throws ComponentException
+ * <ul>
+ * <li>if familyName is null,
+ * <li>if componentProfile is null,
+ * <li>if a ComponentFamily with this name already exists,
+ * <li>if there is a problem accessing the ComponentRegistry.
+ * </ul>
+ */
+ Family createComponentFamily(String familyName, Profile componentProfile,
+ String description, License license, SharingPolicy sharingPolicy)
+ throws ComponentException;
+
+ /**
+ * Returns the ComponentFamily with the specified name.
+ * <p>
+ * If this ComponentRegistry does not contain a ComponentFamily with the
+ * specified name <code>null</code> is returned.
+ *
+ * @param familyName
+ * the name of the ComponentFamily to return. Must not be null.
+ * @return the ComponentFamily with the specified name in this
+ * ComponentRepository or null if none exists.
+ * @throws ComponentException
+ * if there is a problem accessing the ComponentRegistry.
+ */
+ Family getComponentFamily(String familyName) throws ComponentException;
+
+ /**
+ * @return A description of the type of registry this is.
+ */
+ String getRegistryTypeName();
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/SharingPolicy.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/SharingPolicy.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/SharingPolicy.java
new file mode 100644
index 0000000..4f359b2
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/SharingPolicy.java
@@ -0,0 +1,17 @@
+/**
+ *
+ */
+package org.apache.taverna.component.api;
+
+/**
+ * @author alanrw
+ *
+ */
+public interface SharingPolicy {
+
+ /**
+ * @return The user-relevant name of the permission
+ */
+ public abstract String getName();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Version.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Version.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Version.java
new file mode 100644
index 0000000..4c7f16b
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/Version.java
@@ -0,0 +1,206 @@
+package org.apache.taverna.component.api;
+
+import java.io.Serializable;
+import java.net.URL;
+
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+
+public interface Version {
+ /** @return The version number of this version */
+ Integer getVersionNumber();
+
+ /** @return The description of this version */
+ String getDescription();
+
+ /** @return The implementation for this version */
+ WorkflowBundle getImplementation() throws ComponentException;
+
+ /** @return The component of which this is a version */
+ Component getComponent();
+
+ /** @return The identification token for this version */
+ ID getID();
+
+ URL getHelpURL();
+
+ interface ID extends Serializable {
+ /** @return The name of the family of the component to which we refer to */
+ String getFamilyName();
+
+ /** @return The base URL of the registry containing the component */
+ URL getRegistryBase();
+
+ /**
+ * @return The name of the component referred to, unique within its
+ * family
+ */
+ String getComponentName();
+
+ /**
+ * @return The version number of the version of the component referred
+ * to
+ */
+ Integer getComponentVersion();
+
+ /**
+ * Tests whether this ID is equal to the given one, <i>excluding</i> the
+ * version.
+ *
+ * @param id
+ * The ID to compare to.
+ * @return A boolean
+ */
+ boolean mostlyEqualTo(ID id);
+
+ /**
+ * Tests whether this ID is equal to the given component,
+ * <i>excluding</i> the version.
+ *
+ * @param component
+ * The component to compare to.
+ * @return A boolean
+ */
+ boolean mostlyEqualTo(Component component);
+ }
+
+ class Identifier implements ID {
+ private static final long serialVersionUID = 1139928258250264997L;
+
+ private final URL registryBase;
+ private final String familyName;
+ private final String componentName;
+ private final Integer componentVersion;
+
+ public Identifier(URL registryBase, String familyName,
+ String componentName, Integer componentVersion) {
+ super();
+ this.registryBase = registryBase;
+ this.familyName = familyName;
+ this.componentName = componentName;
+ this.componentVersion = componentVersion;
+ }
+
+ /**
+ * @return the registryBase
+ */
+ @Override
+ public URL getRegistryBase() {
+ return registryBase;
+ }
+
+ /**
+ * @return the familyName
+ */
+ @Override
+ public String getFamilyName() {
+ return familyName;
+ }
+
+ /**
+ * @return the componentName
+ */
+ @Override
+ public String getComponentName() {
+ return componentName;
+ }
+
+ /**
+ * @return the componentVersion
+ */
+ @Override
+ public Integer getComponentVersion() {
+ return componentVersion;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result *= prime;
+ result += (componentName == null) ? 0 : componentName.hashCode();
+ result *= prime;
+ result += (componentVersion == null) ? 0 : componentVersion
+ .hashCode();
+ result *= prime;
+ result += (familyName == null) ? 0 : familyName.hashCode();
+ result *= prime;
+ result += (registryBase == null) ? 0 : registryBase.hashCode();
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!ID.class.isAssignableFrom(obj.getClass()))
+ return false;
+ ID other = (ID) obj;
+ if (componentName == null) {
+ if (other.getComponentName() != null)
+ return false;
+ } else if (!componentName.equals(other.getComponentName()))
+ return false;
+ if (componentVersion == null) {
+ if (other.getComponentVersion() != null)
+ return false;
+ } else if (!componentVersion.equals(other.getComponentVersion()))
+ return false;
+ if (familyName == null) {
+ if (other.getFamilyName() != null)
+ return false;
+ } else if (!familyName.equals(other.getFamilyName()))
+ return false;
+ if (registryBase == null) {
+ if (other.getRegistryBase() != null)
+ return false;
+ } else if (!registryBase.toString().equals(
+ other.getRegistryBase().toString()))
+ // NB: Comparison of URLs is on their string form!
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return getComponentName() + " V. " + getComponentVersion()
+ + " in family " + getFamilyName() + " on "
+ + getRegistryBase().toExternalForm();
+ }
+
+ @Override
+ public boolean mostlyEqualTo(ID id) {
+ if (this == id)
+ return true;
+ if (id == null)
+ return false;
+ if (getClass() != id.getClass())
+ return false;
+ if (componentName == null) {
+ if (id.getFamilyName() != null)
+ return false;
+ } else if (!componentName.equals(id.getComponentName()))
+ return false;
+ if (familyName == null) {
+ if (id.getFamilyName() != null)
+ return false;
+ } else if (!familyName.equals(id.getFamilyName()))
+ return false;
+ if (registryBase == null) {
+ if (id.getRegistryBase() != null)
+ return false;
+ } else if (!registryBase.toString().equals(
+ id.getRegistryBase().toString()))
+ // NB: Comparison of URLs is on their string form!
+ return false;
+ return true;
+ }
+
+ @Override
+ public boolean mostlyEqualTo(Component c) {
+ return mostlyEqualTo(new Identifier(c.getRegistry()
+ .getRegistryBase(), c.getFamily().getName(), c.getName(), 0));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/config/ComponentConfig.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/config/ComponentConfig.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/config/ComponentConfig.java
new file mode 100644
index 0000000..3faebec
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/config/ComponentConfig.java
@@ -0,0 +1,5 @@
+package org.apache.taverna.component.api.config;
+
+public interface ComponentConfig {
+ String URI = "http://ns.taverna.org.uk/2010/activity/component";
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/config/ComponentPropertyNames.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/config/ComponentPropertyNames.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/config/ComponentPropertyNames.java
new file mode 100644
index 0000000..8470cbf
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/config/ComponentPropertyNames.java
@@ -0,0 +1,14 @@
+package org.apache.taverna.component.api.config;
+
+/**
+ * The names of properties used in JSON configurations associated with
+ * components.
+ *
+ * @author Donal Fellows
+ */
+public interface ComponentPropertyNames {
+ String REGISTRY_BASE = "registryBase";
+ String FAMILY_NAME = "familyName";
+ String COMPONENT_NAME = "componentName";
+ String COMPONENT_VERSION = "componentVersion";
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/package-info.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/package-info.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/package-info.java
new file mode 100644
index 0000000..bb74290
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/package-info.java
@@ -0,0 +1,6 @@
+/**
+ * An abstract API for working with components in a registry.
+ * @author Donal Fellows
+ * @author David Withers
+ */
+package org.apache.taverna.component.api;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ActivityProfile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ActivityProfile.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ActivityProfile.java
new file mode 100644
index 0000000..0eb023f
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ActivityProfile.java
@@ -0,0 +1,5 @@
+package org.apache.taverna.component.api.profile;
+
+public interface ActivityProfile extends AnnotatedElement {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/AnnotatedElement.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/AnnotatedElement.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/AnnotatedElement.java
new file mode 100644
index 0000000..b961a3c
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/AnnotatedElement.java
@@ -0,0 +1,10 @@
+package org.apache.taverna.component.api.profile;
+
+import java.util.List;
+
+import org.apache.taverna.component.api.ComponentException;
+
+public interface AnnotatedElement {
+ List<SemanticAnnotationProfile> getSemanticAnnotations()
+ throws ComponentException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ExceptionHandling.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ExceptionHandling.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ExceptionHandling.java
new file mode 100644
index 0000000..1b07c53
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ExceptionHandling.java
@@ -0,0 +1,32 @@
+/**
+ *
+ */
+package org.apache.taverna.component.api.profile;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author alanrw
+ *
+ */
+public class ExceptionHandling {
+ private final boolean failLists;
+ private final List<HandleException> remapped = new ArrayList<HandleException>();
+
+ public ExceptionHandling(
+ net.sf.taverna.t2.component.api.profile.doc.ExceptionHandling proxied) {
+ for (net.sf.taverna.t2.component.api.profile.doc.HandleException he : proxied
+ .getHandleException())
+ remapped.add(new HandleException(he));
+ this.failLists = proxied.getFailLists() != null;
+ }
+
+ public boolean failLists() {
+ return failLists;
+ }
+
+ public List<HandleException> getHandleExceptions() {
+ return remapped;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ExceptionReplacement.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ExceptionReplacement.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ExceptionReplacement.java
new file mode 100644
index 0000000..2f4e6c4
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/ExceptionReplacement.java
@@ -0,0 +1,27 @@
+/**
+ *
+ */
+package org.apache.taverna.component.api.profile;
+
+import net.sf.taverna.t2.component.api.profile.doc.Replacement;
+
+/**
+ * @author alanrw
+ *
+ */
+public class ExceptionReplacement {
+ private final String id, message;
+
+ public ExceptionReplacement(Replacement replacement) {
+ id = replacement.getReplacementId();
+ message = replacement.getReplacementMessage();
+ }
+
+ public String getReplacementId() {
+ return id;
+ }
+
+ public String getReplacementMessage() {
+ return message;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/HandleException.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/HandleException.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/HandleException.java
new file mode 100644
index 0000000..3795ec9
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/HandleException.java
@@ -0,0 +1,39 @@
+/**
+ *
+ */
+package org.apache.taverna.component.api.profile;
+
+import static java.util.regex.Pattern.DOTALL;
+import static java.util.regex.Pattern.compile;
+
+import java.util.regex.Pattern;
+
+/**
+ * @author alanrw
+ *
+ */
+public class HandleException {
+ private final Pattern pattern;
+ private ExceptionReplacement replacement;
+ private final boolean pruneStack;
+
+ public HandleException(
+ net.sf.taverna.t2.component.api.profile.doc.HandleException proxied) {
+ pruneStack = proxied.getPruneStack() != null;
+ pattern = compile(proxied.getPattern(), DOTALL);
+ if (proxied.getReplacement() != null)
+ replacement = new ExceptionReplacement(proxied.getReplacement());
+ }
+
+ public boolean matches(String s) {
+ return pattern.matcher(s).matches();
+ }
+
+ public boolean pruneStack() {
+ return pruneStack;
+ }
+
+ public ExceptionReplacement getReplacement() {
+ return replacement;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/PortProfile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/PortProfile.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/PortProfile.java
new file mode 100644
index 0000000..9a7199d
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/PortProfile.java
@@ -0,0 +1,5 @@
+package org.apache.taverna.component.api.profile;
+
+
+public interface PortProfile extends AnnotatedElement {
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/Profile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/Profile.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/Profile.java
new file mode 100644
index 0000000..eb8fc16
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/Profile.java
@@ -0,0 +1,47 @@
+package org.apache.taverna.component.api.profile;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.taverna.component.api.ComponentException;
+import org.apache.taverna.component.api.NamedItem;
+import org.apache.taverna.component.api.Registry;
+
+import com.hp.hpl.jena.ontology.OntModel;
+
+public interface Profile extends NamedItem, AnnotatedElement {
+
+ Registry getComponentRegistry();
+
+ String getXML() throws ComponentException;
+
+ net.sf.taverna.t2.component.api.profile.doc.Profile getProfileDocument()
+ throws ComponentException;
+
+ String getId();
+
+ String getOntologyLocation(String ontologyId);
+
+ Map<String, String> getPrefixMap() throws ComponentException;
+
+ OntModel getOntology(String ontologyId);
+
+ List<PortProfile> getInputPortProfiles();
+
+ List<SemanticAnnotationProfile> getInputSemanticAnnotationProfiles()
+ throws ComponentException;
+
+ List<PortProfile> getOutputPortProfiles();
+
+ List<SemanticAnnotationProfile> getOutputSemanticAnnotationProfiles()
+ throws ComponentException;
+
+ List<ActivityProfile> getActivityProfiles();
+
+ List<SemanticAnnotationProfile> getActivitySemanticAnnotationProfiles()
+ throws ComponentException;
+
+ ExceptionHandling getExceptionHandling();
+
+ void delete() throws ComponentException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/SemanticAnnotationProfile.java
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/SemanticAnnotationProfile.java b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/SemanticAnnotationProfile.java
new file mode 100644
index 0000000..6d5694b
--- /dev/null
+++ b/taverna-component-repository-api/src/main/java/org/apache/taverna/component/api/profile/SemanticAnnotationProfile.java
@@ -0,0 +1,54 @@
+package org.apache.taverna.component.api.profile;
+
+import java.util.List;
+
+import com.hp.hpl.jena.ontology.Individual;
+import com.hp.hpl.jena.ontology.OntClass;
+import com.hp.hpl.jena.ontology.OntModel;
+import com.hp.hpl.jena.ontology.OntProperty;
+
+public interface SemanticAnnotationProfile {
+
+ /**
+ * Returns the ontology that defines semantic annotation.
+ *
+ * @return the ontology that defines semantic annotation
+ */
+ OntModel getOntology();
+
+ /**
+ * Returns the predicate for the semantic annotation.
+ *
+ * @return the predicate for the semantic annotation
+ */
+ OntProperty getPredicate();
+
+ String getPredicateString();
+
+ String getClassString();
+
+ /**
+ * Returns the individual that the semantic annotation must use.
+ *
+ * May be null if no explicit individual is required.
+ *
+ * @return the individual that the semantic annotation must use
+ */
+ Individual getIndividual();
+
+ /**
+ * Returns the individuals in the range of the predicate defined in the
+ * ontology.
+ *
+ * @return the individuals in the range of the predicate defined in the
+ * ontology
+ */
+ List<Individual> getIndividuals();
+
+ Integer getMinOccurs();
+
+ Integer getMaxOccurs();
+
+ OntClass getRangeClass();
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-plugin-component/blob/2421ba84/taverna-component-repository-api/src/main/resources/ComponentProfile.xsd
----------------------------------------------------------------------
diff --git a/taverna-component-repository-api/src/main/resources/ComponentProfile.xsd b/taverna-component-repository-api/src/main/resources/ComponentProfile.xsd
index 95b4405..b84e317 100644
--- a/taverna-component-repository-api/src/main/resources/ComponentProfile.xsd
+++ b/taverna-component-repository-api/src/main/resources/ComponentProfile.xsd
@@ -8,7 +8,7 @@
<xs:annotation>
<xs:appinfo>
<jxb:schemaBindings>
- <jxb:package name="net.sf.taverna.t2.component.api.profile.doc" />
+ <jxb:package name="org.apache.taverna.component.api.profile.doc" />
</jxb:schemaBindings>
</xs:appinfo>
</xs:annotation>