Class AdminCommandLock


  • @Service
    @Singleton
    public class AdminCommandLock
    extends Object
    The implementation of the admin command lock.
    Author:
    Bill Shannon, Chris Kasso
    • Constructor Detail

      • AdminCommandLock

        public AdminCommandLock()
    • Method Detail

      • getLock

        public Lock getLock​(CommandLock.LockType type)
        Return the appropriate Lock object for the specified LockType. The returned lock has not been locked. If the LockType is not SHARED or EXCLUSIVE null is returned.
        Parameters:
        type - the LockType
        Returns:
        the Lock object to use, or null
      • dumpState

        public void dumpState​(Logger logger,
                              Level level)
      • getLock

        public Lock getLock​(AdminCommand command)
        Return the appropriate Lock object for the specified command. The returned lock has not been locked. If this command needs no lock, null is returned.
        Parameters:
        command - the AdminCommand object
        Returns:
        the Lock object to use, or null if no lock needed
      • getLockOwner

        public String getLockOwner()
        Get the admin user id for the user who acquired the exclusive lock. This does not imply the lock is still held.
        Returns:
        the admin user who acquired the lock
      • getLockTimeOfAcquisition

        public Date getLockTimeOfAcquisition()
        Get the time the exclusive lock was acquired. This does not imply the lock is still held.
        Returns:
        the time the lock was acquired