// Path: src/main/java/uk/sky/cqlmigrate/exception/CannotAcquireLockException.java
// public class CannotAcquireLockException extends LockException {
// 
//     public CannotAcquireLockException(String message) {
//         super(message);
//     }
// 
//     public CannotAcquireLockException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/uk/sky/cqlmigrate/exception/CannotReleaseLockException.java
// public class CannotReleaseLockException extends LockException {
// 
//     public CannotReleaseLockException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public CannotReleaseLockException(String message) {
//         super(message);
//     }
// }


import uk.sky.cqlmigrate.exception.CannotAcquireLockException;
import uk.sky.cqlmigrate.exception.CannotReleaseLockException;
package uk.sky.cqlmigrate;


abstract class LockingMechanism {

    protected final String lockName;

    public LockingMechanism(String lockName) {
        this.lockName = lockName;
    }

    public void init() {

    }

    /**
     * Returns true if successfully acquired lock.
     *
     * @param clientId client to acquire the lock for
     * @return if the lock was successfully acquired. A false value means that the lock was not acquired,
     * or that the result of the operation is unknown.
     * @throws CannotAcquireLockException if any fatal failure occurs when trying to acquire lock.
     */
// Path: src/main/java/uk/sky/cqlmigrate/exception/CannotAcquireLockException.java
// public class CannotAcquireLockException extends LockException {
// 
//     public CannotAcquireLockException(String message) {
//         super(message);
//     }
// 
//     public CannotAcquireLockException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/uk/sky/cqlmigrate/exception/CannotReleaseLockException.java
// public class CannotReleaseLockException extends LockException {
// 
//     public CannotReleaseLockException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public CannotReleaseLockException(String message) {
//         super(message);
//     }
// }


// Path: src/main/java/uk/sky/cqlmigrate/LockingMechanism.java
import uk.sky.cqlmigrate.exception.CannotAcquireLockException;
import uk.sky.cqlmigrate.exception.CannotReleaseLockException;

package uk.sky.cqlmigrate;


abstract class LockingMechanism {

    protected final String lockName;

    public LockingMechanism(String lockName) {
        this.lockName = lockName;
    }

    public void init() {

    }

    /**
     * Returns true if successfully acquired lock.
     *
     * @param clientId client to acquire the lock for
     * @return if the lock was successfully acquired. A false value means that the lock was not acquired,
     * or that the result of the operation is unknown.
     * @throws CannotAcquireLockException if any fatal failure occurs when trying to acquire lock.
     */
    abstract public boolean acquire(String clientId) throws CannotAcquireLockException;