AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Replication Api

skill-adobe-skills-replication-api · by adobe

Use the AEM 6.5 LTS Replication API for programmatic content activation, deactivation, and replication status management

No reviews yet
0 installs
24 views
0.0% view→install

Install

$ agentstack add skill-adobe-skills-replication-api

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-adobe-skills-replication-api)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Replication Api? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

AEM 6.5 LTS Replication API

This skill provides comprehensive guidance on using the official Adobe Experience Manager 6.5 LTS Replication API for programmatic replication operations. The API enables custom code to activate, deactivate, and manage content distribution workflows.

When to Use This Skill

Use this skill when you need to:

  • Programmatically activate/deactivate content from custom code
  • Build custom replication workflows in OSGi services or servlets
  • Integrate replication with external systems
  • Implement custom replication triggers and automation
  • Check replication status in application logic
  • Create custom content distribution tools
  • Bulk replicate content via scripts
  • Implement conditional replication logic

Prerequisites

  • AEM 6.5 LTS environment with configured replication agents
  • Java development environment for AEM
  • Maven project with AEM dependencies
  • Understanding of OSGi services and Sling ResourceResolver
  • Configured replication agents (see configure-replication-agent skill)
  • Service user or user session with replication permissions

Official API Documentation

All public replication APIs are documented in the official Adobe AEM 6.5 LTS JavaDoc:

Core API Components

1. Replicator Interface

The primary service for managing replication operations.

Service Type: OSGi Service Package: com.day.cq.replication Interface: com.day.cq.replication.Replicator

2. ReplicationActionType Enum

Defines the type of replication operation:

| Type | Purpose | Effect | |------|---------|--------| | ACTIVATE | Publish content | Sends to Publish instances | | DEACTIVATE | Unpublish content | Removes from Publish | | DELETE | Delete from Publish | Permanent removal | | TEST | Test replication | Verifies connectivity | | REVERSE | Reverse replicate | Publish → Author | | INTERNAL_POLL | Internal polling | System use |

3. ReplicationOptions Class

Encapsulates optional parameters for replication requests.

4. ReplicationStatus Interface

Provides status information about replicated content.

Maven Dependencies

The Replication API is provided by the AEM uber-jar. Add to your pom.xml:


    com.adobe.aem
    uber-jar
    apis
    provided

The uber-jar version should match your AEM 6.5 LTS installation. The Replication API (com.day.cq.replication.*) is included in the uber-jar and available at runtime.

Replicator Interface Methods

Method 1: replicate(Session, ReplicationActionType, String)

Signature:

void replicate(Session session, 
               ReplicationActionType type, 
               String path) 
throws ReplicationException

Parameters:

  • session - JCR session (user permissions determine access)
  • type - ReplicationActionType (ACTIVATE, DEACTIVATE, DELETE, etc.)
  • path - Content path to replicate (e.g., "/content/mysite/en/page")

Throws: ReplicationException if replication fails

Description: Triggers replication for a single path with default options.

Example:

import com.day.cq.replication.Replicator;
import com.day.cq.replication.ReplicationActionType;
import com.day.cq.replication.ReplicationException;
import org.apache.sling.api.resource.ResourceResolver;
import org.osgi.service.component.annotations.Reference;

import javax.jcr.Session;

@Reference
private Replicator replicator;

public void activatePage(ResourceResolver resolver, String pagePath) 
    throws ReplicationException {
    Session session = resolver.adaptTo(Session.class);
    if (session == null) {
        throw new IllegalStateException("Unable to adapt ResourceResolver to Session");
    }
    replicator.replicate(session, ReplicationActionType.ACTIVATE, pagePath);
}

Method 2: replicate(Session, ReplicationActionType, String, ReplicationOptions)

Signature:

void replicate(Session session, 
               ReplicationActionType type, 
               String path,
               ReplicationOptions options) 
throws ReplicationException

Parameters:

  • session - JCR session
  • type - ReplicationActionType
  • path - Content path
  • options - ReplicationOptions for custom configuration

