sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1637392 [1/3] - in /sling/trunk/contrib: ./ extensions/distribution/api/ extensions/distribution/api/src/ extensions/distribution/api/src/main/ extensions/distribution/api/src/main/java/ extensions/distribution/api/src/main/java/org/ exten...
Date Fri, 07 Nov 2014 15:52:55 GMT
Author: tommaso
Date: Fri Nov  7 15:52:52 2014
New Revision: 1637392

URL: http://svn.apache.org/r1637392
Log:
SLING-4144 - split distribution api and core bundles

Added:
    sling/trunk/contrib/extensions/distribution/api/   (with props)
    sling/trunk/contrib/extensions/distribution/api/pom.xml   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/
    sling/trunk/contrib/extensions/distribution/api/src/main/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/agent/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java
      - copied unchanged from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/agent/DistributionAgentException.java
      - copied unchanged from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgentException.java
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationException.java
      - copied unchanged from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationException.java
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationStrategy.java
      - copied unchanged from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationStrategy.java
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/agent/package-info.java
      - copied unchanged from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/package-info.java
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionActionType.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionParameter.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionResponse.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/package-info.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/DistributionComponent.java
      - copied unchanged from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponent.java
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/DistributionComponentFactory.java
      - copied, changed from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponentFactory.java
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/DistributionComponentProvider.java
      - copied, changed from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponentProvider.java
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/ManagedDistributionComponent.java
      - copied unchanged from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/ManagedDistributionComponent.java
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/package-info.java
      - copied unchanged from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/package-info.java
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEvent.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/package-info.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExportException.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImportException.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/package-info.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueDistributionStrategy.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueException.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemSelector.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemState.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProcessor.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProvider.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/package-info.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/transport/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/transport/authentication/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationContext.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationException.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationProvider.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/transport/authentication/package-info.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/trigger/
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/trigger/DistributionRequestHandler.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/trigger/DistributionTrigger.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/trigger/DistributionTriggerException.java   (with props)
    sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/trigger/package-info.java   (with props)
Removed:
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgentException.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationException.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationStrategy.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/package-info.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/communication/
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponent.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponentFactory.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponentProvider.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/ManagedDistributionComponent.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/package-info.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/DistributionEvent.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/package-info.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExportException.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImportException.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/package-info.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueDistributionStrategy.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueException.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemSelector.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemState.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProcessor.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueProvider.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/package-info.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationContext.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationException.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationProvider.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/package-info.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionRequestHandler.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionTrigger.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/DistributionTriggerException.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/package-info.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/package-info.java
Modified:
    sling/trunk/contrib/extensions/distribution/core/pom.xml
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/CoordinatingDistributionAgentFactory.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentFactory.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/GenericDistributionComponentFactory.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheck.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporterFactory.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporter.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterFactory.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporter.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterFactory.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/AdvancedRemoteDistributionPackageImporter.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporter.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterFactory.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterFactory.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RepositoryDistributionPackageImporter.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/SingleQueueDistributionStrategy.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumer.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueue.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProvider.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingUtils.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProvider.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackage.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackageBuilder.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionPackageImporterServlet.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/RepositoryTransportAuthenticationProvider.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/authentication/impl/UserCredentialsTransportAuthenticationProvider.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/SimpleHttpDistributionTransportHandler.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/AbstractJcrEventTrigger.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTrigger.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/PersistingJcrEventDistributionTrigger.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/RemoteEventDistributionTrigger.java
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/RequestUtils.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentFactoryTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/SettingsUtilsTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheckTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/ErrorAwareQueueDistributionStrategyTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/PriorityPathQueueDistributionStrategyTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/SingleQueueDistributionStrategyTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/DistributionAgentJobConsumerTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProviderTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/transport/authentication/impl/RepositoryTransportAuthenticationProviderTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTriggerTest.java
    sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/trigger/impl/PersistingJcrEventDistributionTriggerTest.java
    sling/trunk/contrib/extensions/distribution/it/pom.xml
    sling/trunk/contrib/extensions/distribution/sample/pom.xml
    sling/trunk/contrib/pom.xml

