boolean keepAlive(final ClusterLockKey clusterLockKey) {
        if (!securityContext.isProcessingUser()) {
            throw new PermissionException(securityContext.getUserRef(),
                    "Only the processing user is allowed to keep a cluster lock alive");
        }

        boolean success = false;

        try {
            final String lockName = clusterLockKey.getName();
            final Lock currentLock = lockMap.get(lockName);
            // We should know about a lock that a node is trying to keep alive,
            // but it is possible due to the asynchronous nature of server calls
            // that the owner has already released the lock.
            if (currentLock != null) {
                // Only refresh the lock if it is the owner that is trying to
                // keep it alive. See previous comment as to why this might not
                // be the case.
                if (currentLock.clusterLockKey.equals(clusterLockKey)) {
                    currentLock.refresh();
                    success = true;
                } else {
                    // The owning node might have unlocked this key at the same
                    // time as trying to keep the lock alive - another node
                    // might have then grabbed the lock. As the calls are
                    // asynchronous this situation is quite possible/probable
                    // and should not be considered an error - hence debug.
                    debug("keepAlive() - Attempt to keep alive with a different key to the owner", clusterLockKey,
                            currentLock, null);
                }
            } else {
                // The owning node might have unlocked this key at the same time
                // as trying to keep the lock alive. As the calls are
                // asynchronous this situation is quite possible/probable and
                // should not be considered an error - hence debug.
                debug("keepAlive() - Attempt to keep alive when was not locked", clusterLockKey, currentLock, null);
            }

            debug("keepAlive()", clusterLockKey, currentLock, success);
        } catch (final RuntimeException e) {
            LOGGER.error(e.getMessage(), e);
        }

        return success;
    }
Try and keep alive a lock with the supplied key.

@param clusterLockKey The key to try and keep alive an associated lock with.
@return Return true if we managed to keep alive a lock with the supplied
key, return false if no lock could be found for this key or if
the lock is owned by another node/process.
stroom-cluster/stroom-cluster-lock-impl-db/src/main/java/stroom/cluster/lock/impl/db/ClusterLockClusterHandler.java