Interface LockableResource

    • Method Detail

      • lock

        LockResult lock​(LockTimeout timeout,
                        LockInfo lockInfo)
                 throws io.milton.http.exceptions.NotAuthorizedException,
                        io.milton.http.exceptions.PreConditionFailedException,
                        io.milton.http.exceptions.LockedException
        Lock this resource and return a token
        Parameters:
        timeout - - in seconds, or null
        lockInfo -
        Returns:
        - a result containing the token representing the lock if succesful, otherwise a failure reason code
        Throws:
        io.milton.http.exceptions.NotAuthorizedException
        io.milton.http.exceptions.PreConditionFailedException
        io.milton.http.exceptions.LockedException
      • refreshLock

        LockResult refreshLock​(String token)
                        throws io.milton.http.exceptions.NotAuthorizedException,
                               io.milton.http.exceptions.PreConditionFailedException
        Renew the lock and return new lock info
        Parameters:
        token -
        Returns:
        Throws:
        io.milton.http.exceptions.NotAuthorizedException
        io.milton.http.exceptions.PreConditionFailedException
      • unlock

        void unlock​(String tokenId)
             throws io.milton.http.exceptions.NotAuthorizedException,
                    io.milton.http.exceptions.PreConditionFailedException
        If the resource is currently locked, and the tokenId matches the current one, unlock the resource
        Parameters:
        tokenId -
        Throws:
        io.milton.http.exceptions.NotAuthorizedException
        io.milton.http.exceptions.PreConditionFailedException
      • getCurrentLock

        LockToken getCurrentLock()
        Returns:
        - the current lock, if the resource is locked, or null