com.day.cq.wcm.api.msm
Interface LiveRelationshipManager


public interface LiveRelationshipManager


Method Summary
 void cancelRelationship(org.apache.sling.api.resource.ResourceResolver resolver, LiveRelationship relation, boolean deep)
          Cancel the relationship of the given relation.
 Map<String,LiveCopy> getLiveCopies()
          Returns all live copies.
 LiveCopy getLiveCopy(org.apache.sling.api.resource.Resource target)
          Returns the closest Live Copy corresponding the target resource.
 LiveRelationship getLiveRelationship(org.apache.sling.api.resource.Resource target, boolean advancedStatus)
          Returns a live relationship of the given livecopy sync resource.
 Collection<LiveRelationship> getLiveRelationships(Page source, RolloutManager.Trigger trigger, String[] targets, boolean advancedStatus)
          Returns a collection of live relationships of the given livecopy source page to its targets.
 Collection<LiveRelationship> getLiveRelationships(org.apache.sling.api.resource.Resource source, RolloutManager.Trigger trigger, String[] targets, boolean advancedStatus)
          Returns a collection of live relationships of the given livecopy source resource to its targets.
 boolean isInBlueprint(org.apache.sling.api.resource.Resource source)
          Checks if the given source is in a blueprint tree.
 boolean isLiveCopy(org.apache.sling.api.resource.Resource target)
          Checks if the given sync target is part of a Live Copy relationship.
 boolean isSource(org.apache.sling.api.resource.Resource resource)
          Checks if the given source is the source of a Live Copy relationship.
 void reenableRelationship(org.apache.sling.api.resource.ResourceResolver resolver, LiveRelationship relation)
          Reenable the relationship of a canceled one.
 void toggleRelationship(org.apache.sling.api.resource.ResourceResolver resolver, LiveRelationship relation, boolean deep)
          Cancels or reenables the relationship based on the relation status.
 

Method Detail

getLiveCopies

Map<String,LiveCopy> getLiveCopies()
Returns all live copies. the Live Copy path is used as key of the map.

Returns:
all live copies.

getLiveCopy

LiveCopy getLiveCopy(org.apache.sling.api.resource.Resource target)
Returns the closest Live Copy corresponding the target resource.

Parameters:
target - resource
Returns:
Live Copy or null if no Live Copy found.

getLiveRelationships

Collection<LiveRelationship> getLiveRelationships(Page source,
                                                  RolloutManager.Trigger trigger,
                                                  String[] targets,
                                                  boolean advancedStatus)
                                                  throws WCMException
Returns a collection of live relationships of the given livecopy source page to its targets. The search can be limited by trigger or target by specifying the respective parameters. The given source page does not need to be a livecopy root.

Parameters:
source - source page
trigger - filter for triggers
targets - filter for targets
advancedStatus - True if advanced status (time consuming) must be computed for relationships
Returns:
the relationships
Throws:
WCMException - if an error occurrs

getLiveRelationships

Collection<LiveRelationship> getLiveRelationships(org.apache.sling.api.resource.Resource source,
                                                  RolloutManager.Trigger trigger,
                                                  String[] targets,
                                                  boolean advancedStatus)
                                                  throws WCMException
Returns a collection of live relationships of the given livecopy source resource to its targets. The search can be limited by trigger or target by specifying the respective parameters. The given source resource does not need to be a livecopy root.

Parameters:
source - resource
trigger - filter for triggers
targets - filter for targets
advancedStatus - True if advanced status (time consuming) must be computed for relationships
Returns:
the relationships
Throws:
WCMException - if an error occurrs

getLiveRelationship

LiveRelationship getLiveRelationship(org.apache.sling.api.resource.Resource target,
                                     boolean advancedStatus)
                                     throws WCMException
Returns a live relationship of the given livecopy sync resource.

Parameters:
target - the livecopy sync resource
advancedStatus - True if advanced status (time consuming) must be computed for relationship
Returns:
the relationship or null if the resource is not a livecopy
Throws:
WCMException - if an error occurrs

isLiveCopy

boolean isLiveCopy(org.apache.sling.api.resource.Resource target)
Checks if the given sync target is part of a Live Copy relationship.

Parameters:
target - the resource to check
Returns:
true if the resource is live synced

isInBlueprint

boolean isInBlueprint(org.apache.sling.api.resource.Resource source)
Checks if the given source is in a blueprint tree.

Parameters:
source - the resource to check
Returns:
true if the resource is a blueprint

isSource

boolean isSource(org.apache.sling.api.resource.Resource resource)
Checks if the given source is the source of a Live Copy relationship.

Parameters:
resource - the resource to check
Returns:
true if the resource is a blueprint

cancelRelationship

void cancelRelationship(org.apache.sling.api.resource.ResourceResolver resolver,
                        LiveRelationship relation,
                        boolean deep)
                        throws WCMException
Cancel the relationship of the given relation.

Parameters:
resolver - resource resolver
relation - relation
deep - if true all child relations are canceled, too
Throws:
WCMException - if an error occurrs

reenableRelationship

void reenableRelationship(org.apache.sling.api.resource.ResourceResolver resolver,
                          LiveRelationship relation)
                          throws WCMException
Reenable the relationship of a canceled one.

Parameters:
resolver - resource resolver
relation - relation to re-enable
Throws:
WCMException - if an error occurrs

toggleRelationship

void toggleRelationship(org.apache.sling.api.resource.ResourceResolver resolver,
                        LiveRelationship relation,
                        boolean deep)
                        throws WCMException
Cancels or reenables the relationship based on the relation status.

Parameters:
resolver - resource resolver
relation - relation to toggle
deep - if true all child relations will be cancelled, too
Throws:
WCMException - if an error occurrs


Copyright © 2009 Day Management AG. All Rights Reserved.