Interface LiveCopy


  • public interface LiveCopy
    Defines a Live Copy configuration between a blueprint and its target. It can be seen as a configuration for a LiveRelationship
    • Method Detail

      • getPath

        java.lang.String getPath()
        Returns the path of the Live Copy For example: "/content/copy"
        Returns:
        livecopy path
      • getBlueprintPath

        java.lang.String getBlueprintPath()
        Returns the blueprint path of this Live Copy. For example: "/content/geometrixx"
        Returns:
        the blueprint path
      • isDeep

        boolean isDeep()
        Returns if the Live Copy is deep
        Returns:
        true if deep
      • isRoot

        boolean isRoot()
        Returns if the Live Copy is the root of a Live Copy tree
        Returns:
        true if root
      • getRolloutConfigs

        java.util.List<RolloutConfig> getRolloutConfigs​(RolloutManager.Trigger trigger)
        Returns the list of RolloutConfig attached to the current LiveCopy filtered by the specified trigger.
        Parameters:
        trigger - list is filtered with this trigger
        Returns:
        the list or an empty list if no RolloutConfig
      • isTrigger

        boolean isTrigger​(RolloutManager.Trigger trigger)
        Returns if the current LiveCopy contains at least one RolloutConfig with the specified trigger.
        Parameters:
        trigger - the trigger to check
        Returns:
        true if at least one config as specified trigger, false otherwise.
      • addExclusion

        boolean addExclusion​(java.lang.String relativePath)
        A LiveCopy can be effective on its Resource or any ancestor of it, if set to be deep, as by isDeep. This methods allows to omit ancestor Resources from the LiveCopy's Blueprint to be part of the LiveRelationship.

        There will be no immediate change to the Content of the LiveCopy, the change only become effective upon the next roll-out If the Resource already exists in the LiveCopy, it will no longer receive updates. The LiveRelationshipManager.hasLiveRelationship(org.apache.sling.api.resource.Resource) will resolve to false, even if the Resource once has been created in a Roll-out process

        The exclusion is always effective on the Resource denoted by the path and all its descendants.

        Parameters:
        relativePath - paths relative to the LiveCopy's path that are should not be part of LiveRelationShip.
        Returns:
        true in case the given Path has been contained before
      • removeExclusion

        boolean removeExclusion​(java.lang.String relativePath)
        Add back the Blueprint Resource at the given path to be part of the LiveRelationship defined by this LiveCopy. There will be no immediate change to the Content of the LiveCopy, the change only becomes effective upon the next roll-out
        Parameters:
        relativePath - path relative to the LiveCopy's path that should take part in inheritance again
        Returns:
        true in case the path has been excluded before
        See Also:
        addExclusion(String)
      • contains

        boolean contains​(java.lang.String absPath)
        Check if the given Path is covered by this LiveCopy. Eg if LiveCopy is deep and the given path is descendant of this LiveCopy's path. And it is NOT part of the exclusion-list
        Parameters:
        absPath - the path to be considered, true if LiveCopy is deep and the path is not excluded or LiveCopy is not deep and path is equal to the LiveCopy's path
        Returns:
        true in case the given absolute path matches the LiveCopy's configuration. Generally speaking, is a descendant of the LiveCopy's path and not excluded.
      • getExclusions

        java.util.Set<java.lang.String> getExclusions()
        All relative paths that have been set to be excluded from the LiveCopy by use of addExclusion(String). This means for example that a shallow LiveCopy will return an empty Set though it does not include any other path than the LiveCopy's.
        Returns:
        all relative paths that are explicitly excluded. The returned Set is NOT backed by the the LiveCopy nor will changes to the Set written back to the LiveCopy
        See Also:
        addExclusion(String)