public synchronized String sendLockRequest() throws InterruptedException,
            UnableToGetLockException {
        // TODO: Global lock needed?
        mLockId = null;
        int lockTries = 0;
        int timeout = 0;
        while (lockTries < MAX_LOCK_RETRIES) {
            CollaborationRequireLock lockRequest = new CollaborationRequireLock();
            setCurrentState(STATE_WAIT_FOR_LOCK);
            if (!send(lockRequest)) {
                setCurrentState(STATE_IDLE);
                throw new UnableToGetLockException();
            }
            final int sleepTime = ROUNDTRIP_TIMEOUT / ROUNDTRIP_ROUNDS;
            timeout = ROUNDTRIP_ROUNDS;
            while (getCurrentState() == STATE_WAIT_FOR_LOCK && timeout >= 0) {
                sleep(sleepTime);
                timeout--;
            }
            if (getCurrentState() == STATE_LOCK_RECEIVED) {
                break;
            }
            // error case, repeat lock question.
            lockTries++;
            logger.info("Didn't receive a lock, current try: " + lockTries);
            sleep(LOCK_RETRY_SLEEP_TIME);
        }
        setCurrentState(STATE_IDLE);
        if (lockTries == MAX_LOCK_RETRIES || timeout < 0) {
            throw new UnableToGetLockException();
        }
        return mLockId;
    }