Package org.apache.sling.replication.queue

Examples of org.apache.sling.replication.queue.ReplicationQueueDistributionStrategy


            Map<String, Object> authorizationStrategyProperties = extractMap(COMPONENT_REQUEST_AUTHORIZATION_STRATEGY, properties);
            ReplicationRequestAuthorizationStrategy packageExporterStrategy = createAuthorizationStrategy(authorizationStrategyProperties, componentProvider);

            Map<String, Object> queueDistributionStrategyProperties = extractMap(COMPONENT_QUEUE_DISTRIBUTION_STRATEGY, properties);
            ReplicationQueueDistributionStrategy queueDistributionStrategy = createDistributionStrategy(queueDistributionStrategyProperties, componentProvider);

            Map<String, Object> queueProviderProperties = extractMap(COMPONENT_QUEUE_PROVIDER, properties);
            ReplicationQueueProvider queueProvider = createQueueProvider(queueProviderProperties, componentProvider);

            List<Map<String, Object>> triggersProperties = extractMapList(COMPONENT_TRIGGER, properties);
View Full Code Here


        String name = "sample-agent";
        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);
        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
        when(distributionHandler.add(any(String.class), any(ReplicationPackage.class), any(ReplicationQueueProvider.class))).thenReturn(false);
        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
        ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);

        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
                false, "serviceName", packageImporter,
View Full Code Here

        String name = "sample-agent";
        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);
        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
        ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);
        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
                false, "subServiceName", packageImporter,
                packageExporter, packageExporterStrategy,
                queueProvider,
                distributionHandler, replicationEventFactory, resolverFactory, null);
        ReplicationRequest request = new ReplicationRequest(System.nanoTime(),
                ReplicationActionType.ADD, "/");
        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
        ResourceResolver resourceResolver = mock(ResourceResolver.class);

        when(replicationPackage.getPaths()).thenReturn(new String[]{"/"});
        when(distributionHandler.add(any(String.class), any(ReplicationPackage.class), eq(queueProvider))).thenReturn(true);
        when(packageExporter.exportPackages(any(ResourceResolver.class), any(ReplicationRequest.class)))
                .thenReturn(Arrays.asList(replicationPackage));
        when(queueProvider.getDefaultQueue(name)).thenReturn(
                new SimpleReplicationQueue(name, "name"));
        ReplicationResponse response = agent.execute(resourceResolver, request);
View Full Code Here

        String name = "sample-agent";
        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);
        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
        ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);

        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
                false, "serviceName", packageImporter,
View Full Code Here

        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);

        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
        ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);

        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
                false, "serviceName", packageImporter,
View Full Code Here

        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);

        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
        ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);

        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
                false, "serviceName", packageImporter,
View Full Code Here

        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);

        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
        ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);

        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
                false, "serviceName", packageImporter,
View Full Code Here

TOP

Related Classes of org.apache.sling.replication.queue.ReplicationQueueDistributionStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.