Interface Transaction


  • public interface Transaction
    The Fedora Transaction abstraction
    Author:
    mohideen
    • Method Detail

      • commit

        void commit()
        Commit the transaction
      • commitIfShortLived

        void commitIfShortLived()
        Commit the transaction only if the transaction is shortLived
      • isCommitted

        boolean isCommitted()
        Returns:
        returns true if this transaction has already been committed
      • rollback

        void rollback()
        Rollback the transaction
      • isRolledBack

        boolean isRolledBack()
        Returns:
        true if this transaction has been rolled back
      • getId

        String getId()
        Get the transaction id
        Returns:
        the transaction id.
      • isShortLived

        boolean isShortLived()
        Check if the transaction is short-lived.
        Returns:
        is the transaction short-lived.
      • setShortLived

        void setShortLived​(boolean shortLived)
        Set transaction short-lived state.
        Parameters:
        shortLived - boolean true (short-lived) or false (not short-lived)
      • expire

        void expire()
        Expire a transaction
      • hasExpired

        boolean hasExpired()
        Has the transaction expired?
      • updateExpiry

        Instant updateExpiry​(Duration amountToAdd)
        Update the expiry by the provided amount
        Parameters:
        amountToAdd - the amount of time to add
        Returns:
        the new expiration date
      • getExpires

        Instant getExpires()
        Get the date this session expires
        Returns:
        expiration date, if one exists
      • refresh

        void refresh()
        Refresh the transaction to extend its expiration window.
      • setBaseUri

        void setBaseUri​(String baseUri)
        Sets the baseUri on the transaction
        Parameters:
        baseUri - the baseUri of the requests
      • setUserAgent

        void setUserAgent​(String userAgent)
        Sets the user-agent on the transaction
        Parameters:
        userAgent - the request's user-agent