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    * (C) Copyright IBM Corporation 2007, 2014.  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 applications to deal gracefully with 
022     * FileAreaLockedExceptions.  Applies to web views only - not dynamic or 
023     * snapshot views.
024     */
025    public interface CcFileAreaLockedCallback {
026        
027        /**
028         * Information about a file area lock.
029         */
030        public interface CcFileAreaLockInfo {
031            
032            /** 
033             * Get the date object was locked.
034             * @return Date the lock was applied. 
035             */
036            public Date getCreationDate();
037            
038            /** 
039             * Get the hostname of the user who set the lock.
040             * @return String the hostname
041             */
042            public String getHostName();
043            
044            /**
045             * Get the locked view.
046             * @return the locked view
047             */
048            public CcView getView();
049        }
050        
051        /**
052         * Notify the client about the occurrence of a 
053         * CopyAreaLockedException. The client may decide
054         * to break the lock. If so it should break the lock
055         * using the {@link CcView#breakFileAreaLock} method.
056         * 
057         * @param lockInfo      Details about the lock.
058         * @return              True if the lock was broken,
059         *                      otherwise false.
060         */
061        public boolean handleLockedFileArea(CcFileAreaLockInfo lockInfo)
062            throws WvcmException;
063    }