Class AbstractStoreCommand

    • Constructor Detail

      • AbstractStoreCommand

        public AbstractStoreCommand​(Element oldElement,
                                    Element newElement)
        Create a Store Command
        Parameters:
        oldElement - the element in the underlying store at the time this command is created
        newElement - the new element to put in the underlying store
    • Method Detail

      • getOldElement

        protected Element getOldElement()
        Get the element in the underlying store at the time this command is created
        Returns:
        the old element
      • getNewElement

        protected Element getNewElement()
        Get the new element to put in the underlying store
        Returns:
        the new element to put in the underlying store
      • prepare

        public boolean prepare​(Store store,
                               SoftLockManager softLockManager,
                               XidTransactionID transactionId,
                               ElementValueComparator comparator)
        Prepare the commmand un the underlying store
        Specified by:
        prepare in interface Command
        Parameters:
        store - the underdyling store
        softLockManager - the soft lock manager
        transactionId - the transaction ID
        comparator - the element value comparator
        Returns:
        true if prepare updated the store, false otherwise
      • rollback

        public void rollback​(Store store,
                             SoftLockManager softLockManager)
        Rollback the prepared change
        Specified by:
        rollback in interface Command
        Parameters:
        store - the underlying store
        softLockManager - the soft lock manager