1 /*2 * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/store/LockStore.java,v 1.9 2004/07/28 09:34:42 ib Exp $3 * $Revision: 1.9 $4 * $Date: 2004/07/28 09:34:42 $5 *6 * ====================================================================7 *8 * Copyright 1999-2002 The Apache Software Foundation 9 *10 * Licensed under the Apache License, Version 2.0 (the "License");11 * you may not use this file except in compliance with the License.12 * You may obtain a copy of the License at13 *14 * http://www.apache.org/licenses/LICENSE-2.015 *16 * Unless required by applicable law or agreed to in writing, software17 * distributed under the License is distributed on an "AS IS" BASIS,18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.19 * See the License for the specific language governing permissions and20 * limitations under the License.21 *22 */ 23 24 package org.apache.slide.store;25 26 import java.util.Enumeration ;27 28 import org.apache.slide.common.Service;29 import org.apache.slide.common.ServiceAccessException;30 import org.apache.slide.common.Uri;31 import org.apache.slide.lock.LockTokenNotFoundException;32 import org.apache.slide.lock.NodeLock;33 34 /**35 * Store for Lock objects.36 * 37 * @version $Revision: 1.9 $38 */39 public interface LockStore extends Service {40 41 42 // ------------------------------------------------------ Interface Methods43 44 45 /**46 * Create a new lock.47 * 48 * @param lock Lock token49 * @exception ServiceAccessException Service access error50 */51 void putLock(Uri uri, NodeLock lock)52 throws ServiceAccessException;53 54 55 /**56 * Renew a lock.57 * 58 * @param lock Token to renew59 * @exception ServiceAccessException Service access error60 * @exception LockTokenNotFoundException Lock token was not found61 */62 void renewLock(Uri uri, NodeLock lock)63 throws ServiceAccessException, LockTokenNotFoundException;64 65 66 /**67 * Unlock.68 * 69 * @param lock Token to remove70 * @exception ServiceAccessException Service access error71 * @exception LockTokenNotFoundException Lock token was not found72 */73 void removeLock(Uri uri, NodeLock lock)74 throws ServiceAccessException, LockTokenNotFoundException;75 76 77 /**78 * Kill a lock.79 * 80 * @param lock Token to remove81 * @exception ServiceAccessException Service access error82 * @exception LockTokenNotFoundException Lock token was not found83 */84 void killLock(Uri uri, NodeLock lock)85 throws ServiceAccessException, LockTokenNotFoundException;86 87 88 /**89 * Enumerate locks on an object.90 * 91 * @param uri Uri of the subject92 * @return Enumeration List of {@link org.apache.slide.lock.NodeLock locks}93 * which have been put on the subject94 * @exception ServiceAccessException Service access error95 */96 Enumeration enumerateLocks(Uri uri)97 throws ServiceAccessException;98 99 100 }101