Description: Initiates replication with customizable options for one path.

Example:

import com.day.cq.replication.ReplicationActionType;
import com.day.cq.replication.ReplicationException;
import com.day.cq.replication.ReplicationOptions;
import org.apache.sling.api.resource.ResourceResolver;

import javax.jcr.Session;

public void activatePageSync(ResourceResolver resolver, String pagePath) 
    throws ReplicationException {
    Session session = resolver.adaptTo(Session.class);
    if (session == null) {
        throw new IllegalStateException("Unable to adapt ResourceResolver to Session");
    }
    
    ReplicationOptions opts = new ReplicationOptions();
    opts.setSynchronous(true); // Wait for completion
    opts.setSuppressVersions(true); // Don't create versions
    
    replicator.replicate(session, ReplicationActionType.ACTIVATE, pagePath, opts);
}

Method 3: replicate(Session, ReplicationActionType, String[], ReplicationOptions)

Signature:

void replicate(Session session, 
               ReplicationActionType type, 
               String[] paths,
               ReplicationOptions options) 
throws ReplicationException

Parameters:

  • session - JCR session
  • type - ReplicationActionType
  • paths - Array of content paths (String[])
  • options - ReplicationOptions

Description: Handles replication across multiple paths with supplied settings.

Example:

import com.day.cq.replication.ReplicationActionType;
import com.day.cq.replication.ReplicationException;
import com.day.cq.replication.ReplicationOptions;
import org.apache.sling.api.resource.ResourceResolver;

import javax.jcr.Session;

public void activateMultiplePages(ResourceResolver resolver, String[] pagePaths) 
    throws ReplicationException {
    Session session = resolver.adaptTo(Session.class);
    if (session == null) {
        throw new IllegalStateException("Unable to adapt ResourceResolver to Session");
    }
    
    ReplicationOptions opts = new ReplicationOptions();
    opts.setSynchronous(false); // Async for better performance
    
    replicator.replicate(session, ReplicationActionType.ACTIVATE, pagePaths, opts);
}

Method 4: checkPermission(Session, ReplicationActionType, String)

Signature:

void checkPermission(Session session, 
                     ReplicationActionType type, 
                     String path) 
throws ReplicationException

Parameters:

  • session - JCR session
  • type - ReplicationActionType
  • path - Content path

Throws: ReplicationException if user lacks permissions

Description: Verifies whether a user has sufficient permissions for replication activities.

Example:

import com.day.cq.replication.ReplicationActionType;
import com.day.cq.replication.ReplicationException;
import org.apache.sling.api.resource.ResourceResolver;

import javax.jcr.Session;

public boolean canUserActivate(ResourceResolver resolver, String pagePath) {
    Session session = resolver.adaptTo(Session.class);
    if (session == null) {
        throw new IllegalStateException("Unable to adapt ResourceResolver to Session");
    }
    try {
        replicator.checkPermission(session, ReplicationActionType.ACTIVATE, pagePath);
        return true; // User has permission
    } catch (ReplicationException e) {
        return false; // User lacks permission
    }
}

Method 5: getReplicationStatus(Session, String)

Signature:

ReplicationStatus getReplicationStatus(Session session, String path)

Parameters:

  • session - JCR session
  • path - Content path

Returns: ReplicationStatus object or null if unavailable

Description: Retrieves the replication status for a given path.

Example:

import com.day.cq.replication.ReplicationStatus;
import org.apache.sling.api.resource.ResourceResolver;

import javax.jcr.Session;
import java.util.Calendar;

public ReplicationInfo getPageReplicationInfo(ResourceResolver resolver, String pagePath) {
    Session session = resolver.adaptTo(Session.class);
    if (session == null) {
        throw new IllegalStateException("Unable to adapt ResourceResolver to Session");
    }
    ReplicationStatus status = replicator.getReplicationStatus(session, pagePath);
    
    if (status != null) {
        boolean isActivated = status.isActivated();
        Calendar lastPublished = status.getLastPublished();
        String lastPublishedBy = status.getLastPublishedBy();
        
        return new ReplicationInfo(isActivated, lastPublished, lastPublishedBy);
    }
    return null;
}

