com.ibm.commerce.context.content.locking

Class SingleUserLockingPolicy

  • java.lang.Object
    • com.ibm.commerce.context.content.locking.SingleUserLockingPolicy
  • All Implemented Interfaces:
    LockingPolicy


    public class SingleUserLockingPolicy
    extends java.lang.Object
    implements LockingPolicy
    This class defines a locking policy that only allows one particular user to modify the resource at a particular time. If any other user requests to modify the resource, the locking policy will not allow them to do so.
    • Constructor Summary

      Constructors 
      Constructor and Description
      SingleUserLockingPolicy()
      This is the default constructor for this class.
    • Constructor Detail

      • SingleUserLockingPolicy

        public SingleUserLockingPolicy()
        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 indicates whether the current member of the activity is allowed to modify the resource.
        Specified by:
        canActivityModifyManagedResource in interface LockingPolicy
        Parameters:
        activityToken - The current activity.
        lockData - The lock data of the resource.
        Returns:
        This method returns whether the current activity can modify the resource.
      • isManagedResourcedLocked

        public boolean isManagedResourcedLocked(LockData managedResourceLockData,
                                                LockData environmentLockData)
        This method indicates whether the current member of the activity is allowed to modify the resource. The member identifier used for the comparison is the run as member identifier.
        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 current member associated with the managed resource lock is the same as the member associated with the environment lock data.