Author: tommaso
Date: Mon Sep 29 08:41:26 2014
New Revision: 1628136
URL: http://svn.apache.org/r1628136
Log:
SLING-3976 - exported TransportAuthenticationProvider and
ReplicationComponentProvider
Added:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationComponentProvider.java
(with props)
Removed:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/ReplicationComponentProvider.java
Modified:
sling/trunk/contrib/extensions/replication/core/pom.xml
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CompactSimpleReplicationAgentFactory.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/DefaultReplicationComponentFactory.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/DefaultReplicationComponentProvider.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/ReplicationComponentListener.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SettingsUtils.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationActionType.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/event/ReplicationEventFactory.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/ReplicationPackage.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/AbstractReplicationQueueProvider.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/SingleQueueDistributionStrategy.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessor.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueProvider.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/ReplicationConstants.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiConfigurationResourceProvider.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiPropertiesResourceProviderFactory.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/AbstractModifyingResourceProvider.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/AbstractReadableResourceProvider.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/SimplePathInfo.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/SimpleReadableResource.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentRootServlet.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationAgentServlet.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/servlet/ReplicationTriggerServlet.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/TransportAuthenticationProvider.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProvider.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderFactory.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/SimpleHttpReplicationTransportHandler.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/ReplicationTrigger.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ChainReplicateReplicationTrigger.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/RemoteEventReplicationTrigger.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ResourceEventReplicationTrigger.java
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/trigger/impl/ScheduledReplicationTrigger.java
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish-reverse.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-publish.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.agent.impl.DefaultReplicationComponentFactory-trigger-remote-event.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.author/org.apache.sling.replication.transport.authentication.impl.UserCredentialsTransportAuthenticationProviderFactory-publishAdmin.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.publish/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-cache-flush.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.publish/org.apache.sling.replication.agent.impl.CompactSimpleReplicationAgentFactory-reverse.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.publish/org.apache.sling.replication.agent.impl.DefaultReplicationComponentFactory-trigger-content-changed.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.publish/org.apache.sling.replication.packaging.impl.exporter.AgentReplicationPackageExporterFactory-reverse.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.publish/org.apache.sling.replication.packaging.impl.exporter.LocalReplicationPackageExporterFactory-default.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.publish/org.apache.sling.replication.packaging.impl.importer.AdvancedRemoteReplicationPackageImporter-cache-flush.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install.publish/org.apache.sling.replication.packaging.impl.importer.LocalReplicationPackageImporterFactory-default.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install/org.apache.sling.replication.serialization.impl.vlt.FileVaultReplicationPackageBuilderFactory-vlt.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-replication.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install/resources/services/org.apache.sling.replication.resources.impl.OsgiPropertiesResourceProviderFactory-agents.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install/resources/services/org.apache.sling.replication.resources.impl.OsgiPropertiesResourceProviderFactory-exporters.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install/resources/services/org.apache.sling.replication.resources.impl.OsgiPropertiesResourceProviderFactory-importers.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install/resources/services/org.apache.sling.replication.resources.impl.OsgiPropertiesResourceProviderFactory-triggers.json
sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/install/resources/settings/org.apache.sling.replication.resources.impl.OsgiPropertiesResourceProviderFactory-simpleAgents.json
sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentTest.java
sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/queue/impl/jobhandling/JobHandlingUtilsTest.java
sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/transport/authentication/impl/UserCredentialsTransportAuthenticationProviderTest.java
sling/trunk/contrib/extensions/replication/it/pom.xml
sling/trunk/contrib/extensions/replication/it/src/main/resources/SLING-CONTENT/libs/test/install.author/org.apache.sling.replication.agent.impl.DefaultReplicationComponentFactory-trigger-test-content-event.json
sling/trunk/contrib/extensions/replication/it/src/main/resources/SLING-CONTENT/libs/test/install.author/org.apache.sling.replication.agent.impl.DefaultReplicationComponentFactory-trigger-test-remote-event.json
sling/trunk/contrib/extensions/replication/it/src/main/resources/SLING-CONTENT/libs/test/install.author/org.apache.sling.replication.agent.impl.DefaultReplicationComponentFactory-trigger-test-replicate-event.json
sling/trunk/contrib/extensions/replication/it/src/main/resources/SLING-CONTENT/libs/test/install.author/org.apache.sling.replication.agent.impl.DefaultReplicationComponentFactory-trigger-test-scheduled-event.json
sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationAgentResourcesIntegrationTest.java
sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationPackageExporterImporterTest.java
sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationUtils.java
Modified: sling/trunk/contrib/extensions/replication/core/pom.xml
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/pom.xml?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/pom.xml (original)
+++ sling/trunk/contrib/extensions/replication/core/pom.xml Mon Sep 29 08:41:26
2014
@@ -17,7 +17,8 @@
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">
+<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
-->
@@ -37,12 +38,14 @@
<name>Apache Sling Replication Core</name>
<description>
- The Apache Sling Replication core bundle provides a set of utilities
to replicate content from / to other Sling instances.
+ The Apache Sling Replication core bundle provides a set of utilities
to replicate content from / to other Sling
+ instances.
</description>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/replication</connection>
-
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/replication</developerConnection>
+
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/replication
+ </developerConnection>
<url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication</url>
</scm>
@@ -63,21 +66,24 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
- <configuration>
- <instructions>
-
<Bundle-SymbolicName>org.apache.sling.replication</Bundle-SymbolicName>
-
<Sling-Initial-Content>SLING-CONTENT/libs/sling/replication;path:=/libs/sling/replication;overwrite:=true</Sling-Initial-Content>
- <Export-Package>
- org.apache.sling.replication.agent,
- org.apache.sling.replication.communication,
- org.apache.sling.replication.event,
- org.apache.sling.replication.queue,
- org.apache.sling.replication.trigger,
- org.apache.sling.replication.packaging
- </Export-Package>
- <Embed-Dependency>httpasyncclient</Embed-Dependency>
- </instructions>
- </configuration>
+ <configuration>
+ <instructions>
+
<Bundle-SymbolicName>org.apache.sling.replication</Bundle-SymbolicName>
+ <Sling-Initial-Content>
+
SLING-CONTENT/libs/sling/replication;path:=/libs/sling/replication;overwrite:=true
+ </Sling-Initial-Content>
+ <Export-Package>
+ org.apache.sling.replication.agent,
+ org.apache.sling.replication.communication,
+ org.apache.sling.replication.event,
+ org.apache.sling.replication.queue,
+ org.apache.sling.replication.trigger,
+ org.apache.sling.replication.packaging,
+
org.apache.sling.replication.transport.authentication
+ </Export-Package>
+ <Embed-Dependency>httpasyncclient</Embed-Dependency>
+ </instructions>
+ </configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -89,137 +95,137 @@
<!--
======================================================================= -->
<!-- D E P E N D E N C I E S
-->
<!--
======================================================================= -->
- <dependencies>
- <!-- TESTING -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>1.9.5</version>
- <scope>test</scope>
- </dependency>
- <!-- SLING -->
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.api</artifactId>
- <version>2.3.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.commons.osgi</artifactId>
- <version>2.2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.commons.scheduler</artifactId>
- <version>2.4.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.jcr.api</artifactId>
- <version>2.2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.event</artifactId>
- <version>3.3.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.hc.core</artifactId>
- <version>1.0.6</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.settings</artifactId>
- <version>1.3.0</version>
- <scope>provided</scope>
- </dependency>
- <!-- LOGGING -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.6.2</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.6.2</version>
- <scope>runtime</scope>
- </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>
- <!-- FILEVAULT -->
- <dependency>
- <groupId>org.apache.jackrabbit.vault</groupId>
- <artifactId>org.apache.jackrabbit.vault</artifactId>
- <version>3.0.0</version>
- </dependency>
- <!-- HTTP -->
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>fluent-hc</artifactId>
- <version>4.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpasyncclient</artifactId>
- <version>4.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore-osgi</artifactId>
- <version>4.3.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient-osgi</artifactId>
- <version>4.3.4</version>
- </dependency>
- <!-- JACKRABBIT -->
- <dependency>
- <groupId>org.apache.jackrabbit</groupId>
- <artifactId>jackrabbit-jcr-commons</artifactId>
- <version>2.6.2</version>
- <scope>provided</scope>
- </dependency>
- <!-- COMMONS -->
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <version>2.5.3</version>
- </plugin>
- </plugins>
- </reporting>
+ <dependencies>
+ <!-- TESTING -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>1.9.5</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- SLING -->
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.api</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.commons.osgi</artifactId>
+ <version>2.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.commons.scheduler</artifactId>
+ <version>2.4.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.jcr.api</artifactId>
+ <version>2.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.event</artifactId>
+ <version>3.3.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.hc.core</artifactId>
+ <version>1.0.6</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.settings</artifactId>
+ <version>1.3.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- LOGGING -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.6.2</version>
+ <scope>runtime</scope>
+ </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>
+ <!-- FILEVAULT -->
+ <dependency>
+ <groupId>org.apache.jackrabbit.vault</groupId>
+ <artifactId>org.apache.jackrabbit.vault</artifactId>
+ <version>3.0.0</version>
+ </dependency>
+ <!-- HTTP -->
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>fluent-hc</artifactId>
+ <version>4.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpasyncclient</artifactId>
+ <version>4.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore-osgi</artifactId>
+ <version>4.3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient-osgi</artifactId>
+ <version>4.3.4</version>
+ </dependency>
+ <!-- JACKRABBIT -->
+ <dependency>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-jcr-commons</artifactId>
+ <version>2.6.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- COMMONS -->
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>2.5.3</version>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationAgent.java
Mon Sep 29 08:41:26 2014
@@ -25,7 +25,7 @@ import org.apache.sling.replication.queu
/**
* A replication agent is responsible for handling {@link
org.apache.sling.replication.communication.ReplicationRequest}s.
- *
+ * <p/>
* This means executing actions of a specific {@link
org.apache.sling.replication.communication.ReplicationActionType}s on
* specific path(s) which will resume in e.g. polling resources from a certain
Sling instance and / or sending resources to
* other instances.
Added:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationComponentProvider.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationComponentProvider.java?rev=1628136&view=auto
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationComponentProvider.java
(added)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationComponentProvider.java
Mon Sep 29 08:41:26 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.replication.agent;
+
+import java.util.Map;
+
+public interface ReplicationComponentProvider {
+
+ /**
+ * Retrieves an already existing component.
+ * @param type
+ * @param componentName
+ * @param <ComponentType>
+ * @return
+ */
+ <ComponentType> ComponentType getComponent(java.lang.Class<ComponentType>
type, String componentName);
+
+ /**
+ * Creates a new component.
+ * @param type
+ * @param properties
+ * @param <ComponentType>
+ * @return
+ */
+ <ComponentType> ComponentType
createComponent(java.lang.Class<ComponentType> type, Map<String, Object>
properties);
+
+
+
+}
Propchange:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/ReplicationComponentProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CompactSimpleReplicationAgentFactory.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CompactSimpleReplicationAgentFactory.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CompactSimpleReplicationAgentFactory.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/CompactSimpleReplicationAgentFactory.java
Mon Sep 29 08:41:26 2014
@@ -31,6 +31,7 @@ import org.apache.felix.scr.annotations.
import org.apache.felix.scr.annotations.Reference;
import org.apache.sling.commons.osgi.PropertiesUtil;
import org.apache.sling.replication.agent.ReplicationAgent;
+import org.apache.sling.replication.agent.ReplicationComponentProvider;
import org.apache.sling.settings.SlingSettingsService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/DefaultReplicationComponentFactory.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/DefaultReplicationComponentFactory.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/DefaultReplicationComponentFactory.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/DefaultReplicationComponentFactory.java
Mon Sep 29 08:41:26 2014
@@ -31,6 +31,7 @@ import org.apache.felix.scr.annotations.
import org.apache.felix.scr.annotations.Reference;
import org.apache.sling.commons.osgi.PropertiesUtil;
import org.apache.sling.replication.agent.ReplicationAgent;
+import org.apache.sling.replication.agent.ReplicationComponentProvider;
import org.apache.sling.replication.trigger.ReplicationTrigger;
import org.apache.sling.settings.SlingSettingsService;
import org.osgi.framework.BundleContext;
@@ -42,7 +43,7 @@ import org.slf4j.LoggerFactory;
/**
* A generic factory for replication components using a compact configuration,
already existing OSGi services
* for the components to be wired can be used as well as directly instantiated
components (called by type name).
- *
+ * <p/>
* Currently supported components are of kind 'agent' and 'trigger'.
*/
@Component(metatype = true,
@@ -121,8 +122,7 @@ public class DefaultReplicationComponent
componentObject = agent;
agent.enable();
- }
- else if ("trigger".equals(kind)) {
+ } else if ("trigger".equals(kind)) {
ReplicationTrigger trigger =
componentProvider.createComponent(ReplicationTrigger.class, properties);
@@ -148,8 +148,7 @@ public class DefaultReplicationComponent
SimpleReplicationAgent replicationComponent =
(SimpleReplicationAgent) context.getService(reference);
replicationComponent.disable();
- }
- else if ("trigger".equals(kind)) {
+ } else if ("trigger".equals(kind)) {
}
componentReg.unregister();
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/DefaultReplicationComponentProvider.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/DefaultReplicationComponentProvider.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/DefaultReplicationComponentProvider.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/DefaultReplicationComponentProvider.java
Mon Sep 29 08:41:26 2014
@@ -20,6 +20,7 @@ import org.apache.sling.commons.osgi.Pro
import org.apache.sling.commons.scheduler.Scheduler;
import org.apache.sling.jcr.api.SlingRepository;
import org.apache.sling.replication.agent.ReplicationAgent;
+import org.apache.sling.replication.agent.ReplicationComponentProvider;
import org.apache.sling.replication.event.ReplicationEventFactory;
import org.apache.sling.replication.packaging.ReplicationPackageExporter;
import org.apache.sling.replication.packaging.ReplicationPackageImporter;
@@ -29,15 +30,15 @@ import org.apache.sling.replication.pack
import
org.apache.sling.replication.packaging.impl.importer.RemoteReplicationPackageImporterFactory;
import org.apache.sling.replication.queue.ReplicationQueueDistributionStrategy;
import org.apache.sling.replication.queue.ReplicationQueueProvider;
+import org.apache.sling.replication.serialization.ReplicationPackageBuilder;
+import
org.apache.sling.replication.serialization.impl.vlt.FileVaultReplicationPackageBuilderFactory;
+import
org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
+import
org.apache.sling.replication.transport.authentication.impl.UserCredentialsTransportAuthenticationProvider;
import org.apache.sling.replication.trigger.ReplicationTrigger;
import
org.apache.sling.replication.trigger.impl.ChainReplicateReplicationTrigger;
import org.apache.sling.replication.trigger.impl.RemoteEventReplicationTrigger;
import
org.apache.sling.replication.trigger.impl.ResourceEventReplicationTrigger;
import org.apache.sling.replication.trigger.impl.ScheduledReplicationTrigger;
-import org.apache.sling.replication.serialization.ReplicationPackageBuilder;
-import
org.apache.sling.replication.serialization.impl.vlt.FileVaultReplicationPackageBuilderFactory;
-import
org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
-import
org.apache.sling.replication.transport.authentication.impl.UserCredentialsTransportAuthenticationProvider;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -105,8 +106,7 @@ public class DefaultReplicationComponent
try {
if (type.isAssignableFrom(ReplicationAgent.class)) {
return (ComponentType) createAgent(properties, this);
- }
- else if (type.isAssignableFrom(ReplicationTrigger.class)) {
+ } else if (type.isAssignableFrom(ReplicationTrigger.class)) {
return (ComponentType) createTrigger(properties, this);
}
} catch (Throwable t) {
@@ -242,8 +242,7 @@ public class DefaultReplicationComponent
String name = PropertiesUtil.toString(properties.get(NAME), null);
return
componentProvider.getComponent(TransportAuthenticationProvider.class, name);
- }
- else if ("user".equals(factory)) {
+ } else if ("user".equals(factory)) {
return new
UserCredentialsTransportAuthenticationProvider(properties);
}
@@ -261,27 +260,23 @@ public class DefaultReplicationComponent
}
- private ReplicationTrigger createTrigger(Map<String,Object> properties,
ReplicationComponentProvider componentProvider) {
+ private ReplicationTrigger createTrigger(Map<String, Object> properties,
ReplicationComponentProvider componentProvider) {
String factory =
PropertiesUtil.toString(properties.get(COMPONENT_TYPE), "service");
if ("service".equals(factory)) {
String name = PropertiesUtil.toString(properties.get(NAME), null);
return componentProvider.getComponent(ReplicationTrigger.class,
name);
- }
- else if (RemoteEventReplicationTrigger.TYPE.equals(factory)) {
+ } else if (RemoteEventReplicationTrigger.TYPE.equals(factory)) {
Map<String, Object> authenticationProviderProperties =
extractMap("authenticationProvider", properties);
TransportAuthenticationProvider authenticationProvider =
createTransportAuthenticationProvider(authenticationProviderProperties,
componentProvider);
return new RemoteEventReplicationTrigger(properties,
authenticationProvider, scheduler);
- }
- else if (ResourceEventReplicationTrigger.TYPE.equals(factory)) {
+ } else if (ResourceEventReplicationTrigger.TYPE.equals(factory)) {
return new ResourceEventReplicationTrigger(properties,
bundleContext);
- }
- else if (ScheduledReplicationTrigger.TYPE.equals(factory)) {
+ } else if (ScheduledReplicationTrigger.TYPE.equals(factory)) {
return new ScheduledReplicationTrigger(properties, scheduler);
- }
- else if (ChainReplicateReplicationTrigger.TYPE.equals(factory)) {
+ } else if (ChainReplicateReplicationTrigger.TYPE.equals(factory)) {
return new ChainReplicateReplicationTrigger(properties,
bundleContext);
}
@@ -298,7 +293,7 @@ public class DefaultReplicationComponent
}
Map<String, Object> extractMap(String key, Map<String, Object> objectMap) {
- return SettingsUtils.extractMap(key, objectMap);
+ return SettingsUtils.extractMap(key, objectMap);
}
List<Map<String, Object>> extractMapList(String key, Map<String, Object>
objectMap) {
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/ReplicationComponentListener.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/ReplicationComponentListener.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/ReplicationComponentListener.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/ReplicationComponentListener.java
Mon Sep 29 08:41:26 2014
@@ -21,5 +21,6 @@ package org.apache.sling.replication.age
public interface ReplicationComponentListener {
<ComponentType> void componentBind(ComponentType component, String
componentName);
+
<ComponentType> void componentUnbind(ComponentType component, String
componentName);
}
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SettingsUtils.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SettingsUtils.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SettingsUtils.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SettingsUtils.java
Mon Sep 29 08:41:26 2014
@@ -53,23 +53,22 @@ public class SettingsUtils {
int beginDelim = key.indexOf(COMPONENT_MAP_BEGIN);
int endDelim = key.indexOf(COMPONENT_MAP_END);
- if (beginDelim >=0 && endDelim > beginDelim && value instanceof
String) {
+ if (beginDelim >= 0 && endDelim > beginDelim && value instanceof
String) {
String newKey = key.substring(0, beginDelim);
- String partialKey = key.substring(beginDelim+1, endDelim);
+ String partialKey = key.substring(beginDelim + 1, endDelim);
String newValue = (String) value;
try {
Integer.parseInt(partialKey);
// newKey[0] = newValue
- } catch(NumberFormatException e) {
+ } catch (NumberFormatException e) {
// newKey[partialKey] = newValue
newValue = partialKey + "=" + newValue;
}
addValueInArray(result, newKey, newValue);
- }
- else {
+ } else {
result.put(key, value);
}
}
@@ -89,11 +88,10 @@ public class SettingsUtils {
int firstDelim = key.indexOf(COMPONENT_DELIM);
if (firstDelim >= 0) {
String newKey = key.substring(0, firstDelim);
- String newValue = key.substring(firstDelim+1) + "=" + value;
+ String newValue = key.substring(firstDelim + 1) + "=" + value;
addValueInArray(result, newKey, newValue);
- }
- else {
+ } else {
result.put(key, value);
}
@@ -114,9 +112,8 @@ public class SettingsUtils {
Collections.addAll(newList, existingArray);
newList.add(value);
arayValue = newList.toArray(new String[newList.size()]);
- }
- else {
- arayValue = new String[] { value };
+ } else {
+ arayValue = new String[]{value};
}
map.put(key, arayValue);
@@ -133,24 +130,22 @@ public class SettingsUtils {
if (value instanceof Map) {
- Map<String,Object> map = (Map<String, Object>) value;
+ Map<String, Object> map = (Map<String, Object>) value;
for (Map.Entry<String, Object> e : map.entrySet()) {
if (e.getValue() != null) {
result.add(key + "[" + e.getKey() + "]=" +
e.getValue().toString());
}
}
- }
- else if (value.getClass().isArray()) {
+ } else if (value.getClass().isArray()) {
Object[] array = (Object[]) value;
- for (int i=0; i < array.length; i++) {
+ for (int i = 0; i < array.length; i++) {
if (array[i] != null) {
result.add(key + "[" + i + "]=" + array[i].toString());
}
}
- }
- else {
+ } else {
result.add(key + "=" + value.toString());
}
}
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgent.java
Mon Sep 29 08:41:26 2014
@@ -39,10 +39,10 @@ import org.apache.sling.replication.queu
import org.apache.sling.replication.queue.ReplicationQueueItemState;
import org.apache.sling.replication.queue.ReplicationQueueProcessor;
import org.apache.sling.replication.queue.ReplicationQueueProvider;
-import org.apache.sling.replication.trigger.ReplicationTriggerRequestHandler;
-import org.apache.sling.replication.trigger.ReplicationTrigger;
import
org.apache.sling.replication.serialization.ReplicationPackageBuildingException;
import
org.apache.sling.replication.serialization.ReplicationPackageReadingException;
+import org.apache.sling.replication.trigger.ReplicationTrigger;
+import org.apache.sling.replication.trigger.ReplicationTriggerRequestHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -192,7 +192,7 @@ public class SimpleReplicationAgent impl
log.info("enabling agent");
// register triggers if any
- for (int i=0; i < triggers.size(); i++) {
+ for (int i = 0; i < triggers.size(); i++) {
ReplicationTrigger trigger = triggers.get(i);
String handlerId = getName() + "-" + i;
trigger.register(handlerId, new
AgentBasedTriggerRequestHandler(this));
@@ -205,7 +205,7 @@ public class SimpleReplicationAgent impl
public void disable() {
log.info("disabling agent");
- for (int i=0; i < triggers.size(); i++) {
+ for (int i = 0; i < triggers.size(); i++) {
ReplicationTrigger trigger = triggers.get(i);
String handlerId = getName() + "-" + i;
trigger.unregister(handlerId);
@@ -255,8 +255,7 @@ public class SimpleReplicationAgent impl
public void handle(ReplicationRequest request) {
try {
agent.execute(request);
- }
- catch (AgentReplicationException e) {
+ } catch (AgentReplicationException e) {
log.error("Error executing handler", e);
}
}
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentFactory.java
Mon Sep 29 08:41:26 2014
@@ -18,7 +18,6 @@
*/
package org.apache.sling.replication.agent.impl;
-import java.util.ArrayList;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Map;
@@ -41,7 +40,6 @@ import org.apache.sling.replication.queu
import org.apache.sling.replication.queue.ReplicationQueueProvider;
import org.apache.sling.replication.queue.impl.SingleQueueDistributionStrategy;
import
org.apache.sling.replication.queue.impl.jobhandling.JobHandlingReplicationQueueProvider;
-import org.apache.sling.replication.trigger.ReplicationTrigger;
import org.apache.sling.settings.SlingSettingsService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationActionType.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationActionType.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationActionType.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/communication/ReplicationActionType.java
Mon Sep 29 08:41:26 2014
@@ -46,9 +46,8 @@ public enum ReplicationActionType {
/**
* Create a type
- *
- * @param name
- * name
+ *
+ * @param name name
*/
private ReplicationActionType(String name) {
this.name = name;
@@ -56,7 +55,7 @@ public enum ReplicationActionType {
/**
* Returns the human readable type name of this type.
- *
+ *
* @return the name
*/
public String getName() {
@@ -66,9 +65,8 @@ public enum ReplicationActionType {
/**
* 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
+ *
+ * @param n the name
* @return the type or <code>null</code>
*/
public static ReplicationActionType fromName(String n) {
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/event/ReplicationEventFactory.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/event/ReplicationEventFactory.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/event/ReplicationEventFactory.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/event/ReplicationEventFactory.java
Mon Sep 29 08:41:26 2014
@@ -27,8 +27,9 @@ public interface ReplicationEventFactory
/**
* generate a replication event
+ *
* @param replicationEventType the type of event to be generated
- * @param properties a dictionary of properties to be attached to the event
+ * @param properties a dictionary of properties to be attached
to the event
*/
void generateEvent(ReplicationEventType replicationEventType,
Dictionary<?, ?> properties);
}
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/ReplicationPackage.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/ReplicationPackage.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/ReplicationPackage.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/ReplicationPackage.java
Mon Sep 29 08:41:26 2014
@@ -29,24 +29,28 @@ public interface ReplicationPackage exte
/**
* get package id
+ *
* @return the package id as a <code>String</code>
*/
String getId();
/**
* get the paths covered by this package
+ *
* @return an array of <code>String</code> paths
*/
String[] getPaths();
/**
* get the action this package is used for
+ *
* @return the action as a <code>String</code>
*/
String getAction();
/**
* get the type of package
+ *
* @return the package type as a <code>String</code>
*/
String getType();
@@ -54,6 +58,7 @@ public interface ReplicationPackage exte
/**
* 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
*/
@@ -61,6 +66,7 @@ public interface ReplicationPackage exte
/**
* get package stream length
+ *
* @return the package length as a <code>long</code>
*/
long getLength();
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterFactory.java
Mon Sep 29 08:41:26 2014
@@ -69,7 +69,7 @@ public class LocalReplicationPackageImpo
}
public static LocalReplicationPackageImporter getInstance(Map<String,
Object> config,
- ReplicationPackageBuilder packageBuilder, ReplicationEventFactory
replicationEventFactory) {
+
ReplicationPackageBuilder packageBuilder, ReplicationEventFactory
replicationEventFactory) {
if (packageBuilder == null) {
throw new IllegalArgumentException("A package builder is
required");
}
@@ -78,7 +78,7 @@ public class LocalReplicationPackageImpo
}
public boolean importPackage(ReplicationPackage replicationPackage) {
- return importer.importPackage(replicationPackage);
+ return importer.importPackage(replicationPackage);
}
public ReplicationPackage readPackage(InputStream stream) throws
ReplicationPackageReadingException {
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterFactory.java
Mon Sep 29 08:41:26 2014
@@ -79,7 +79,7 @@ public class RemoteReplicationPackageImp
@Activate
protected void activate(BundleContext context, Map<String, Object> config)
throws Exception {
- importer = getInstance(config, transportAuthenticationProvider);
+ importer = getInstance(config, transportAuthenticationProvider);
}
@@ -101,7 +101,7 @@ public class RemoteReplicationPackageImp
}
public boolean importPackage(ReplicationPackage replicationPackage) {
- return importer.importPackage(replicationPackage);
+ return importer.importPackage(replicationPackage);
}
public ReplicationPackage readPackage(InputStream stream) throws
ReplicationPackageReadingException {
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/ReplicationQueueItem.java
Mon Sep 29 08:41:26 2014
@@ -20,7 +20,7 @@ package org.apache.sling.replication.que
/**
* An item in a {@link org.apache.sling.replication.queue.ReplicationQueue}
- *
+ * <p/>
* This is basically a proxy to {@link
org.apache.sling.replication.packaging.ReplicationPackage} designed to avoid
having
* to keep the package {@link
org.apache.sling.replication.packaging.ReplicationPackage#createInputStream()
stream} into
* the queues.
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/AbstractReplicationQueueProvider.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/AbstractReplicationQueueProvider.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/AbstractReplicationQueueProvider.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/AbstractReplicationQueueProvider.java
Mon Sep 29 08:41:26 2014
@@ -38,7 +38,7 @@ public abstract class AbstractReplicatio
private final Map<String, ReplicationQueue> queueMap = new
ConcurrentHashMap<String, ReplicationQueue>();
public ReplicationQueue getQueue(String agentName, String queueName)
- throws ReplicationQueueException {
+ throws ReplicationQueueException {
String key = agentName + queueName;
ReplicationQueue queue = queueMap.get(key);
@@ -52,7 +52,7 @@ public abstract class AbstractReplicatio
}
public ReplicationQueue getDefaultQueue(String agentName)
- throws ReplicationQueueException {
+ throws ReplicationQueueException {
return getQueue(agentName, "");
}
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/SingleQueueDistributionStrategy.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/SingleQueueDistributionStrategy.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/SingleQueueDistributionStrategy.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/SingleQueueDistributionStrategy.java
Mon Sep 29 08:41:26 2014
@@ -46,7 +46,7 @@ public class SingleQueueDistributionStra
public ReplicationQueueItemState add(String agentName,
ReplicationQueueItem item,
ReplicationQueueProvider
queueProvider)
- throws ReplicationQueueException {
+ throws ReplicationQueueException {
log.info("using single queue distribution");
ReplicationQueueItemState state = new ReplicationQueueItemState();
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessor.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessor.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessor.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/ScheduledReplicationQueueProcessor.java
Mon Sep 29 08:41:26 2014
@@ -37,7 +37,7 @@ public class ScheduledReplicationQueuePr
private final ReplicationQueueProcessor queueProcessor;
public ScheduledReplicationQueueProcessor(ReplicationQueueProvider
queueProvider,
- ReplicationQueueProcessor
queueProcessor){
+ ReplicationQueueProcessor
queueProcessor) {
this.queueProvider = queueProvider;
this.queueProcessor = queueProcessor;
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueProvider.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueProvider.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueProvider.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/queue/impl/simple/SimpleReplicationQueueProvider.java
Mon Sep 29 08:41:26 2014
@@ -38,7 +38,7 @@ import org.apache.sling.replication.queu
@Service(value = ReplicationQueueProvider.class)
@Property(name = "name", value = SimpleReplicationQueueProvider.NAME)
public class SimpleReplicationQueueProvider extends
AbstractReplicationQueueProvider implements
- ReplicationQueueProvider {
+ ReplicationQueueProvider {
@Reference
Scheduler scheduler;
@@ -46,7 +46,7 @@ public class SimpleReplicationQueueProvi
public static final String NAME = "simple";
protected ReplicationQueue getOrCreateQueue(String agentName, String
selector)
- throws ReplicationQueueException {
+ throws ReplicationQueueException {
return new SimpleReplicationQueue(agentName, selector);
}
@@ -65,7 +65,7 @@ public class SimpleReplicationQueueProvi
scheduler.unschedule(getJobName(agentName));
}
- private String getJobName(String agentName){
- return
SimpleReplicationQueueProvider.NAME+"-queueProcessor-"+agentName;
+ private String getJobName(String agentName) {
+ return SimpleReplicationQueueProvider.NAME + "-queueProcessor-" +
agentName;
}
}
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/ReplicationConstants.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/ReplicationConstants.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/ReplicationConstants.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/ReplicationConstants.java
Mon Sep 29 08:41:26 2014
@@ -25,12 +25,12 @@ public class ReplicationConstants {
public static final String SUFFIX_AGENT_QUEUE = "/queue";
public static final String SUFFIX_AGENT_QUEUE_EVENT = "/queue/event";
- public static final String AGENT_RESOURCE_TYPE =
"sling/replication/service/agent";
- public static final String AGENT_QUEUE_RESOURCE_TYPE =
AGENT_RESOURCE_TYPE + SUFFIX_AGENT_QUEUE;
- public static final String AGENT_QUEUE_EVENT_RESOURCE_TYPE =
AGENT_QUEUE_RESOURCE_TYPE + SUFFIX_AGENT_QUEUE_EVENT;
- public static final String AGENT_ROOT_RESOURCE_TYPE = AGENT_RESOURCE_TYPE
+ SUFFIX_RESOURCE_LIST;
+ public static final String AGENT_RESOURCE_TYPE =
"sling/replication/service/agent";
+ public static final String AGENT_QUEUE_RESOURCE_TYPE = AGENT_RESOURCE_TYPE
+ SUFFIX_AGENT_QUEUE;
+ public static final String AGENT_QUEUE_EVENT_RESOURCE_TYPE =
AGENT_QUEUE_RESOURCE_TYPE + SUFFIX_AGENT_QUEUE_EVENT;
+ public static final String AGENT_ROOT_RESOURCE_TYPE = AGENT_RESOURCE_TYPE
+ SUFFIX_RESOURCE_LIST;
- public static final String IMPORTER_RESOURCE_TYPE =
"sling/replication/service/importer";
- public static final String EXPORTER_RESOURCE_TYPE =
"sling/replication/service/exporter";
+ public static final String IMPORTER_RESOURCE_TYPE =
"sling/replication/service/importer";
+ public static final String EXPORTER_RESOURCE_TYPE =
"sling/replication/service/exporter";
}
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiConfigurationResourceProvider.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiConfigurationResourceProvider.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiConfigurationResourceProvider.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiConfigurationResourceProvider.java
Mon Sep 29 08:41:26 2014
@@ -208,7 +208,7 @@ public class OsgiConfigurationResourcePr
return dictionary;
}
- private Map<String, Object> filterBeforeSave(Map<String, Object>
properties) {
+ private Map<String, Object> filterBeforeSave(Map<String, Object>
properties) {
Map<String, Object> result = new HashMap<String, Object>();
for (Map.Entry<String, Object> entry : properties.entrySet()) {
@@ -218,8 +218,7 @@ public class OsgiConfigurationResourcePr
if (entryValue != null) {
result.put(entry.getKey(), entryValue);
}
- }
- else {
+ } else {
result.put(entry.getKey(), entry.getValue());
}
@@ -229,7 +228,7 @@ public class OsgiConfigurationResourcePr
}
- private Map<String, Object> filterBeforeRead(Map<String, Object>
properties) {
+ private Map<String, Object> filterBeforeRead(Map<String, Object>
properties) {
Map<String, Object> result = new HashMap<String, Object>();
for (Map.Entry<String, Object> entry : properties.entrySet()) {
@@ -239,8 +238,7 @@ public class OsgiConfigurationResourcePr
if (entryValue != null) {
result.put(entry.getKey(), entryValue);
}
- }
- else {
+ } else {
result.put(entry.getKey(), entry.getValue());
}
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiPropertiesResourceProviderFactory.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiPropertiesResourceProviderFactory.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiPropertiesResourceProviderFactory.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/OsgiPropertiesResourceProviderFactory.java
Mon Sep 29 08:41:26 2014
@@ -40,17 +40,17 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@Component(label="Osgi Service Properties Resource Provider Factory",
- description="Osgi Service Properties Resource Provider Factory",
+@Component(label = "Osgi Service Properties Resource Provider Factory",
+ description = "Osgi Service Properties Resource Provider Factory",
configurationFactory = true,
specVersion = "1.1",
policy = ConfigurationPolicy.REQUIRE,
name = OsgiPropertiesResourceProviderFactory.SERVICE_PID,
- metatype=true)
-@Service(value=ResourceProviderFactory.class)
+ metatype = true)
+@Service(value = ResourceProviderFactory.class)
@Properties({
- @Property(name= ResourceProvider.ROOTS),
- @Property(name = ResourceProvider.OWNS_ROOTS, boolValue=true,
propertyPrivate=true)
+ @Property(name = ResourceProvider.ROOTS),
+ @Property(name = ResourceProvider.OWNS_ROOTS, boolValue = true,
propertyPrivate = true)
})
public class OsgiPropertiesResourceProviderFactory implements
ResourceProviderFactory {
@@ -70,7 +70,7 @@ public class OsgiPropertiesResourceProvi
/**
* nameProperty contains the name of the property that will be used to
expose
* the underlying resources.
- *
+ * <p/>
* resourceRoot/resourceName/childResourceName
*/
@Property(value = DEFAULT_FRIENDLY_NAME_PROPERTY)
@@ -80,15 +80,14 @@ public class OsgiPropertiesResourceProvi
* resourceProperties contains the list of properties returned by this
provider.
* Properties can be configured for the main resource, for the root
resource and for child resources.
* Root resource properties are static and can be configured as follows:
- * ../rootResourcePropertyName = rootResourcePropertyValue
- *
+ * ../rootResourcePropertyName = rootResourcePropertyValue
+ * <p/>
* Main resource properties can be static or dynamic (depending on the
underlying resource) are configured as follows:
- * mainResourceStaticPropertyName = mainResourceStaticPropertyValue
- * mainResourceDynamicPropertyName = {mainResourceSourcePropertyName}
- *
+ * mainResourceStaticPropertyName = mainResourceStaticPropertyValue
+ * mainResourceDynamicPropertyName = {mainResourceSourcePropertyName}
+ * <p/>
* Child resource properties are static an can be configured as follows:
- *
childResourceName/childResourcePropertyName=childResourcePropertyValue
- *
+ * childResourceName/childResourcePropertyName=childResourcePropertyValue
*/
@Property(cardinality = 100)
public final static String RESOURCE_PROPERTIES = "resourceProperties";
@@ -98,7 +97,7 @@ public class OsgiPropertiesResourceProvi
* The providerType can be osgiService or osgiConfig.
* A provider of type osgiService will allow read only access to osgi
service properties of a particuar interface.
* The resource can be adapted to the underlying service instance.
- *
+ * <p/>
* A provider of type osgiConfig will allow CRUD access to osgi
configurations registered for a particular factory. *
*/
@Property(value = DEFAULT_PROVIDER_TYPE)
@@ -133,8 +132,7 @@ public class OsgiPropertiesResourceProvi
resourceRoot,
additionalResourceProperties);
- }
- else {
+ } else {
OsgiServicePropertiesResourceProvider
servicePropertiesResourceProvider;
resourceProvider = servicePropertiesResourceProvider = new
OsgiServicePropertiesResourceProvider(context,
type,
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/AbstractModifyingResourceProvider.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/AbstractModifyingResourceProvider.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/AbstractModifyingResourceProvider.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/AbstractModifyingResourceProvider.java
Mon Sep 29 08:41:26 2014
@@ -37,7 +37,7 @@ public abstract class AbstractModifyingR
private final Set<String> deletedResources = new HashSet<String>();
public AbstractModifyingResourceProvider(String resourceRoot,
- Map<String,String>
additionalResourceProperties){
+ Map<String, String>
additionalResourceProperties) {
super(resourceRoot, additionalResourceProperties);
}
@@ -79,8 +79,8 @@ public abstract class AbstractModifyingR
String resourceName = pathInfo.getMainResourceName();
if (!deletedResources.contains(resourceName)) {
- deletedResources.add(resourceName);
- changedResources.remove(resourceName);
+ deletedResources.add(resourceName);
+ changedResources.remove(resourceName);
}
}
@@ -166,5 +166,4 @@ public abstract class AbstractModifyingR
Set<String> deletedResources) throws
PersistenceException;
-
}
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/AbstractReadableResourceProvider.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/AbstractReadableResourceProvider.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/AbstractReadableResourceProvider.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/AbstractReadableResourceProvider.java
Mon Sep 29 08:41:26 2014
@@ -41,7 +41,7 @@ public abstract class AbstractReadableRe
private final Map<String, Map<String, String>>
additionalResourcePropertiesMap = new HashMap<String, Map<String, String>>();
public AbstractReadableResourceProvider(String resourceRoot,
- Map<String,String>
additionalResourceProperties) {
+ Map<String, String>
additionalResourceProperties) {
this.resourceRoot = resourceRoot;
@@ -50,9 +50,9 @@ public abstract class AbstractReadableRe
String resourceName = MAIN_RESOURCE_PREFIX;
String propertyName = entry.getKey();
int idx = propertyName.indexOf("/");
- if (idx >=0) {
+ if (idx >= 0) {
resourceName = propertyName.substring(0, idx);
- propertyName = propertyName.substring(idx+1);
+ propertyName = propertyName.substring(idx + 1);
}
if (!additionalResourcePropertiesMap.containsKey(resourceName)) {
@@ -78,7 +78,7 @@ public abstract class AbstractReadableRe
return null;
}
- if(!hasPermission(resourceResolver, pathInfo.getResourcePath(),
Session.ACTION_READ)) {
+ if (!hasPermission(resourceResolver, pathInfo.getResourcePath(),
Session.ACTION_READ)) {
return null;
}
@@ -93,16 +93,15 @@ public abstract class AbstractReadableRe
Map<String, String> additionalProperties =
additionalResourcePropertiesMap.get(MAIN_RESOURCE_PREFIX);
if (!properties.containsKey("sling:resourceType") &&
additionalProperties.containsKey("sling:resourceType")) {
- properties.put("sling:resourceType",
additionalProperties.get("sling:resourceType") +"/list");
+ properties.put("sling:resourceType",
additionalProperties.get("sling:resourceType") + "/list");
}
if (!properties.containsKey("sling:resourceSuperType") &&
additionalProperties.containsKey("sling:resourceSuperType")) {
- properties.put("sling:resourceSuperType",
additionalProperties.get("sling:resourceSuperType") +"/list");
+ properties.put("sling:resourceSuperType",
additionalProperties.get("sling:resourceSuperType") + "/list");
}
resource = new SimpleReadableResource(resourceResolver,
pathInfo.getResourcePath(), properties, adaptable);
}
- }
- else if (pathInfo.isMain()) {
+ } else if (pathInfo.isMain()) {
Map<String, Object> properties =
getMainResourceProperties(pathInfo.getMainResourceName());
if (properties != null) {
@@ -112,8 +111,7 @@ public abstract class AbstractReadableRe
resource = buildMainResource(resourceResolver, pathInfo,
properties, adaptable);
}
- }
- else if (pathInfo.isChild()) {
+ } else if (pathInfo.isChild()) {
Map<String, Object> mainProperties =
getMainResourceProperties(pathInfo.getMainResourceName());
Map<String, String> childProperties =
additionalResourcePropertiesMap.get(pathInfo.getChildResourceName());
@@ -138,13 +136,14 @@ public abstract class AbstractReadableRe
* Template: resourcePropertyName = "{osgiPropertyName}"
* Property: osgiPropertyName = osgiPropertyValue
* Result: resourcePropertyName = osgiPropertyValue
+ *
* @param properties
* @return
*/
protected Map<String, Object> bindMainResourceProperties(Map<String,
Object> properties) {
Map<String, Object> result = new HashMap<String, Object>();
- Map<String, String > resourcePropertyTemplates =
additionalResourcePropertiesMap.get(MAIN_RESOURCE_PREFIX);
+ Map<String, String> resourcePropertyTemplates =
additionalResourcePropertiesMap.get(MAIN_RESOURCE_PREFIX);
for (Map.Entry<String, String> propertyTemplateEntry :
resourcePropertyTemplates.entrySet()) {
String templateName = propertyTemplateEntry.getKey();
@@ -152,7 +151,7 @@ public abstract class AbstractReadableRe
Object propertyValue = templateValue;
if (templateValue.startsWith("{") && templateValue.endsWith("}")) {
- String propertyName = templateValue.substring(1,
templateValue.length()-1);
+ String propertyName = templateValue.substring(1,
templateValue.length() - 1);
propertyValue = properties.get(propertyName);
}
@@ -170,20 +169,21 @@ public abstract class AbstractReadableRe
* Template: resourcePropertyName = "{osgiPropertyName}"
* Property: resourcePropertyName = osgiPropertyValue
* Result: osgiPropertyName = osgiPropertyValue
+ *
* @param properties
* @return
*/
protected Map<String, Object> unbindMainResourceProperties(Map<String,
Object> properties) {
Map<String, Object> result = new HashMap<String, Object>();
- Map<String, String > resourcePropertyTemplates =
additionalResourcePropertiesMap.get(MAIN_RESOURCE_PREFIX);
+ Map<String, String> resourcePropertyTemplates =
additionalResourcePropertiesMap.get(MAIN_RESOURCE_PREFIX);
for (Map.Entry<String, String> propertyTemplateEntry :
resourcePropertyTemplates.entrySet()) {
String templateName = propertyTemplateEntry.getKey();
String templateValue = propertyTemplateEntry.getValue();
if (templateValue.startsWith("{") && templateValue.endsWith("}")) {
- String propertyName = templateValue.substring(1,
templateValue.length()-1);
+ String propertyName = templateValue.substring(1,
templateValue.length() - 1);
Object propertyValue = properties.get(templateName);
if (propertyValue != null) {
result.put(propertyName, propertyValue);
@@ -200,7 +200,7 @@ public abstract class AbstractReadableRe
return new SimpleReadableResource(resourceResolver,
pathInfo.getResourcePath(), properties, adapters);
}
- protected SimplePathInfo extractPathInfo(String path) {
+ protected SimplePathInfo extractPathInfo(String path) {
return SimplePathInfo.parsePathInfo(resourceRoot, path);
}
@@ -221,8 +221,8 @@ public abstract class AbstractReadableRe
}
- static <K,V> Map<String, Object> fixMap(Map<K, V> map) {
- Map<String, Object> result = new HashMap<String , Object>();
+ static <K, V> Map<String, Object> fixMap(Map<K, V> map) {
+ Map<String, Object> result = new HashMap<String, Object>();
for (Map.Entry<K, V> entry : map.entrySet()) {
K key = entry.getKey();
V value = entry.getValue();
@@ -261,5 +261,6 @@ public abstract class AbstractReadableRe
protected abstract Map<String, Object> getResourceProperties(String
resourceName);
+
protected abstract Map<String, Object> getResourceRootProperties();
}
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/SimplePathInfo.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/SimplePathInfo.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/SimplePathInfo.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/SimplePathInfo.java
Mon Sep 29 08:41:26 2014
@@ -23,9 +23,9 @@ package org.apache.sling.replication.res
* Path info representing a main resource.
* The requestPath = resourcePath + resourcePathInfo
* The identified resource can be of three types:
- * root - resourcePath = resourceRoot
- * main - resourcePath = resourceRoot + mainResourceName
- * child - resourcePath = resourceRoot + mainResourceName +
childResourceName
+ * root - resourcePath = resourceRoot
+ * main - resourcePath = resourceRoot + mainResourceName
+ * child - resourcePath = resourceRoot + mainResourceName + childResourceName
*/
public class SimplePathInfo {
@@ -68,14 +68,12 @@ public class SimplePathInfo {
return mainResourceName != null && childResourceName != null;
}
- public String getResourcePath() {
+ public String getResourcePath() {
if (isRoot()) {
return resourceRoot;
- }
- else if (isMain()) {
+ } else if (isMain()) {
return resourceRoot + "/" + mainResourceName;
- }
- else if (isChild()) {
+ } else if (isChild()) {
return resourceRoot + "/" + mainResourceName + "/" +
childResourceName;
}
@@ -91,15 +89,14 @@ public class SimplePathInfo {
String resourceName = null;
String resourcePathInfo = null;
- if(requestPath.startsWith(resourceRoot + "/")) {
- resourceName = requestPath.substring(resourceRoot.length()+1);
+ if (requestPath.startsWith(resourceRoot + "/")) {
+ resourceName = requestPath.substring(resourceRoot.length() + 1);
int idx = resourceName.indexOf(".");
if (idx >= 0) {
resourcePathInfo = resourceName.substring(idx);
resourceName = resourceName.substring(0, idx);
}
- }
- else {
+ } else {
int idx = requestPath.indexOf(".");
if (requestPath.contains(".")) {
resourcePathInfo = requestPath.substring(idx);
@@ -111,7 +108,7 @@ public class SimplePathInfo {
if (resourceName != null) {
int idx = resourceName.indexOf("/");
if (idx >= 0) {
- childResourceName = resourceName.substring(idx+1);
+ childResourceName = resourceName.substring(idx + 1);
resourceName = resourceName.substring(0, idx);
}
}
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/SimpleReadableResource.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/SimpleReadableResource.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/SimpleReadableResource.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/resources/impl/common/SimpleReadableResource.java
Mon Sep 29 08:41:26 2014
@@ -43,7 +43,7 @@ public class SimpleReadableResource exte
public SimpleReadableResource(ResourceResolver resourceResolver, String
resourcePath,
- Map<String, Object> properties, Object...
adapters) {
+ Map<String, Object> properties, Object...
adapters) {
this.resourceResolver = resourceResolver;
this.resourcePath = resourcePath;
@@ -58,7 +58,7 @@ public class SimpleReadableResource exte
public String getResourceType() {
// get resource type from data
final Object rt = this.properties.get("sling:resourceType");
- if ( rt != null ) {
+ if (rt != null) {
return rt.toString();
}
return "nt:unstructured";
@@ -67,7 +67,7 @@ public class SimpleReadableResource exte
public String getResourceSuperType() {
// get resource type from data
final Object rt = this.properties.get("sling:resourceSuperType");
- if ( rt != null ) {
+ if (rt != null) {
return rt.toString();
}
return "nt:unstructured";
@@ -91,8 +91,7 @@ public class SimpleReadableResource exte
if (type == ValueMap.class || type == Map.class) {
return (AdapterType) new ValueMapDecorator(getProperties());
- }
- else {
+ } else {
if (adapters != null) {
for (Object adapter : adapters) {
if (adapter == null) continue;
@@ -103,8 +102,7 @@ public class SimpleReadableResource exte
return convertArray(type, adapterArray);
}
- }
- else if (type.isAssignableFrom(adapter.getClass())) {
+ } else if (type.isAssignableFrom(adapter.getClass())) {
return (AdapterType) adapter;
}
}
@@ -114,13 +112,13 @@ public class SimpleReadableResource exte
}
- private <ArrayType> ArrayType convertArray(Class<ArrayType> arrayType,
Object[] array) {
+ private <ArrayType> ArrayType convertArray(Class<ArrayType> arrayType,
Object[] array) {
Object[] result = (Object[])
Array.newInstance(arrayType.getComponentType(), array.length);
- for (int i=0; i < array.length; i++) {
- if (array[i] != null &&
!arrayType.getComponentType().isAssignableFrom(array[i].getClass())) {
- return null;
- }
- result[i] = array[i];
+ for (int i = 0; i < array.length; i++) {
+ if (array[i] != null &&
!arrayType.getComponentType().isAssignableFrom(array[i].getClass())) {
+ return null;
+ }
+ result[i] = array[i];
}
return (ArrayType) result;
Modified:
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java
URL:
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java?rev=1628136&r1=1628135&r2=1628136&view=diff
==============================================================================
---
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java
(original)
+++
sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java
Mon Sep 29 08:41:26 2014
@@ -164,8 +164,6 @@ public class FileVaultReplicationPackage
}
-
-
@Override
public boolean installPackageInternal(ReplicationPackage
replicationPackage) throws ReplicationPackageReadingException {
log.debug("reading a replication package stream");