/*
 * Copyright (c) 2005 Your Corporation. All Rights Reserved.
 */
package org.apache.jackrabbit.webdav.transaction;

import org.apache.jackrabbit.webdav.DavException;
import org.apache.jackrabbit.webdav.lock.ActiveLock;
import org.apache.jackrabbit.webdav.lock.LockManager;
import org.apache.jackrabbit.webdav.lock.Scope;
import org.apache.jackrabbit.webdav.lock.Type;

/**
 * <code>TxLockManager</code> manages locks with locktype
 * '{@link TransactionConstants#TRANSACTION dcr:transaction}'.
 *
 * todo: removing all expired locks
 * todo: 'local' and 'global' are not accurate terms in the given context > replace
 * todo: the usage of the 'global' transaction is not according to the JTA specification,
 * which explicitely requires any transaction present on a servlet to be completed before
 * the service method returns. Starting/completing transactions on the session object,
 * which is possible with the jackrabbit implementation is a hack.
 * todo: review of this transaction part is therefore required. Is there a use-case
 * for those 'global' transactions at all...
 */
public interface TxLockManager extends LockManager {


    /**
     * Release the lock identified by the given lock token.
     *
     * @param lockInfo
     * @param lockToken
     * @param resource
     * @throws org.apache.jackrabbit.webdav.DavException
     */
    public void releaseLock(TransactionInfo lockInfo, String lockToken,
			    TransactionResource resource) throws DavException;


    /**
     * Return the lock applied to the given resource or <code>null</code>
     *
     * @param type
     * @param scope
     * @param resource
     * @return lock applied to the given resource or <code>null</code>
     * @see org.apache.jackrabbit.webdav.lock.LockManager#getLock(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope, org.apache.jackrabbit.webdav.DavResource)
     */
    public ActiveLock getLock(Type type, Scope scope, TransactionResource resource);


}

@@ -3,64 +3,690 @@
 %0A * 
-Copyright (c) 2005 Your Corporation. All Rights Reserved
+Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  The ASF licenses this file to You%0A * under the Apache License, Version 2.0 (the %22License%22); you may not%0A * use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License
 .%0A *

Fix License Header