Method 6: getActivatedPaths(Session, String)

Signature:

Iterator getActivatedPaths(Session session, String path) 
throws ReplicationException

Parameters:

  • session - JCR session
  • path - Root path for subtree

Returns: Iterator of activated paths

Throws: ReplicationException

Description: Returns paths of all activated nodes for the given subtree path.

Example:

import com.day.cq.replication.ReplicationException;
import org.apache.sling.api.resource.ResourceResolver;

import javax.jcr.Session;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public List getActivatedPages(ResourceResolver resolver, String rootPath) 
    throws ReplicationException {
    Session session = resolver.adaptTo(Session.class);
    if (session == null) {
        throw new IllegalStateException("Unable to adapt ResourceResolver to Session");
    }
    Iterator activatedPaths = replicator.getActivatedPaths(session, rootPath);
    
    List result = new ArrayList<>();
    while (activatedPaths.hasNext()) {
        result.add(activatedPaths.next());
    }
    return result;
}

ReplicationOptions Class

Encapsulates optional configuration parameters for replication requests.

Official Documentation: ReplicationOptions JavaDoc

Key Methods:

setSynchronous(boolean)

Description: Controls whether replication executes synchronously (blocking) or asynchronously (default).

Parameters:

  • synchronous - true for synchronous, false for asynchronous (default)

Example:

ReplicationOptions opts = new ReplicationOptions();
opts.setSynchronous(true); // Wait for replication to complete

Use cases:

  • Synchronous: When you need confirmation before proceeding (e.g., before redirecting user)
  • Asynchronous: Better performance for bulk operations

Thread-Blocking Implications:

When setSynchronous(true) is used, the calling thread blocks until replication completes across all target agents. This has important implications:

  • UI Performance: In servlets or sling models rendering pages, synchronous replication blocks the HTTP request thread. For large content or slow networks, this can cause noticeable page load delays or request timeouts.
  • Thread Pool Exhaustion: High-traffic scenarios with synchronous replication can exhaust the servlet container's request thread pool, causing cascading failures.
  • Recommended Pattern: Use asynchronous replication (false, the default) for user-facing operations. Reserve synchronous mode for background jobs, workflow steps, or cases where immediate confirmation is critical for correctness (e.g., transactional workflows).

Performance Comparison:

  • Asynchronous: Request returns immediately after queueing (~10-50ms)
  • Synchronous: Request waits for full replication cycle (500ms-5s typical, longer for large assets or network delays)
setFilter(AgentFilter)

Description: Sets the filter for selecting specific agents for replication.

Parameters:

  • filter - AgentFilter implementation

Example:

import com.day.cq.replication.AgentFilter;
import com.day.cq.replication.Agent;

ReplicationOptions opts = new ReplicationOptions();

// Filter to specific agent
opts.setFilter(new AgentFilter() {
    public boolean isIncluded(Agent agent) {
        return agent.getId().equals("publish_instance_1");
    }
});

replicator.replicate(session, ReplicationActionType.ACTIVATE, pagePath, opts);

Use cases:

  • Target specific publish instance
  • Exclude certain agents
  • Route content to specific environments
setSuppressVersions(boolean)

Description: Controls whether to create versions during replication.

Parameters:

  • suppress - true to skip version creation, false otherwise

Example:

ReplicationOptions opts = new ReplicationOptions();
opts.setSuppressVersions(true); // Don't create versions (performance)
setSuppressStatusUpdate(boolean)

Description: Controls whether to update replication status.

Parameters:

  • suppress - true to skip status update, false

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

  • Author: adobe
  • Source: adobe/skills
  • License: Apache-2.0
  • Homepage: https://www.adobe.com/ai/overview.html

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.