Class Lock

  • All Implemented Interfaces:
    SqlEntity

    @Entity
    public class Lock
    extends java.lang.Object
    implements SqlEntity
    A lock on some shared resource.

    Locks are either specific to a tld or global to the entire system, in which case a tld of GLOBAL is used.

    This uses a compound primary key as defined in Lock.LockId.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Lock create​(java.lang.String resourceName, java.lang.String tld, java.lang.String requestLogId, org.joda.time.DateTime acquiredTime, org.joda.time.Duration leaseLength)
      Constructs a Lock object.
      static Lock createGlobal​(java.lang.String resourceName, java.lang.String requestLogId, org.joda.time.DateTime acquiredTime, org.joda.time.Duration leaseLength)
      Constructs a Lock object with a GLOBAL scope.
      java.util.Optional<DatastoreEntity> toDatastoreEntity()  
      • Methods inherited from class java.lang.Object

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

      • create

        public static Lock create​(java.lang.String resourceName,
                                  java.lang.String tld,
                                  java.lang.String requestLogId,
                                  org.joda.time.DateTime acquiredTime,
                                  org.joda.time.Duration leaseLength)
        Constructs a Lock object.
      • createGlobal

        public static Lock createGlobal​(java.lang.String resourceName,
                                        java.lang.String requestLogId,
                                        org.joda.time.DateTime acquiredTime,
                                        org.joda.time.Duration leaseLength)
        Constructs a Lock object with a GLOBAL scope.