Interface ReplicationStatusManager


  • @ProviderType
    public interface ReplicationStatusManager
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  ReplicationStatusManager.Status
      Replication Status Enum ACTIVATED: Marks resource as "Activated" DEACTIVATED: Marks resource as "Deactivated" CLEAR: Removes Replication status properties from Resource along with cq:ReplicationStatus mixin when applicable.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clearReplicationStatus​(org.apache.sling.api.resource.ResourceResolver resourceResolver, org.apache.sling.api.resource.Resource... resources)
      Clear the replication status from the provides resources Only resources that are of the OSGi Property parameterized "node-types" are candidates for Replication Status updates.
      org.apache.sling.api.resource.Resource getReplicationStatusResource​(String path, org.apache.sling.api.resource.ResourceResolver resourceResolver)
      Returns the Resource responsible for tracking replication properties for a given path.
      void setReplicationStatus​(org.apache.sling.api.resource.ResourceResolver resourceResolver, String replicatedBy, Calendar replicatedAt, ReplicationStatusManager.Status status, String... paths)
      Marks the resources at the provides paths with the parameterized replication status.
      void setReplicationStatus​(org.apache.sling.api.resource.ResourceResolver resourceResolver, String replicatedBy, Calendar replicatedAt, ReplicationStatusManager.Status status, org.apache.sling.api.resource.Resource... resources)
      Marks the resources at the provides paths with the parameterized replication status.
    • Method Detail

      • getReplicationStatusResource

        org.apache.sling.api.resource.Resource getReplicationStatusResource​(String path,
                                                                            org.apache.sling.api.resource.ResourceResolver resourceResolver)
        Returns the Resource responsible for tracking replication properties for a given path.

        Pages and Assets return their respective content resource while any other path returns itself

        Parameters:
        path - The path to retrieve the resource for.
        resourceResolver - The resource resolver must have access to read the specified path.
      • setReplicationStatus

        void setReplicationStatus​(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                  String replicatedBy,
                                  Calendar replicatedAt,
                                  ReplicationStatusManager.Status status,
                                  String... paths)
                           throws javax.jcr.RepositoryException,
                                  org.apache.sling.api.resource.PersistenceException
        Marks the resources at the provides paths with the parameterized replication status.

        Only resources that are of the OSGi Property parameterized "node-types" are candidates for Replication Status updates. All other resources will be quietly skipped.

        Parameters:
        resourceResolver - The resource resolver must have access to modify all of target resources.
        replicatedBy - name to set the last replicated property to. If value is null then a value of "Unknown" is used.
        replicatedAt - date to set the last replicated date to. If value is null then the current time is used.
        status - ACTIVATE | DEACTIVATE | CLEAR (Clear removes all replication properties and the cq:ReplicationStatus mixin when possible)
        paths - The paths to update.
        Throws:
        javax.jcr.RepositoryException
        org.apache.sling.api.resource.PersistenceException
      • setReplicationStatus

        void setReplicationStatus​(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                  String replicatedBy,
                                  Calendar replicatedAt,
                                  ReplicationStatusManager.Status status,
                                  org.apache.sling.api.resource.Resource... resources)
                           throws javax.jcr.RepositoryException,
                                  org.apache.sling.api.resource.PersistenceException
        Marks the resources at the provides paths with the parameterized replication status.

        Only resources that are of the OSGi Property parameterized "node-types" are candidates for Replication Status updates. All other resources will be quietly skipped.

        Parameters:
        resourceResolver - The resource resolver must have access to modify all of target resources.
        replicatedBy - name to set the last replicated property to. If value is null then a value of "Unknown" is used.
        replicatedAt - date to set the last replicated date to. If value is null then the current time is used.
        status - ACTIVATE | DEACTIVATE | CLEAR (Clear removes all replication properties and the cq:ReplicationStatus mixin when possible)
        resources - The resources to update.
        Throws:
        javax.jcr.RepositoryException
        org.apache.sling.api.resource.PersistenceException
      • clearReplicationStatus

        void clearReplicationStatus​(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                    org.apache.sling.api.resource.Resource... resources)
                             throws javax.jcr.RepositoryException,
                                    org.apache.sling.api.resource.PersistenceException
        Clear the replication status from the provides resources Only resources that are of the OSGi Property parameterized "node-types" are candidates for Replication Status updates. All other resources will be quietly skipped.
        Parameters:
        resourceResolver - The resource resolver must have access to modify all of target resources.
        resources - The resources to update.
        Throws:
        javax.jcr.RepositoryException
        org.apache.sling.api.resource.PersistenceException