Propchange: sling/trunk/contrib/extensions/distribution/api/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov  7 15:52:52 2014
@@ -0,0 +1 @@
+*.iml

Added: sling/trunk/contrib/extensions/distribution/api/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/pom.xml?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/pom.xml (added)
+++ sling/trunk/contrib/extensions/distribution/api/pom.xml Fri Nov  7 15:52:52 2014
@@ -0,0 +1,129 @@
+<?xml version="1.0"?>
+<!--
+    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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <!-- ======================================================================= -->
+    <!-- P A R E N T   P R O J E C T                                             -->
+    <!-- ======================================================================= -->
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>22</version>
+    </parent>
+
+    <!-- ======================================================================= -->
+    <!-- P R O J E C T                                                           -->
+    <!-- ======================================================================= -->
+    <artifactId>org.apache.sling.distribution.api</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>Apache Sling Distribution API</name>
+    <description>
+        The Apache Sling Distribution API bundle provides the APIs for the Sling Content Distribution module
+    </description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api
+        </developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api</url>
+    </scm>
+
+    <!-- ======================================================================= -->
+    <!-- B U I L D                                                               -->
+    <!-- ======================================================================= -->
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>maven-sling-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>org.apache.sling.distribution.api</Bundle-SymbolicName>
+                        <Export-Package>
+                            org.apache.sling.distribution.component,
+                            org.apache.sling.distribution.agent,
+                            org.apache.sling.distribution.communication,
+                            org.apache.sling.distribution.event,
+                            org.apache.sling.distribution.queue,
+                            org.apache.sling.distribution.trigger,
+                            org.apache.sling.distribution.packaging,
+                            org.apache.sling.distribution.transport.authentication
+                        </Export-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+    <!-- ======================================================================= -->
+    <!-- D E P E N D E N C I E S                                                 -->
+    <!-- ======================================================================= -->
+    <dependencies>
+        <!-- SLING -->
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.api</artifactId>
+            <version>2.5.0</version>
+        </dependency>
+
+        <!-- SPECs -->
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+            <version>2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.findbugs</groupId>
+            <artifactId>jsr305</artifactId>
+            <version>2.0.0</version>
+            <scope>provided</scope>
+        </dependency>
+
+    </dependencies>
+
+</project>

