ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1357570 [9/34] - in /ace/sandbox/marrs: cnf/ cnf/ext/ cnf/lib/ cnf/releaserepo/ cnf/repo/ cnf/repo/.obrcache/ cnf/repo/.obrcache/http%3A%2F%2Fbundles.bndtools.org.s3.amazonaws.com%2Fcom.jcraft.jsch/ cnf/repo/.obrcache/http%3A%2F%2Fbundles....
Date Thu, 05 Jul 2012 12:10:06 GMT
Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactHelper.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactHelper.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactHelper.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactHelper.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,93 @@
+/*
+ * 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.ace.client.repository.helper;
+
+import java.util.Comparator;
+import java.util.Map;
+import org.apache.ace.client.repository.object.ArtifactObject;
+
+/**
+ * Interface to an artifact helper. For each type of artifact, there should be a helper
+ * service implementing this interface. The service should be registered with the mimetype
+ * in the service's properties, so it can be identified. The <code>KEY_MIMETYPE</code> in
+ * this class can be used for this purpose.
+ */
+public interface ArtifactHelper
+{
+    public static final String KEY_MIMETYPE = "mimetype";
+
+    /**
+     * Checks whether this helper can 'do anything' with this artifact object.
+     * @param object An artifact object.
+     * @return <code>true</code> when this helper can use the object, <code>false</code> otherwise.
+     */
+    public boolean canUse(ArtifactObject object);
+
+    /**
+     * Returns the artifact preprocessor that is associated with the type of artifact this
+     * helper helps. Return null when no useful processor is available.
+     * @return An artifact preprocessor, or <code>null</code> if no useful preprocessor can be created.
+     */
+    public ArtifactPreprocessor getPreprocessor();
+
+    /**
+     * Creates a filter string for use in associations, optionally with some
+     * additional properties. The basic implementation will use all <code>getDefiningKeys</code>.
+     * @param properties Properties indicating specifics of the filter to be created.
+     * @return A string representation of a filter, for use in <code>Association</code>s.
+     */
+    public <TYPE extends ArtifactObject> String getAssociationFilter(TYPE obj, Map<String, String> properties);
+
+    /**
+     * Determines the cardinality of this endpoint of an association, given
+     * the passed properties.
+     * @param properties Properties indicating specifics of this endpoint.
+     * @return The necessary cardinality.
+     */
+    public <TYPE extends ArtifactObject> int getCardinality(TYPE obj, Map<String, String> properties);
+
+    /**
+     * Returns a <code>Comparator</code> for this type of object. Descendent
+     * classes are expected to return a comparator if they can be meaningfully compared,
+     * and otherwise (if no order is natural), return <code>null</code>.
+     * @return A <code>Comparator</code> for this type of object
+     */
+    public Comparator<ArtifactObject> getComparator();
+
+    /**
+     * Checks the correctness of the given attributes for this type of object. If they
+     * are correct, the map will be returned, potentially with some changes, and if not,
+     * an {@link IllegalArgumentException} will be raised. Optionally, this
+     * function can do some validation of input parameters, such as normalizing numbers.
+     */
+    public Map<String, String> checkAttributes(Map<String, String> attributes);
+
+    /**
+     * Gets an array of keys in the attributes that are considered defining for this type
+     * of object; the combination of values of these keys should result in a unique
+     * identification of the object.
+     */
+    public String[] getDefiningKeys();
+
+    /**
+     * Gets an array of all attributes that have to be present when creating an object
+     * of this type.
+     */
+    public String[] getMandatoryAttributes();
+}
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactPreprocessor.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactPreprocessor.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactPreprocessor.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactPreprocessor.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,55 @@
+/*
+ * 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.ace.client.repository.helper;
+
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * An ArtifactPreprocessor processes an artifact before it is deployed.
+ */
+public interface ArtifactPreprocessor {
+    /**
+     * Preprocesses a single artifact, uploads it to the obr, and returns the new URL as a string.
+     *
+     * @param url A string representing a URL to the original artifact.
+     * @param props A PropertyResolver which can be used to fill in 'holes' in the template.
+     * @param targetID The targetID of the target for which this artifact is being processed.
+     * @param version The deployment version for which this artifact is being processed.
+     * @param obrBase A base OBR to upload the new artifact to.
+     * @return A URL to the new object (or the old one, if no replacing was necessary), as a string.
+     * @throws java.io.IOException Thrown if reading the original artifact goes wrong, or storing the processed one.
+     */
+    public String preprocess(String url, PropertyResolver props, String targetID, String version, URL obrBase) throws IOException;
+
+    /**
+     * Indicates whether the template should be processed again, given the properties, and the version to which it
+     * should be compared.
+     * 
+     * @param url A string representing a URL to the original artifact.
+     * @param props A PropertyResolver which can be used to fill in 'holes' in the template.
+     * @param targetID The targetID of the target for which this artifact is being processed.
+     * @param version The deployment version for which this artifact is being processed.
+     * @param fromVersion The deployment version to which the current one should be compared.
+     * @return <code>false</code> if the version of the processed artifact identified by <code>fromVersion</code>
+     *         is identical to what would be created using the new <code>props</code>; <code>true</code> otherwise.
+     * @throws java.io.IOException
+     */
+    public boolean needsNewVersion(String url, PropertyResolver props, String targetID, String fromVersion);
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactRecognizer.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactRecognizer.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactRecognizer.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactRecognizer.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,69 @@
+/*
+ * 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.ace.client.repository.helper;
+
+import java.util.Map;
+
+/**
+ * Service interface for services that can recognize the type of an artifact, given a URL
+ * to that artifact.
+ */
+public interface ArtifactRecognizer
+{
+    /**
+     * Tries to determine the type of the artifact. If this recognizer cannot determine the type, it
+     * should return <code>null</code>.
+     * 
+     * @param artifact the artifact to recognize, cannot be <code>null</code>.
+     * @return The mimetype of the artifact, or <code>null</code> if the artifact is not recognized.
+     */
+    public String recognize(ArtifactResource artifact);
+
+    /**
+     * Gets the relevant metadata for this artifact.
+     * 
+     * @param artifact the artifact to extract the metadata for, cannot be <code>null</code>.
+     * @return A map of strings, representing the relevant metadata specific for this artifact. The
+     *         keys are best defined in the corresponding <code>ArtifactHelper</code> interface for this type of artifact.
+     *         This function should also set the <code>ArtifactObject.KEY_PROCESSOR_PID</code> attribute.<br>
+     *         Optionally, <code>ArtifactObject.KEY_ARTIFACT_NAME</code> and <code>ArtifactObject.KEY_ARTIFACT_DESCRIPTION</code>
+     *         can be set.
+     * @throws IllegalArgumentException when the metadata cannot be retrieved from the <code>artifact</code>.
+     */
+    public Map<String, String> extractMetaData(ArtifactResource artifact) throws IllegalArgumentException;
+
+    /**
+     * Indicates whether this recognizer can handle (i.e., extract metadata) from an artifact of
+     * a given mime type.
+     * 
+     * @param mimetype The mimetype of an artifact.
+     * @return <code>true</code> when this type should be able to be handled by this recognizer;
+     *         <code>false</code> otherwise.
+     */
+    public boolean canHandle(String mimetype);
+
+    /**
+     * Returns a preferred extension for the file name if a new one is created.
+     * 
+     * @param artifact the artifact to get the extension for, cannot be <code>null</code>.
+     * 
+     * @return The extension that is preferred or an empty string if there is none.
+     */
+    public String getExtension(ArtifactResource artifact);
+}
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactResource.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactResource.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactResource.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/ArtifactResource.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,56 @@
+/*
+ * 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.ace.client.repository.helper;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * Denotes a 'physical' artifact that is located by an URL, and provide means to access the contents of this artifact.
+ * <p>
+ * Note that an artifact can be located on a remote machine, which might need credentials to access its contents. 
+ * This interface allows one to access the resource without having to worry about supplying those credentials, as the
+ * implementor of this class has to worry about this instead.
+ * </p>
+ */
+public interface ArtifactResource {
+
+    /**
+     * Returns the location of this artifact.
+     * <p>
+     * Note that although {@link URL#openConnection()} allows you to directly open a connection to the resource,
+     * in fact this may fail due to, for example, missing authentication credentials. Use {@link #openStream()}
+     * instead to access the contents of the resource.
+     * </p>
+     * 
+     * @return the URL to the 'physical' location of the artifact, never <code>null</code>.
+     */
+    URL getURL();
+
+    /**
+     * Provides access to the contents of the artifact.
+     * 
+     * @return an input stream, never <code>null</code>. 
+     * @throws IOException in case of I/O errors opening the artifact.
+     * @see #getURL()
+     */
+    InputStream openStream() throws IOException;
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/PropertyResolver.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/PropertyResolver.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/PropertyResolver.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/PropertyResolver.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,34 @@
+/*
+ * 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.ace.client.repository.helper;
+
+/**
+ * Interface for resolving properties about the template's
+ * environment which are to be used by an ArtifactPreprocessor.
+ */
+public interface PropertyResolver
+{
+    /**
+     * Gets a property, based on the given key. If the key cannot be found, <code>null</code>
+     * can be used.
+     * @param key A key to some property. Cannot be null.
+     * @return The property identified by <code>key</code> if it can be found, <code>null</code> otherwise.
+     */
+    public String get(String key);
+}
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/bundle/BundleHelper.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/bundle/BundleHelper.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/bundle/BundleHelper.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/bundle/BundleHelper.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,53 @@
+/*
+ * 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.ace.client.repository.helper.bundle;
+
+import org.apache.ace.client.repository.helper.ArtifactHelper;
+import org.apache.ace.client.repository.object.ArtifactObject;
+import org.osgi.framework.Constants;
+
+/**
+ * Definitions for a BundleHelper, which are used to treat an artifact as a bundle.
+ */
+public interface BundleHelper extends ArtifactHelper {
+    public static final String KEY_SYMBOLICNAME = Constants.BUNDLE_SYMBOLICNAME;
+    public static final String KEY_NAME = Constants.BUNDLE_NAME;
+    public static final String KEY_VERSION = Constants.BUNDLE_VERSION;
+    public static final String KEY_VENDOR = Constants.BUNDLE_VENDOR;
+    public static final String KEY_RESOURCE_PROCESSOR_PID = "Deployment-ProvidesResourceProcessor";
+
+    public static final String MIMETYPE = "application/vnd.osgi.bundle";
+
+    /**
+     * Used to include an OSGi version range (see section 3.2.5 of the core specification) with an association.
+     * When included in the association's properties, this statement will cause the association to automatically
+     * match the highest available bundle version that matches the statement; an open ended range can be
+     * created by passing "0.0.0".<br>
+     * Not specifying this attribute will lead to the <code>Artifact2GroupAssociation</code<'s default behavior,
+     * using all matches for the filter string.
+     */
+    public static final String KEY_ASSOCIATION_VERSIONSTATEMENT = "associationVersionStatement";
+
+    public boolean isResourceProcessor(ArtifactObject object);
+    public String getResourceProcessorPIDs(ArtifactObject object);
+    public String getSymbolicName(ArtifactObject object);
+    public String getName(ArtifactObject object);
+    public String getVersion(ArtifactObject object);
+    public String getVendor(ArtifactObject object);
+}
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/bundle/packageinfo
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/bundle/packageinfo?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/bundle/packageinfo (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/bundle/packageinfo Thu Jul  5 12:09:30 2012
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/packageinfo
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/packageinfo?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/packageinfo (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/helper/packageinfo Thu Jul  5 12:09:30 2012
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Artifact2FeatureAssociation.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Artifact2FeatureAssociation.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Artifact2FeatureAssociation.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Artifact2FeatureAssociation.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,33 @@
+/*
+ * 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.ace.client.repository.object;
+
+import org.apache.ace.client.repository.Association;
+
+/**
+ * Interface to a Artifact2FeatureAssociation. Most functionality is defined by the generic Association.
+ */
+public interface Artifact2FeatureAssociation extends Association<ArtifactObject, FeatureObject> {
+    public static final String TOPIC_ENTITY_ROOT = Artifact2FeatureAssociation.class.getSimpleName() + "/";
+
+    public static final String TOPIC_ADDED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ADDED_SUFFIX;
+    public static final String TOPIC_REMOVED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_REMOVED_SUFFIX;
+    public static final String TOPIC_CHANGED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_CHANGED_SUFFIX;
+    public static final String TOPIC_ALL = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ALL_SUFFIX;
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/ArtifactObject.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/ArtifactObject.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/ArtifactObject.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/ArtifactObject.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,113 @@
+/*
+ * 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.ace.client.repository.object;
+
+import java.util.List;
+
+import org.apache.ace.client.repository.RepositoryObject;
+
+/**
+ * Interface to an ArtifactObject. The basic functionality is defined by RepositoryObject, but extended for
+ * artifact-specific information.
+ */
+public interface ArtifactObject extends RepositoryObject {
+    /**
+     * Key to be used in the <code>ArtifactObject</code>'s attributes.
+     * Indicates the location of the persistent storage of the artifact.
+     */
+    public static final String KEY_URL = "url";
+    /**
+     * Attribute key, stating the unique name for this resource. Different versions of the same logical resource
+     * can share the same Id.
+     */
+    public static final String KEY_RESOURCE_ID = "resourceId";
+    /**
+     * Key to be used in the <code>ArtifactObject</code>'s attributes.
+     * Indicates the PID of the resource processor that should be used to process this artifact.
+     * For a bundle, it is empty.
+     */
+    public static final String KEY_PROCESSOR_PID = "processorPid";
+    /**
+     * Key to be used in the <code>ArtifactObject</code>'s attributes.
+     * Indicates the mimetype of this artifact. For artifacts which do not
+     * have an adequately discriminating mimetype, it can be extended with
+     * something non-standard.
+     */
+    public static final String KEY_MIMETYPE = "mimetype";
+    /**
+     * Key to be used in the <code>ArtifactObject</code>'s attributes.
+     * Holds a human-readable name for this artifact.
+     */
+    public static final String KEY_ARTIFACT_NAME = "artifactName";
+    /**
+     * Key to be used in the <code>ArtifactObject</code>'s attributes.
+     * Holds a human-readable description for this artifact.
+     */
+    public static final String KEY_ARTIFACT_DESCRIPTION = "artifactDescription";
+
+    public static final String TOPIC_ENTITY_ROOT = ArtifactObject.class.getSimpleName() + "/";
+
+    public static final String TOPIC_ADDED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ADDED_SUFFIX;
+    public static final String TOPIC_REMOVED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_REMOVED_SUFFIX;
+    public static final String TOPIC_CHANGED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_CHANGED_SUFFIX;
+    public static final String TOPIC_ALL = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ALL_SUFFIX;
+
+    /**
+     * Returns all <code>GroupObject</code>s this object is associated with. If there
+     * are none, an empty list will be returned.
+     */
+    public List<FeatureObject> getFeatures();
+    /**
+     * Returns all associations this artifact has with a given group.
+     */
+    public List<Artifact2FeatureAssociation> getAssociationsWith(FeatureObject group);
+
+    /**
+     * Returns the mimetype of this artifact.
+     */
+    public String getMimetype();
+    /**
+     * Returns the PID of the resource processor of this artifact.
+     */
+    public String getProcessorPID();
+    /**
+     * Sets the PID of the resource processor of this artifact.
+     */
+    public void setProcessorPID(String processorPID);
+    /**
+     * Returns the URL to this artifact.
+     */
+    public String getURL();
+    /**
+     * Returns a ResourceId, if that has been customized. 
+     */
+    public String getResourceId();
+    /**
+     * Return a descriptive name for this object. May return <code>null</code>.
+     */
+    public String getName();
+    /**
+     * Returns a description for this object. May return <code>null</code>.
+     */
+    public String getDescription();
+    /**
+     * Sets a description for this artifact.
+     */
+    public void setDescription(String value);
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DeploymentArtifact.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DeploymentArtifact.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DeploymentArtifact.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DeploymentArtifact.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,69 @@
+/*
+ * 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.ace.client.repository.object;
+
+/**
+ * Interface to a deployment artifact, which is used to gather information about
+ * the deployment of a single artifact.
+ */
+public interface DeploymentArtifact {
+
+    /**
+     * Key, intended to be used for artifacts which are bundles and will publish
+     * a resource processor (see OSGi compendium section 114.10).
+     */
+    public static final String DIRECTIVE_ISCUSTOMIZER = "DeploymentPackage-Customizer";
+
+    /**
+     * Key, intended to be used for resources which require a resource processor
+     * (see OSGi compendium section 114.10).
+     */
+    public static final String DIRECTIVE_KEY_PROCESSORID = "Resource-Processor";
+
+    /**
+     * Key, intended to be used for artifacts which have a resourceID that's different
+     * from their generated name (based on URL).
+     */
+    public static final String DIRECTIVE_KEY_RESOURCE_ID = "Resource-ID";
+
+    /**
+     * Key, intended to be used for matching processed (see ArtifactPreprocessor) to their
+     * 'original' one.
+     */
+    public static final String DIRECTIVE_KEY_BASEURL = "Base-Url";
+
+	public static final String REPOSITORY_PATH = "ACE-RepositoryPath";
+
+    /**
+     * @return the URL for this deployment artifact.
+     */
+    public String getUrl();
+
+    /**
+     * @param key A key String, such as the <code>DIRECTIVE_</code> constants in
+     * <code>DeploymentArtifact</code>.
+     * @return the value for the given directive key, or <code>null</code> if not found.
+     */
+    public String getDirective(String key);
+
+    /**
+     * @return an array of all keys that are used in this object, to be used in <code>getDirective</code>.
+     */
+    public String[] getKeys();
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DeploymentVersionObject.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DeploymentVersionObject.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DeploymentVersionObject.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DeploymentVersionObject.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,58 @@
+/*
+ * 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.ace.client.repository.object;
+
+import org.apache.ace.client.repository.RepositoryObject;
+
+/**
+ * The interface to a DeploymentVersion. The basic functionality is defined
+ * by RepositoryObject, but extended for deployment version-specific information.
+ *
+ * DeploymentVersions need some additional information about the artifacts they
+ * are associated with; see DeploymentArtifact.
+ */
+public interface DeploymentVersionObject extends RepositoryObject {
+
+    public static final String KEY_TARGETID = "targetID";
+    public static final String KEY_VERSION = "version";
+
+    public static final String TOPIC_ENTITY_ROOT = DeploymentVersionObject.class.getSimpleName() + "/";
+
+    public static final String TOPIC_ADDED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ADDED_SUFFIX;
+    public static final String TOPIC_REMOVED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_REMOVED_SUFFIX;
+    public static final String TOPIC_CHANGED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_CHANGED_SUFFIX;
+    public static final String TOPIC_ALL = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ALL_SUFFIX;
+
+    /**
+     * Gets the target which is related to this version.
+     */
+    public String getTargetID();
+
+    /**
+     * Gets the version number of this deployment version.
+     */
+    public String getVersion();
+
+    /**
+     * @return an array of all deployment artifacts that will be part of this deployment version.
+     * The order of the artifacts in the array is equal to the order they should appear in a
+     * deployment package.
+     */
+    public DeploymentArtifact[] getDeploymentArtifacts();
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Distribution2TargetAssociation.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Distribution2TargetAssociation.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Distribution2TargetAssociation.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Distribution2TargetAssociation.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,33 @@
+/*
+ * 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.ace.client.repository.object;
+
+import org.apache.ace.client.repository.Association;
+
+/**
+ * Interface to a Distribution2TargetAssociation. Most functionality is defined by the generic Association.
+ */
+public interface Distribution2TargetAssociation extends Association<DistributionObject, TargetObject> {
+    public static final String TOPIC_ENTITY_ROOT = Distribution2TargetAssociation.class.getSimpleName() + "/";
+
+    public static final String TOPIC_ADDED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ADDED_SUFFIX;
+    public static final String TOPIC_REMOVED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_REMOVED_SUFFIX;
+    public static final String TOPIC_CHANGED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_CHANGED_SUFFIX;
+    public static final String TOPIC_ALL = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ALL_SUFFIX;
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DistributionObject.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DistributionObject.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DistributionObject.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/DistributionObject.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,81 @@
+/*
+ * 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.ace.client.repository.object;
+
+import java.util.List;
+
+import org.apache.ace.client.repository.RepositoryObject;
+
+/**
+ * Interface to a DistributionObject. The basic functionality is defined by RepositoryObject, but extended for
+ * distribution-specific information.
+ */
+public interface DistributionObject extends RepositoryObject {
+    public static final String TOPIC_ENTITY_ROOT = DistributionObject.class.getSimpleName() + "/";
+
+    public static final String TOPIC_ADDED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ADDED_SUFFIX;
+    public static final String TOPIC_REMOVED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_REMOVED_SUFFIX;
+    public static final String TOPIC_CHANGED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_CHANGED_SUFFIX;
+    public static final String TOPIC_ALL = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ALL_SUFFIX;
+
+    public static final String KEY_DESCRIPTION = "description";
+    public static final String KEY_NAME = "name";
+
+    /**
+     * Returns all <code>FeatureObject</code>s this object is associated with. If there
+     * are none, an empty list will be returned.
+     */
+    public List<FeatureObject> getFeatures();
+    
+    /**
+     * Returns all <code>TargetObject</code>s this object is associated with. If there
+     * are none, an empty list will be returned.
+     */
+    public List<TargetObject> getTargets();
+
+    /**
+     * Returns all associations this distribution has with a given feature.
+     */
+    public List<Feature2DistributionAssociation> getAssociationsWith(FeatureObject feature);
+
+    /**
+     * Returns all associations this distribution has with a given target.
+     */
+    public List<Distribution2TargetAssociation> getAssociationsWith(TargetObject target);
+
+    /**
+     * Returns the name of this distribution.
+     */
+    public String getName();
+    
+    /**
+     * Sets the name of this distribution.
+     */
+    public void setName(String name);
+
+    /**
+     * Returns the description of this distribution.
+     */
+    public String getDescription();
+    
+    /**
+     * Sets the description of this distribution.
+     */
+    public void setDescription(String description);
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Feature2DistributionAssociation.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Feature2DistributionAssociation.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Feature2DistributionAssociation.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/Feature2DistributionAssociation.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,33 @@
+/*
+ * 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.ace.client.repository.object;
+
+import org.apache.ace.client.repository.Association;
+
+/**
+ * Interface to a Feature2DistributionAssociation. Most functionality is defined by the generic Association.
+ */
+public interface Feature2DistributionAssociation extends Association<FeatureObject, DistributionObject> {
+    public static final String TOPIC_ENTITY_ROOT = Feature2DistributionAssociation.class.getSimpleName() + "/";
+
+    public static final String TOPIC_ADDED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ADDED_SUFFIX;
+    public static final String TOPIC_REMOVED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_REMOVED_SUFFIX;
+    public static final String TOPIC_CHANGED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_CHANGED_SUFFIX;
+    public static final String TOPIC_ALL = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ALL_SUFFIX;
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/FeatureObject.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/FeatureObject.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/FeatureObject.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/FeatureObject.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,81 @@
+/*
+ * 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.ace.client.repository.object;
+
+import java.util.List;
+
+import org.apache.ace.client.repository.RepositoryObject;
+
+/**
+ * Interface to a FeatureObject. The basic functionality is defined by RepositoryObject, but extended for
+ * feature-specific information.
+ */
+public interface FeatureObject extends RepositoryObject {
+    public static final String KEY_DESCRIPTION = "description";
+    public static final String KEY_NAME = "name";
+
+    public static final String TOPIC_ENTITY_ROOT = FeatureObject.class.getSimpleName() + "/";
+
+    public static final String TOPIC_ADDED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ADDED_SUFFIX;
+    public static final String TOPIC_REMOVED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_REMOVED_SUFFIX;
+    public static final String TOPIC_CHANGED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_CHANGED_SUFFIX;
+    public static final String TOPIC_ALL = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ALL_SUFFIX;
+
+    /**
+     * Returns all <code>ArtifactObject</code>s this object is associated with. If there
+     * are none, an empty list will be returned.
+     */
+    public List<ArtifactObject> getArtifacts();
+    
+    /**
+     * Returns all <code>DistributionObject</code>s this object is associated with. If there
+     * are none, an empty list will be returned.
+     */
+    public List<DistributionObject> getDistributions();
+
+    /**
+     * Returns all associations this feature has with a given artifact.
+     */
+    public List<Artifact2FeatureAssociation> getAssociationsWith(ArtifactObject artifact);
+    
+    /**
+     * Returns all associations this feature has with a given distribution.
+     */
+    public List<Feature2DistributionAssociation> getAssociationsWith(DistributionObject distribution);
+
+    /**
+     * Returns the name of this feature.
+     */
+    public String getName();
+
+    /**
+     * Sets the name of this feature.
+     */
+    public void setName(String name);
+    
+    /**
+     * Returns the description of this feature.
+     */
+    public String getDescription();
+    
+    /**
+     * Sets the description of this feature.
+     */
+    public void setDescription(String description);
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/TargetObject.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/TargetObject.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/TargetObject.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/TargetObject.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,60 @@
+/*
+ * 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.ace.client.repository.object;
+
+import java.util.List;
+
+import org.apache.ace.client.repository.RepositoryObject;
+
+public interface TargetObject extends RepositoryObject {
+    public static final String KEY_ID = "id";
+    public static final String KEY_AUTO_APPROVE = "autoapprove";
+
+    public static final String TOPIC_ENTITY_ROOT = TargetObject.class.getSimpleName() + "/";
+
+    public static final String TOPIC_ADDED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ADDED_SUFFIX;
+    public static final String TOPIC_REMOVED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_REMOVED_SUFFIX;
+    public static final String TOPIC_CHANGED = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_CHANGED_SUFFIX;
+    public static final String TOPIC_ALL = PUBLIC_TOPIC_ROOT + TOPIC_ENTITY_ROOT + TOPIC_ALL_SUFFIX;
+
+    /**
+     * Returns all <code>DistributionObject</code>s this object is associated with. If there
+     * are none, an empty list will be returned.
+     */
+    public List<DistributionObject> getDistributions();
+    /**
+     * Returns all associations this target has with a given distribution.
+     */
+    public List<Distribution2TargetAssociation> getAssociationsWith(DistributionObject distribution);
+
+    /**
+     * Gets the ID of this TargetObject.
+     */
+    public String getID();
+
+    /**
+     * Enable or disable automatic approval.
+     */
+    public void setAutoApprove(boolean approve);
+
+    /**
+     * Get the auto approval value of this target.
+     */
+    public boolean getAutoApprove();
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/packageinfo
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/packageinfo?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/packageinfo (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/object/packageinfo Thu Jul  5 12:09:30 2012
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/packageinfo
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/packageinfo?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/packageinfo (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/packageinfo Thu Jul  5 12:09:30 2012
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Artifact2FeatureAssociationRepository.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Artifact2FeatureAssociationRepository.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Artifact2FeatureAssociationRepository.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Artifact2FeatureAssociationRepository.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,30 @@
+/*
+ * 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.ace.client.repository.repository;
+
+import org.apache.ace.client.repository.AssociationRepository;
+import org.apache.ace.client.repository.object.Artifact2FeatureAssociation;
+import org.apache.ace.client.repository.object.ArtifactObject;
+import org.apache.ace.client.repository.object.FeatureObject;
+
+/**
+ * Interface to a Artifact2FeatureAssociationRepository. The functionality is defined by the generic AssociationRepository.
+ */
+public interface Artifact2FeatureAssociationRepository extends AssociationRepository<ArtifactObject, FeatureObject, Artifact2FeatureAssociation> {
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/ArtifactRepository.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/ArtifactRepository.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/ArtifactRepository.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/ArtifactRepository.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,109 @@
+/*
+ * 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.ace.client.repository.repository;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.List;
+
+import org.apache.ace.client.repository.ObjectRepository;
+import org.apache.ace.client.repository.object.ArtifactObject;
+import org.apache.ace.client.repository.object.TargetObject;
+
+/**
+ * Interface to a ArtifactRepository. The functionality is defined by the generic AssociationRepository.
+ */
+public interface ArtifactRepository extends ObjectRepository<ArtifactObject> {
+	/**
+	 * Gets a list of all ArtifactObject's which are resource processing bundles.
+	 */
+	public List<ArtifactObject> getResourceProcessors();
+
+	/**
+	 * Tries to import an artifact into storage, while extracting necessary metadata.
+	 * @param artifact a URL pointing to the 'physical' artifact.
+	 * @param upload Indicates whether this artifact should be uploaded to our own OBR.
+	 * @return An <code>ArtifactObject</code> representing the passed in artifact, if
+	 * (a) the artifact is recognized, (b) there is storage available and (c) there is
+	 * a resource processor available for this type of artifact.
+	 * @throws IllegalArgumentException when the <code>artifact</code> cannot be processed.
+	 * @throws IOException when there is a problem transferring the <code>artifact</code> to storage.
+	 */
+	public ArtifactObject importArtifact(URL artifact, boolean upload) throws IllegalArgumentException, IOException;
+
+	/**
+	 * Checks whether an artifact is 'usable', that is, there is a resource processor available for it,
+	 * if necessary.
+	 * @param artifact A URL pointing to an artifact.
+	 * @return <code>true</code> if the artifact is recognized, and a processor for it is available. <code>false</code>
+	 * otherwise, including when the artifact cannot be reached.
+	 */
+	public boolean recognizeArtifact(URL artifact);
+
+    /**
+     * Tries to import an artifact into storage, while extracting necessary metadata.
+     * @param artifact a URL pointing to the 'physical' artifact.
+     * @param mimetype a String giving this object's mimetype.
+     * @param upload Indicates whether this artifact should be uploaded to our own OBR.
+     * @return An <code>ArtifactObject</code> representing the passed in artifact, if
+     * (a) there is storage available and (b) there is a resource processor
+     * available for this type of artifact.
+     * @throws IllegalArgumentException when the <code>artifact</code> cannot be processed.
+     * @throws IOException when there is a problem transferring the <code>artifact</code> to storage.
+     */
+	public ArtifactObject importArtifact(URL artifact, String mimetype, boolean upload) throws IllegalArgumentException, IOException;
+
+	/**
+	 * Tries to locate a preprocessor for the passed artifact, an processes it. If no processing
+	 * needs to be done, the original artifact's URL will be returned.
+	 * @param artifact An artifact
+	 * @param props A tree of properties objects, to be used for replacement.
+	 * @param targetID The targetID of the target for which this artifact is being processed.
+	 * @param version The deployment version for which this artifact is being processed.
+	 * @return A URL to a new, processed artifact, or to the original one, in case nothing needed to be processed.
+     * @throws IOException Thrown if reading the original artifact goes wrong, or storing the processed one.
+	 */
+	public String preprocessArtifact(ArtifactObject artifact, TargetObject target, String targetID, String version) throws IOException ;
+
+    /**
+     * Indicates whether the template should be processed again, given the properties, and the version to which it
+     * should be compared.
+     * @param url A string representing a URL to the original artifact.
+     * @param props A PropertyResolver which can be used to fill in 'holes' in the template.
+     * @param targetID The targetID of the target for which this artifact is being processed.
+     * @param version The deployment version for which this artifact is being processed.
+     * @param lastVersion The deployment version to which the current one should be compared.
+     * @param newVersion The new, potential version.
+     * @param obrBase A base OBR to upload the new artifact to.
+     * @return Whether or not a new version has to be created.
+     * @throws IOException
+     */
+    public boolean needsNewVersion(ArtifactObject artifact, TargetObject target, String targetID, String fromVersion);
+
+	/**
+	 * Sets the OBR that this artifact repository should use to upload artifacts to.
+	 */
+	public void setObrBase(URL obrBase);
+
+    /**
+     * Gets the OBR that this artifact repository should use to upload artifacts to.
+     * Note that this method may return <code>null</code> if no base was set earlier.
+     */
+    public URL getObrBase();
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/DeploymentVersionRepository.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/DeploymentVersionRepository.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/DeploymentVersionRepository.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/DeploymentVersionRepository.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,46 @@
+package org.apache.ace.client.repository.repository;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ace.client.repository.ObjectRepository;
+import org.apache.ace.client.repository.object.DeploymentArtifact;
+import org.apache.ace.client.repository.object.DeploymentVersionObject;
+
+
+/**
+ * Interface to a DeploymentVersionRepository. The functionality is defined by the generic ObjectRepository.
+ */
+public interface DeploymentVersionRepository extends ObjectRepository<DeploymentVersionObject> {
+    /**
+     * Creates a new inhabitant based on the given attributes and bundle URLs. The object
+     * will be stored in this repository's store, and will be returned.
+     * @throws IllegalArgumentException Will be thrown when the attributes cannot be accepted.
+     */
+    public DeploymentVersionObject create(Map<String, String> attributes, Map<String, String> tags, DeploymentArtifact[] artifacts);
+
+    /**
+     * Gets all available deployment versions for this target. If none can be
+     * found, an empty list will be returned.
+     * @param targetID The target to be used.
+     * @return A list of <code>DeploymentVersionObject</code>s which are related to
+     * this target, sorted lexically by version.
+     */
+    public List<DeploymentVersionObject> getDeploymentVersions(String targetID);
+
+    /**
+     * Get the most recent known deployment version for a given target.
+     * @param targetID The target to be used.
+     * @return A <code>DeploymentVersionObject</code> which is the most recent one to be deployed
+     * to the target. If none can be found, <code>null</code> will be returned.
+     */
+    public DeploymentVersionObject getMostRecentDeploymentVersion(String targetID);
+
+    /**
+     * Creates a DeploymentArtifact object.
+     * @param url The url to be used in this object.
+     * @param directives A map of directives to be packed into the object.
+     * @return The newly created deployment artifact object.
+     */
+    public DeploymentArtifact createDeploymentArtifact(String url, Map<String, String> directives);
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Distribution2TargetAssociationRepository.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Distribution2TargetAssociationRepository.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Distribution2TargetAssociationRepository.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Distribution2TargetAssociationRepository.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,38 @@
+/*
+ * 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.ace.client.repository.repository;
+
+import org.apache.ace.client.repository.AssociationRepository;
+import org.apache.ace.client.repository.object.TargetObject;
+import org.apache.ace.client.repository.object.Distribution2TargetAssociation;
+import org.apache.ace.client.repository.object.DistributionObject;
+
+/**
+ * Interface to a Distribution2TargetAssociationRepository. The functionality is defined by the generic AssociationRepository.
+ */
+public interface Distribution2TargetAssociationRepository extends AssociationRepository<DistributionObject, TargetObject, Distribution2TargetAssociation> {
+    /**
+     * Creates an assocation from a given distribution to multiple targets, which correspond to the given
+     * filter string. For parameters to use in the filter, see <code>TargetObject</code>'s <code>KEY_</code> constants.
+     * @param distribution A distribution object for the left side of this association.
+     * @param targetFilter An LDAP-filter for the targets to use.
+     * @return The newly created association.
+     */
+    public Distribution2TargetAssociation createDistribution2TargetFilter(DistributionObject distribution, String targetFilter);
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/DistributionRepository.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/DistributionRepository.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/DistributionRepository.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/DistributionRepository.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,28 @@
+/*
+ * 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.ace.client.repository.repository;
+
+import org.apache.ace.client.repository.ObjectRepository;
+import org.apache.ace.client.repository.object.DistributionObject;
+
+/**
+ * Interface to a DistributionRepository. The functionality is defined by the generic AssociationRepository.
+ */
+public interface DistributionRepository extends ObjectRepository<DistributionObject> {
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Feature2DistributionAssociationRepository.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Feature2DistributionAssociationRepository.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Feature2DistributionAssociationRepository.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/Feature2DistributionAssociationRepository.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,30 @@
+/*
+ * 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.ace.client.repository.repository;
+
+import org.apache.ace.client.repository.AssociationRepository;
+import org.apache.ace.client.repository.object.Feature2DistributionAssociation;
+import org.apache.ace.client.repository.object.FeatureObject;
+import org.apache.ace.client.repository.object.DistributionObject;
+
+/**
+ * Interface to a Feature2DistributionAssociationRepository. The functionality is defined by the generic AssociationRepository.
+ */
+public interface Feature2DistributionAssociationRepository extends AssociationRepository<FeatureObject, DistributionObject, Feature2DistributionAssociation> {
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/FeatureRepository.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/FeatureRepository.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/FeatureRepository.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/FeatureRepository.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,28 @@
+/*
+ * 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.ace.client.repository.repository;
+
+import org.apache.ace.client.repository.ObjectRepository;
+import org.apache.ace.client.repository.object.FeatureObject;
+
+/**
+ * Interface to a FeatureRepository. The functionality is defined by the generic AssociationRepository.
+ */
+public interface FeatureRepository extends ObjectRepository<FeatureObject> {
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/TargetRepository.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/TargetRepository.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/TargetRepository.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/TargetRepository.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,28 @@
+/*
+ * 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.ace.client.repository.repository;
+
+import org.apache.ace.client.repository.ObjectRepository;
+import org.apache.ace.client.repository.object.TargetObject;
+
+/**
+ * Interface to a GatewayRepository. The functionality is defined by the generic AssociationRepository.
+ */
+public interface TargetRepository extends ObjectRepository<TargetObject>{
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/packageinfo
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/packageinfo?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/packageinfo (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/repository/packageinfo Thu Jul  5 12:09:30 2012
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/StatefulTargetObject.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/StatefulTargetObject.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/StatefulTargetObject.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/StatefulTargetObject.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,207 @@
+/*
+ * 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.ace.client.repository.stateful;
+
+import java.util.List;
+
+import org.apache.ace.client.repository.RepositoryObject;
+import org.apache.ace.client.repository.object.ArtifactObject;
+import org.apache.ace.client.repository.object.DeploymentArtifact;
+import org.apache.ace.client.repository.object.TargetObject;
+import org.apache.ace.client.repository.object.Distribution2TargetAssociation;
+import org.apache.ace.client.repository.object.DistributionObject;
+import org.apache.ace.log.LogEvent;
+
+/**
+ * Represents the information that a <code>TargetObject</code>
+ * has, plus added functionality for gathering information from a deployment repository and,
+ * optionally, from an AuditLog.
+ */
+public interface StatefulTargetObject extends RepositoryObject {
+
+    public static final String TOPIC_ADDED = StatefulTargetObject.class.getName().replace('.', '/') + "/ADDED";
+    public static final String TOPIC_REMOVED = StatefulTargetObject.class.getName().replace('.', '/') + "/REMOVED";
+    public static final String TOPIC_CHANGED = StatefulTargetObject.class.getName().replace('.', '/') + "/CHANGED";
+    public static final String TOPIC_STATUS_CHANGED = StatefulTargetObject.class.getName().replace('.', '/') + "/STATUS_CHANGED";
+    /** Indicates a change to the audit events for the StatefulTargetObject in "entity".*/
+    public static final String TOPIC_AUDITEVENTS_CHANGED = StatefulTargetObject.class.getName().replace('.', '/') + "/AUDITEVENTS_CHANGED";
+    /** Key used in the event with topic <code>TOPIC_AUDITEVENTS_CHANGED</code>. Contains a List<LogDescriptor> containing all
+     *  events we have not seen yet. NOTE: The first auditevent "change" causing the <code>StatefulTargetObject</code> to
+     *  be instantiated will trigger a <code>TOPIC_AUDITEVENTS_CHANGED</code> event *before* a <code>TOPIC_ADDED</code> event. */
+    public static final String KEY_AUDITEVENTS = "auditevents";
+    public static final String TOPIC_ALL = StatefulTargetObject.class.getName().replace('.', '/') + "/*";
+
+    public final static String KEY_ID = TargetObject.KEY_ID;
+    public final static String KEY_REGISTRATION_STATE = "KEY_REGISTRATION_STATE";
+    public final static String KEY_STORE_STATE = "KEY_STORE_STATE";
+    public final static String KEY_PROVISIONING_STATE = "KEY_PROVISIONING_STATE";
+    public final static String KEY_LAST_INSTALL_VERSION = "KEY_LAST_INSTALL_VERSION";
+    public final static String KEY_LAST_INSTALL_SUCCESS = "KEY_LAST_INSTALL_SUCCESS";
+    public final static String KEY_ACKNOWLEDGED_INSTALL_VERSION = "KEY_ACKNOWLEDGED_INSTALL_VERSION";
+    public final static String[] KEYS_ALL = new String[] {KEY_ID, KEY_REGISTRATION_STATE, KEY_STORE_STATE, KEY_PROVISIONING_STATE, KEY_LAST_INSTALL_VERSION, KEY_LAST_INSTALL_SUCCESS, KEY_ACKNOWLEDGED_INSTALL_VERSION};
+
+    /**
+     * Represents a current deployment package version which cannot be found, i.e.,
+     * either there is no information about deployment packages in the AuditLog,
+     * or no AuditLog is available.
+     */
+    public final static String UNKNOWN_VERSION = "(unknown)";
+
+    /**
+     * Gets the current registration status of the target.
+     */
+    public RegistrationState getRegistrationState();
+
+    /**
+     * Gets the current store status of the target.
+     */
+    public StoreState getStoreState();
+
+    /**
+     * Gets the current provisioning status of the target.
+     */
+    public ProvisioningState getProvisioningState();
+
+    /**
+     * Gets the most recent deployment package version on the target, according
+     * to the deployment repository. If no version can be determined,
+     * <code>UNKNOWN_VERSION</code> will be returned.
+     */
+    public String getCurrentVersion();
+
+    /**
+     * Gets the list of AuditLog Events for this target. If no auditlog events
+     * can be found, and empty list will be returned. The events are ordered ascending by timestamp.
+     */
+    public List<LogEvent> getAuditEvents();
+
+    /**
+     * Registers this target, which for now only exists in the AuditLog, into the
+     * <code>TargetRepository</code>.
+     * @throws IllegalStateException when the precondition is not met, i.e., the
+     * target is not known only in the AuditLog, but also in the <code>TargetRepository</code>.
+     */
+    public void register() throws IllegalStateException;
+
+    /**
+     * Indicates whether this <code>StatefulTargetObject</code> is backed by a <code>TargetObject</code>.
+     * @return whether this <code>StatefulTargetObject</code> is backed by a <code>TargetObject</code>.
+     */
+    public boolean isRegistered();
+
+    /**
+     * Approves all differences between what is currently in the shop and target operator
+     * repository, and the deployment repository. This will generate a new version in the
+     * deployment repository.
+     * @return The number of the new version.
+     * @throws IllegalStateException when it is currently not possible to create a deployment version.
+     */
+    public String approve();
+
+    /**
+     * Indicates whether an <code>approve()</code> is necessary, i.e., there is a difference between
+     * the set of artifacts for this target according to the shop, and according to the deployment
+     * repository.
+     * @return <code>true</code> if there is a difference between the shop and deployment repository;
+     * <code>false</code> otherwise.
+     */
+    public boolean needsApprove();
+
+    /**
+     * Returns the auto-approval flag for this target.
+     * @return <code>true</code> if auto approve has been set;
+     * <code>false</code> otherwise.
+     */
+    public boolean getAutoApprove();
+
+    /**
+     * Set the auto approve value for this target, the property is stored within the target
+     * @param approve <code>true</code> to enable auto approve;
+     * <code>false</code> otherwise.
+     */
+    public void setAutoApprove(boolean approve);
+
+    /**
+     * Gets the list of artifact objects that should be on the target, according to the shop.
+     * @return the list of artifact objects that should be on the target, according to the shop.
+     */
+    public ArtifactObject[] getArtifactsFromShop();
+
+    /**
+     * Gets the list of deployment artifacts that should be on the target, according to the deployment repository.
+     * @return the list of artifact objects that should be on the target, according to the deployment repository.
+     */
+    public DeploymentArtifact[] getArtifactsFromDeployment();
+
+    /**
+     * Returns the latest available installed version in the auditlog.
+     * @return The latest version statement from the auditlog for an install if
+     * one is available; otherwise, an empty string.
+     */
+    public String getLastInstallVersion();
+
+    /**
+     * Returns whether the last install on the target was successful.
+     * @return <code>true</code> if there information about a last install and
+     * that was successful, <code>false</code> otherwise.
+     */
+    public boolean getLastInstallSuccess();
+
+    /**
+     * Signals to the object that the outcome of a given install on the target
+     * is 'seen', and that the <code>ProvisioningState</code> can now return to <code>Idle</code>.
+     * @param version A string representing a version.
+     */
+    public void acknowledgeInstallVersion(String version);
+
+    /**
+     * Gets the underlying <code>TargetObject</code> of this <code>StatefulTargetObject</code>.
+     * @return The <code>TargetObject</code> linked to this <code>StatefulTargetObject</code>; if none
+     * is available, an <code>IllegalStateException</code> will be thrown.
+     */
+    public TargetObject getTargetObject();
+
+    /**
+     * Returns all <code>DistributionObject</code>s this object is associated with. If there
+     * are none, an empty list will be returned.
+     */
+    public List<DistributionObject> getDistributions();
+
+    /**
+     * Returns all associations this target has with a given distribution.
+     */
+    public List<Distribution2TargetAssociation> getAssociationsWith(DistributionObject distribution);
+
+    /**
+     * Gets the ID of this TargetObject.
+     */
+    public String getID();
+
+    public enum RegistrationState {
+        Unregistered, Registered;
+    }
+
+    public enum StoreState {
+        New, Unapproved, Approved;
+    }
+
+    public enum ProvisioningState {
+        Idle, InProgress, OK, Failed;
+    }
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/StatefulTargetRepository.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/StatefulTargetRepository.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/StatefulTargetRepository.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/StatefulTargetRepository.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,55 @@
+/*
+ * 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.ace.client.repository.stateful;
+
+import java.util.Map;
+
+import org.apache.ace.client.repository.ObjectRepository;
+
+/**
+ * Represents a repository of <ode>StatefulTargetObject</code>'s.
+ */
+public interface StatefulTargetRepository extends ObjectRepository<StatefulTargetObject> {
+
+    /**
+     * Registers a target with given attributes. This will result in the creation
+     * of a <code>TargetObject</code> in the <code>TargetRepository</code>, and
+     * the creation of a <code>StatefulTargetObject</code>, which will also be
+     * returned.
+     * @param attributes The attributes to create the <code>TargetObject</code> with.
+     * @return The newly registered target object.
+     */
+    public StatefulTargetObject preregister(Map<String, String> attributes, Map<String, String> tags);
+
+    /**
+     * Unregisters a target, removing it from the <code>TargetRepository</code>. Note
+     * that a <code>StatefulTargetObject</code> might stay around if it is backed
+     * by audit log entries. If the given ID is not that of an existing <code>TargetObject</code>,
+     * an <code>IllegalArgumentException</code> will be thrown.
+     * @param targetID A string representing a target ID.
+     */
+    public void unregister(String targetID);
+
+    /**
+     * Explicitly instruct the <code>StatefulTargetRepository</code> to update
+     * its contents; for instance, after syncing the audit log.
+     */
+    public void refresh();
+
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/packageinfo
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/packageinfo?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/packageinfo (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.api/src/org/apache/ace/client/repository/stateful/packageinfo Thu Jul  5 12:09:30 2012
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file



Mime
View raw message