com.ibm.commerce.context.content.locking

Class WorkspaceLockingPolicy

  • java.lang.Object
    • com.ibm.commerce.context.content.locking.WorkspaceLockingPolicy
  • All Implemented Interfaces:
    LockingPolicy
    Direct Known Subclasses:
    TaskGroupLockingPolicy


    public class WorkspaceLockingPolicy
    extends java.lang.Object
    implements LockingPolicy
    This class defines a workspace locking policy for content management. This policy allows any resource to be modified only if the current workspace matches the workspace that has previously modified the resource.
    • Constructor Summary

      Constructors 
      Constructor and Description
      WorkspaceLockingPolicy()
      This is the default constructor for this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean canActivityModifyManagedResource(ActivityToken activityToken, LockData lockData)
      This method allows the resource to be modified only if the current workspace of the content context matches the specified workspace.
      boolean isManagedResourcedLocked(LockData managedResourceLockData, LockData environmentLockData)
      This method allows the resource to be modified only if the current workspace of the content context matches the specified workspace.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WorkspaceLockingPolicy

        public WorkspaceLockingPolicy()
        This is the default constructor for this class. It calls the constructor from the superclass.
    • Method Detail

      • canActivityModifyManagedResource

        public boolean canActivityModifyManagedResource(ActivityToken activityToken,
                                                        LockData lockData)
        This method allows the resource to be modified only if the current workspace of the content context matches the specified workspace. This is done by calling the method canCurrentContextModifyResource(). This is passed to the current content and task context to determine whether the managed resource can be modified by the current activity.
        Specified by:
        canActivityModifyManagedResource in interface LockingPolicy
        Parameters:
        activityToken - The current activity.
        lockData - The lock data of the resource.
        Returns:
        This method returns whether the content context workspace matches the specified workspace.
      • isManagedResourcedLocked

        public boolean isManagedResourcedLocked(LockData managedResourceLockData,
                                                LockData environmentLockData)
        This method allows the resource to be modified only if the current workspace of the content context matches the specified workspace.
        Specified by:
        isManagedResourcedLocked in interface LockingPolicy
        Parameters:
        managedResourceLockData - The current lock data associated with the managed resource.
        environmentLockData - The lock data representation of the environment associated with the current operation.
        Returns:
        This method returns whether the managed resource lock data workspace differs from the environment. If so, the resource is considered to be locked.