Propchange: sling/trunk/contrib/extensions/distribution/api/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionActionType.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionActionType.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionActionType.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionActionType.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,83 @@
+/*
+ * 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.sling.distribution.communication;
+
+/**
+ * The type of a specific distribution action, used to decide what to do with specific distribution
+ * items / requests.
+ */
+public enum DistributionActionType {
+
+    /**
+     * Content is added
+     */
+    ADD("Add"),
+
+    /**
+     * Content is deleted
+     */
+    DELETE("Delete"),
+
+    /**
+     * Content is polled
+     */
+    POLL("Poll");
+
+    /**
+     * internal human readable name
+     */
+    private final String name;
+
+    /**
+     * Create a type
+     *
+     * @param name name
+     */
+    private DistributionActionType(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Returns the human readable type name of this type.
+     *
+     * @return the name
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Creates an action type for the given name. if the name cannot be mapped to a enum type or if
+     * it's <code>null</code>, <code>null</code> is returned.
+     *
+     * @param n the name
+     * @return the type or <code>null</code>
+     */
+    public static DistributionActionType fromName(String n) {
+        if (n == null) {
+            return null;
+        }
+        try {
+            return DistributionActionType.valueOf(n.toUpperCase());
+        } catch (IllegalArgumentException e) {
+            return null;
+        }
+    }
+
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionActionType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionParameter.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionParameter.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionParameter.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionParameter.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,41 @@
+/*
+ * 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.sling.distribution.communication;
+
+/**
+ * HTTP Parameters for distribution
+ */
+public enum DistributionParameter {
+
+    QUEUE("queue"),
+    TYPE("type"),
+    ACTION("action"),
+    PATH("path");
+
+    private final String name;
+
+    DistributionParameter(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionParameter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,80 @@
+/*
+ * 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.sling.distribution.communication;
+
+import javax.annotation.Nonnull;
+import java.util.Arrays;
+
+/**
+ * A distribution request
+ */
+public class DistributionRequest {
+
+    private final long time;
+
+    private final DistributionActionType action;
+
+    private final String[] paths;
+
+    public DistributionRequest(@Nonnull DistributionActionType action, @Nonnull String[] paths) {
+        this(System.currentTimeMillis(), action, paths);
+    }
+
+    public DistributionRequest(long time, @Nonnull DistributionActionType action, @Nonnull String... paths) {
+        this.time = time;
+        this.action = action;
+        this.paths = paths;
+    }
+
+    /**
+     * get the time this distribution request was created
+     *
+     * @return a <code>long</code> representing the distribution request creation time e.g. as returend by {@code System#currentTimeMillis}
+     */
+    public long getTime() {
+        return time;
+    }
+
+    /**
+     * get the {@link DistributionActionType} associated with this request
+     *
+     * @return the action as a <code>distributionActionType</code>
+     */
+    public DistributionActionType getAction() {
+        return action;
+    }
+
+    /**
+     * get the paths for this distribution request
+     *
+     * @return an array of <code>String</code>s representing the paths
+     */
+    public String[] getPaths() {
+        return paths;
+    }
+
+    @Override
+    public String toString() {
+        return "DistributionRequest{" +
+                "time=" + time +
+                ", action=" + action +
+                ", paths=" + Arrays.toString(paths) +
+                '}';
+    }
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionResponse.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionResponse.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionResponse.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionResponse.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,47 @@
+/*
+ * 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.sling.distribution.communication;
+
+/**
+ * A distribution response
+ */
+public class DistributionResponse {
+
+    private final String status;
+    private boolean successful;
+
+    public DistributionResponse(String status, boolean successful) {
+        this.status = status;
+        this.successful = successful;
+    }
+
+    public boolean isSuccessful() {
+        return successful;
+    }
+
+    @Override
+    public String toString() {
+        return "{\"success\":" + isSuccessful() + ", \"status\":\"" + getStatus() + "\"}";
+    }
+
+    public String getStatus() {
+        return status != null ? status : "done nothing";
+    }
+
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/DistributionResponse.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/package-info.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/package-info.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/package-info.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+@Version("0.1.0")
+package org.apache.sling.distribution.communication;
+
+import aQute.bnd.annotation.Version;
+

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/communication/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/DistributionComponentFactory.java (from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponentFactory.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/DistributionComponentFactory.java?p2=sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/DistributionComponentFactory.java&p1=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponentFactory.java&r1=1637333&r2=1637392&rev=1637392&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponentFactory.java (original)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/DistributionComponentFactory.java Fri Nov  7 15:52:52 2014
@@ -18,13 +18,13 @@
  */
 package org.apache.sling.distribution.component;
 
-import aQute.bnd.annotation.ProviderType;
-
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import java.util.Map;
 
+import aQute.bnd.annotation.ProviderType;
+
 /**
  * factory for {@link DistributionComponent}s
  */

Copied: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/DistributionComponentProvider.java (from r1637333, sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponentProvider.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/DistributionComponentProvider.java?p2=sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/DistributionComponentProvider.java&p1=sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponentProvider.java&r1=1637333&r2=1637392&rev=1637392&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/DistributionComponentProvider.java (original)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/component/DistributionComponentProvider.java Fri Nov  7 15:52:52 2014
@@ -18,12 +18,12 @@
  */
 package org.apache.sling.distribution.component;
 
-import aQute.bnd.annotation.ConsumerType;
-
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
+import aQute.bnd.annotation.ConsumerType;
+
 /**
  * provider for already existing {@link DistributionComponent}s
  */

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEvent.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEvent.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEvent.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEvent.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,45 @@
+/*
+ * 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.sling.distribution.event;
+
+import java.util.Dictionary;
+
+import org.osgi.service.event.Event;
+
+/**
+ * A distribution related event
+ */
+public class DistributionEvent extends Event {
+
+    public static final String EVENT_TOPIC = "org/apache/sling/distribution/event";
+
+    public DistributionEvent(DistributionEventType type, Dictionary<?, ?> properties) {
+        super(getTopic(type), properties);
+    }
+
+    /**
+     * get the topic for a certain event type
+     *
+     * @param type the {@link DistributionEventType} to get the topic for
+     * @return the topic for the given event type
+     */
+    public static String getTopic(DistributionEventType type) {
+        return EVENT_TOPIC + '/' + type.name();
+    }
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,66 @@
+/*
+ * 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.sling.distribution.event;
+
+/**
+ * an enum of the possible types of events related to distribution
+ */
+public enum DistributionEventType {
+
+    /**
+     * event for package created
+     */
+    PACKAGE_CREATED,
+
+    /**
+     * event for package queued
+     */
+    PACKAGE_QUEUED,
+
+    /**
+     * event for package replicated
+     */
+    PACKAGE_DISTRIBUTED,
+
+    /**
+     * event for package installed
+     */
+    PACKAGE_INSTALLED,
+
+    /**
+     * event for package imported
+     */
+    PACKAGE_IMPORTED,
+
+    /**
+     * event for agent created
+     */
+    AGENT_CREATED,
+
+    /**
+     * event for agent modified
+     */
+    AGENT_MODIFIED,
+
+    /**
+     * event for agent deleted
+     */
+    AGENT_DELETED
+
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/DistributionEventType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/package-info.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/package-info.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/package-info.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+@Version("0.1.0")
+package org.apache.sling.distribution.event;
+
+import aQute.bnd.annotation.Version;
+

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/event/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,101 @@
+/*
+ * 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.sling.distribution.packaging;
+
+import javax.annotation.Nonnull;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+
+import aQute.bnd.annotation.ConsumerType;
+
+/**
+ * A distribution package
+ */
+@ConsumerType
+public interface DistributionPackage extends Serializable {
+
+    /**
+     * get package id. the id is a unique string that can be used to retrieve
+     * the package from an {@link DistributionPackageExporter}
+     *
+     * @return the package id
+     */
+    @Nonnull
+    String getId();
+
+    /**
+     * get the paths covered by this package
+     *
+     * @return an array of paths
+     */
+    @Nonnull
+    String[] getPaths();
+
+    /**
+     * get the action this package is used for
+     *
+     * @return the action
+     */
+    @Nonnull
+    String getAction();
+
+    /**
+     * get the type of package
+     *
+     * @return the package type
+     */
+    @Nonnull
+    String getType();
+
+    /**
+     * creates a package stream.
+     * a new stream is created for each call and it is the caller's obligation to close the stream.
+     *
+     * @return an {@link InputStream}
+     * @throws IOException
+     */
+    @Nonnull
+    InputStream createInputStream() throws IOException;
+
+    /**
+     * get package stream length
+     *
+     * @return the package length
+     */
+    long getLength();
+
+    /**
+     * releases all resources associated with this package
+     */
+    void delete();
+
+
+    /**
+     * gets an additional info holder for this package.
+     * The additional info object contains control information rather than content information.
+     * For example info.origin can be used to skip distributing back to the originating endpoint.
+     * It should not be be serialized between instances as its main purpose is to allow
+     * inter component communication on the same instance.
+     * @return the associated metadata to this package
+     */
+    @Nonnull
+    DistributionPackageInfo getInfo();
+
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExportException.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExportException.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExportException.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExportException.java Fri Nov  7 15:52:52 2014
@@ -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.sling.distribution.packaging;
+
+/**
+ * This represents an error happening while exporting a {@link DistributionPackage}
+ */
+@SuppressWarnings("serial")
+public class DistributionPackageExportException extends Exception {
+
+    public DistributionPackageExportException(String message) {
+        super(message);
+    }
+
+    public DistributionPackageExportException(Throwable t) {
+        super(t);
+    }
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExportException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,59 @@
+/*
+ * 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.sling.distribution.packaging;
+
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+import java.util.List;
+
+import aQute.bnd.annotation.ConsumerType;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.component.DistributionComponent;
+
+/**
+ * A {@link DistributionPackageExporter ) is responsible of exporting
+ * {@link DistributionPackage }s to be then imported by a {@link org.apache.sling.distribution.agent.DistributionAgent }
+ * (via a {@link DistributionPackageImporter }).
+ */
+@ConsumerType
+public interface DistributionPackageExporter extends DistributionComponent {
+
+    /**
+     * Exports the {@link DistributionPackage}s built from the
+     * passed {@link org.apache.sling.distribution.communication.DistributionRequest}.
+     *
+     * @param resourceResolver   - the resource resolver used to export the packages
+     * @param distributionRequest - the request containing the information about which content is to be exported
+     * @return a <code>List</code> of {@link DistributionPackage}s
+     */
+    @Nonnull
+    List<DistributionPackage> exportPackages(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionRequest distributionRequest) throws DistributionPackageExportException;
+
+    /**
+     * Retrieves a {@link DistributionPackage} given its 'id', if it already exists.
+     *
+     * @param resourceResolver     - the resource resolver use to obtain the package.
+     * @param distributionPackageId - the id of the package to be retrieved
+     * @return a {@link DistributionPackage} if available, <code>null</code> otherwise
+     */
+    @CheckForNull
+    DistributionPackage getPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull String distributionPackageId);
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImportException.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImportException.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImportException.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImportException.java Fri Nov  7 15:52:52 2014
@@ -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.sling.distribution.packaging;
+
+/**
+ * This represents an error happening while importing a {@link DistributionPackage}
+ */
+@SuppressWarnings("serial")
+public class DistributionPackageImportException extends Exception {
+
+    public DistributionPackageImportException(String message) {
+        super(message);
+    }
+
+    public DistributionPackageImportException(Throwable t) {
+        super(t);
+    }
+
+    public DistributionPackageImportException(String message, Exception e) {
+        super(message, e);
+    }
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImportException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,57 @@
+/*
+ * 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.sling.distribution.packaging;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+import java.io.InputStream;
+
+import aQute.bnd.annotation.ConsumerType;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.distribution.component.DistributionComponent;
+
+/**
+ * A {@link DistributionPackageImporter} is responsible for importing
+ * {@link DistributionPackage}s into the resource tree.
+ */
+@ConsumerType
+public interface DistributionPackageImporter extends DistributionComponent {
+
+    /**
+     * Imports the given distribution package into the underlying system
+     *
+     * @param resourceResolver   - the resource resolver used to import the resources
+     * @param distributionPackage - the package to be imported
+     * @return <code>true</code> if the import succeeded, <code>false</code> otherwise
+     * @throws DistributionPackageImportException if any error occurs during import
+     */
+    boolean importPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage distributionPackage) throws DistributionPackageImportException;
+
+    /**
+     * Tries to convert an {@link java.io.InputStream} to a {@link DistributionPackage} and then imports it into the underlying system
+     *
+     * @param resourceResolver - the resource resolver used to read the package
+     * @param stream           the {@link InputStream} of the package to be converted and installed
+     * @return a {@link DistributionPackage} if the stream has been successfully converted and installed
+     * @throws DistributionPackageImportException when the stream cannot be read as a {@link DistributionPackage} and installed
+     */
+    @CheckForNull
+    DistributionPackage importStream(@Nonnull ResourceResolver resourceResolver, @Nonnull InputStream stream) throws DistributionPackageImportException;
+
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java Fri Nov  7 15:52:52 2014
@@ -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.sling.distribution.packaging;
+
+
+/**
+ * Additional information about a package.
+ * Additional information is optional and components should expect every piece of it to be null.
+ */
+public class DistributionPackageInfo {
+
+    private String origin;
+
+    /**
+     * retrieves the origin of the package.
+     * @return the package origin
+     */
+    public String getOrigin() {
+        return origin;
+    }
+
+    /**
+     * sets the origin of the package.
+     * @param origin the originating instance of this package
+     */
+    public void setOrigin(String origin) {
+        this.origin = origin;
+    }
+
+    /**
+     * fills the current info object from the provided one.
+     * @param packageInfo package metadata
+     */
+    public void fillInfo(DistributionPackageInfo packageInfo) {
+        if (packageInfo != null) {
+            this.setOrigin(packageInfo.getOrigin());
+        }
+    }
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,43 @@
+/*
+ * 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.sling.distribution.packaging;
+
+import javax.annotation.Nonnull;
+
+import aQute.bnd.annotation.ConsumerType;
+
+/**
+ * A {@link DistributionPackage} that offers basic reference counting
+ */
+@ConsumerType
+public interface SharedDistributionPackage extends DistributionPackage {
+
+
+    /**
+     * acquire a reference to this package and increase the reference count.
+     */
+    void acquire(@Nonnull String holderName);
+
+    /**
+     * release a reference to this package and decrease the reference count.
+     * when no more references are hold the package <code>delete</code> method is called.
+     */
+    void release(@Nonnull String holderName);
+
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/package-info.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/package-info.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/package-info.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+@Version("0.1.0")
+package org.apache.sling.distribution.packaging;
+
+import aQute.bnd.annotation.Version;
+

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/packaging/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java Fri Nov  7 15:52:52 2014
@@ -0,0 +1,92 @@
+/*
+ * 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.sling.distribution.queue;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import aQute.bnd.annotation.ConsumerType;
+
+/**
+ * a queue for handling {@link org.apache.sling.distribution.agent.DistributionAgent}s' requests
+ */
+@ConsumerType
+public interface DistributionQueue {
+
+    /**
+     * get this queue name
+     *
+     * @return queue name as a <code>String</code>
+     */
+    @Nonnull
+    String getName();
+
+    /**
+     * add a distribution item to this queue
+     *
+     * @param item a distribution item representing the package to distribute
+     * @return <code>true</code> if the distribution item was added correctly to the queue,
+     * <code>false</code otherwise
+     */
+    boolean add(@Nonnull DistributionQueueItem item);
+
+    /**
+     * get the status of a certain item in the queue
+     *
+     * @param item the distribution item to get the status for
+     * @return the item status in the queue
+     * @throws DistributionQueueException if any error occurs while getting the status
+     */
+    @Nonnull
+    DistributionQueueItemState getStatus(@Nonnull DistributionQueueItem item)
+            throws DistributionQueueException;
+
+    /**
+     * get the first item (FIFO wise, the next to be processed) into the queue
+     *
+     * @return the first item into the queue or <code>null</code> if the queue is empty
+     */
+    @CheckForNull
+    DistributionQueueItem getHead();
+
+    /**
+     * check if the queue is empty
+     *
+     * @return <code>true</code> if the queue is empty, <code>false</code> otherwise
+     */
+    boolean isEmpty();
+
+    /**
+     * get the items in the queue
+     *
+     * @param queueItemSelector represents the criteria to filter queue items.
+     *                          if null is passed then all items are returned.
+     * @return a <code>Iterable</code> of {@link DistributionQueueItem}s
+     */
+    @Nonnull
+    Iterable<DistributionQueueItem> getItems(@Nullable DistributionQueueItemSelector queueItemSelector);
+
+    /**
+     * remove an item from the queue by specifying its id
+     *
+     * @param id <code>String</code> representing an item's identifier
+     */
+    void remove(@Nonnull String id);
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueue.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueDistributionStrategy.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueDistributionStrategy.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueDistributionStrategy.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueDistributionStrategy.java Fri Nov  7 15:52:52 2014
@@ -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.sling.distribution.queue;
+
+import javax.annotation.Nonnull;
+import java.util.List;
+
+import aQute.bnd.annotation.ConsumerType;
+import org.apache.sling.distribution.component.DistributionComponent;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+
+/**
+ * a {@link DistributionQueueDistributionStrategy} implements an algorithm for the distribution of
+ * {@link org.apache.sling.distribution.packaging.DistributionPackage}s among the available queues
+ */
+@ConsumerType
+public interface DistributionQueueDistributionStrategy extends DistributionComponent {
+    String DEFAULT_QUEUE_NAME = "default";
+
+    /**
+     * synchronously distribute a {@link org.apache.sling.distribution.packaging.DistributionPackage}
+     * to one or more {@link DistributionQueue}s provided by the given {@link DistributionQueueProvider}
+     *
+     * @param distributionPackage          a {@link org.apache.sling.distribution.packaging.DistributionPackage} to distribute
+     * @param queueProvider the {@link DistributionQueueProvider} used to provide the queues to be used for the given package
+     * @return <code>true</code> if addition was successful, <code>false</code> otherwise
+     * @throws DistributionQueueException if any internal error happens during distribution
+     */
+    boolean add(@Nonnull DistributionPackage distributionPackage, @Nonnull DistributionQueueProvider queueProvider) throws DistributionQueueException;
+
+
+    /**
+     * Returns the queue names available for this strategy.
+     * @return a list of queue names
+     */
+    @Nonnull
+    List<String> getQueueNames();
+
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueDistributionStrategy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueException.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueException.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueException.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueException.java Fri Nov  7 15:52:52 2014
@@ -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.sling.distribution.queue;
+
+/**
+ * Represents errors happening during queue operations
+ */
+@SuppressWarnings("serial")
+public class DistributionQueueException extends Exception {
+
+    public DistributionQueueException(String message, Exception e) {
+        super(message, e);
+    }
+
+    public DistributionQueueException(String string) {
+        super(string);
+    }
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java?rev=1637392&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java (added)
+++ sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java Fri Nov  7 15:52:52 2014
@@ -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.sling.distribution.queue;
+
+import org.apache.sling.distribution.packaging.DistributionPackageInfo;
+
+/**
+ * An item in a {@link DistributionQueue}
+ * <p/>
+ * This is basically a proxy to {@link org.apache.sling.distribution.packaging.DistributionPackage} designed to avoid having
+ * to keep the package {@link org.apache.sling.distribution.packaging.DistributionPackage#createInputStream() stream} into
+ * the queues.
+ */
+public class DistributionQueueItem {
+
+    private final String id;
+
+    private final String[] paths;
+
+    private final String action;
+
+    private final String type;
+
+    private final DistributionPackageInfo packageInfo;
+
+    public DistributionQueueItem(String id, String[] paths, String action, String type, DistributionPackageInfo packageInfo) {
+        this.id = id;
+        this.paths = paths;
+        this.action = action;
+        this.type = type;
+        this.packageInfo = packageInfo;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public String[] getPaths() {
+        return paths;
+    }
+
+    public String getAction() {
+        return action;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public DistributionPackageInfo getPackageInfo() {
+        return packageInfo;
+    }
+}

Propchange: sling/trunk/contrib/extensions/distribution/api/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message