001 /*
002 * file CcFileAreaLockedCallback.java
003 *
004 * Licensed Materials - Property of IBM
005 * Restricted Materials of IBM
006 *
007 * com.ibm.rational.wvcm.stp.cc.CcFileAreaLockedCallback
008 *
009 * © Copyright IBM Corporation 2007, 2008. All Rights Reserved.
010 * Note to U.S. Government Users Restricted Rights: Use, duplication or
011 * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
012 */
013
014 package com.ibm.rational.wvcm.stp.cc;
015
016 import java.util.Date;
017
018 import javax.wvcm.WvcmException;
019
020 /**
021 * Interface to permit the GUI to deal gracefully with
022 * CopyAreaLockedExceptions.
023 */
024 public interface CcFileAreaLockedCallback {
025
026 /**
027 * Information about a file area lock.
028 */
029 public interface CcFileAreaLockInfo {
030
031 /**
032 * Get the date object was locked.
033 * @return Date the lock was applied.
034 */
035 public Date getCreationDate();
036
037 /**
038 * Get the hostname of the user who set the lock.
039 * @return String the hostname
040 */
041 public String getHostName();
042
043 /**
044 * Get the locked view.
045 * @return the locked view
046 */
047 public CcView getView();
048 }
049
050 /**
051 * Notify the client about the occurrence of a
052 * CopyAreaLockedException. The client may decide
053 * to break the lock. If so it should break the lock
054 * using the {@link CcView#breakFileAreaLock} method.
055 *
056 * @param lockInfo Details about the lock.
057 * @return True if the lock was broken,
058 * otherwise false.
059 */
060 public boolean handleLockedFileArea(CcFileAreaLockInfo lockInfo)
061 throws WvcmException;
062 }