Class SqlLeaseContext

  • All Implemented Interfaces:
    org.eclipse.dataspaceconnector.spi.persistence.LeaseContext

    public class SqlLeaseContext
    extends java.lang.Object
    implements org.eclipse.dataspaceconnector.spi.persistence.LeaseContext
    SQL-based implementation of the LeaseContext. Acquiring a lease is implemented by adding an entry into the "lease" table in the database Breaking a lease is implemented by deleting the respective entry
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void acquireLease​(java.lang.String entityId)  
      void breakLease​(java.lang.String entityId)  
      @Nullable SqlLease getLease​(java.lang.String entityId)
      Fetches a lease for a particular entity
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • breakLease

        public void breakLease​(java.lang.String entityId)
        Specified by:
        breakLease in interface org.eclipse.dataspaceconnector.spi.persistence.LeaseContext
      • acquireLease

        public void acquireLease​(java.lang.String entityId)
        Specified by:
        acquireLease in interface org.eclipse.dataspaceconnector.spi.persistence.LeaseContext
      • getLease

        @Nullable
        public @Nullable SqlLease getLease​(java.lang.String entityId)
        Fetches a lease for a particular entity
        Parameters:
        entityId - The leased entity's ID (NOT the leaseID!)
        Returns:
        The respective lease, or null of entity is not leased.