001    /*
002    * file CcVobResource.java
003    *
004    * Licensed Materials - Property of IBM
005    * Restricted Materials of IBM
006    *
007    * com.ibm.rational.wvcm.stp.cc.CcVobResource
008    *
009    * © Copyright IBM Corporation 2004, 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 static com.ibm.rational.wvcm.stpex.StpExBase.PROPERTY_NAMESPACE;
017    
018    import java.util.List;
019    
020    import javax.wvcm.ResourceList;
021    import javax.wvcm.WvcmException;
022    import javax.wvcm.PropertyNameList.PropertyName;
023    
024    /**
025     * <p>
026     * Base interface containing properties and methods common to
027     * all VOB-resident ClearCase resources.
028     * </p>
029     */
030    public interface CcVobResource extends CcResource {
031    
032        /** The VOB in which this VOB resource resides. */
033        PropertyName<CcVob> VOB =
034            new PropertyName<CcVob>(PROPERTY_NAMESPACE, "vob");
035    
036        /**
037         * Get the value of this proxy's {@link #VOB} property.
038         * @return This resource's VOB. Will never be null.
039         * @throws WvcmException
040         */
041        public CcVob getVob() throws WvcmException;
042    
043        /** List of attributes attached to this resource. */
044        public static final PropertyName<List<CcAttribute>> ATTRIBUTE_LIST =
045            new PropertyName<List<CcAttribute>>(PROPERTY_NAMESPACE, "attribute-list");
046        
047        /**
048         *  Get the value of this proxy's {@link #ATTRIBUTE_LIST} property.
049         *  @return List of CcAttribute proxies applied to this resource.  Empty list if none.
050         *  @throws WvcmException if this proxy doesn't define a value for this property.
051         */
052        public List<CcAttribute> getAttributeList() throws WvcmException;
053        
054        /** Replica in which this resource resides. */
055        public static final PropertyName<CcReplica> CURRENT_REPLICA =
056            new PropertyName<CcReplica>(PROPERTY_NAMESPACE, "current-replica");
057        
058        /**
059         * Returns the value of this proxy's {@link #CURRENT_REPLICA} property.
060         * 
061         * @return Replica in which the resource resides as a CcReplica instance.
062         * @throws WvcmException
063         *             if this proxy doesn't define a value for this property.
064         */
065        public CcReplica getCurrentReplica() throws WvcmException;
066    
067        /** List of hyperlink resources attached to this resource. */
068        public static final PropertyName<ResourceList<CcHyperlink>> HYPERLINK_LIST =
069            new PropertyName<ResourceList<CcHyperlink>>(PROPERTY_NAMESPACE, "hyperlink-list");
070    
071        /**
072         *  Get the value of this proxy's {@link #HYPERLINK_LIST} property.
073         *  @return List of CcHyperlink proxies applied to this resource.  Empty list if none.
074         *  @throws WvcmException if this proxy doesn't define a value for this property.
075         */
076        public ResourceList<CcHyperlink> getHyperlinkList() throws WvcmException;
077    
078        /** CcLockInfo object contains the supported lock properties. */
079        public static final PropertyName<CcLockInfo> LOCK_INFO =
080            new PropertyName<CcLockInfo>(PROPERTY_NAMESPACE, "lock-info");
081    
082        /**
083         * Returns the value of this proxy's {@link #LOCK_INFO} property.
084         * 
085         * @return the CcLockInfo object for the resource.
086         *         <code>null</code> if the object is not locked.
087         * @throws WvcmException
088         *             if this proxy doesn't define a value for this property.
089         */
090        public CcLockInfo getLockInfo() throws WvcmException;
091    
092        /**
093         * Sets (or replaces) the lock on this proxy according to the
094         * {@link #LOCK_INFO} property.
095         * @param lockInfo lock information for the new lock, or <code>null</code>
096         *        to unlock the proxy.
097         */
098        public void setLockInfo(CcLockInfo lockInfo);
099    
100        
101        /** Replica which has mastery of this resource. */
102        public static final PropertyName<CcReplica> CC_MASTER_REPLICA =
103            new PropertyName<CcReplica>(PROPERTY_NAMESPACE, "cc-master-replica");
104        
105        /**
106         * Returns the value of this proxy's {@link #CC_MASTER_REPLICA} property.
107         * 
108         * @return Replica in which the resource is mastered as a CcReplica instance.
109         *         null if resource cannot be mastered.
110         * @throws WvcmException
111         *             if this proxy doesn't define a value for this property.
112         */
113       public CcReplica getMasterReplica() throws WvcmException;
114     
115       /**
116        * <p>
117        * The permissions applied to this resource.
118        * </p>
119        */
120       PropertyName<CcPermissions> PERMISSIONS =
121           new PropertyName<CcPermissions>(PROPERTY_NAMESPACE, "cc-permissions");
122       
123       /**
124        * Get the value of this resource's {@link #PERMISSIONS} property.
125        * 
126        * @return A permissions object from which specific permissions 
127        * information can be extracted.
128        * @throws WvcmException
129        */
130       CcPermissions getPermissions() throws WvcmException;
131       
132       /**
133        * Set the value of this proxy's {@link #PERMISSIONS} property.
134        * 
135        * @param permissions  A permissions object.  Use the one returned
136        *                     by getPermissions and modify it.
137        * @throws WvcmException
138        *         if this proxy doesn't define a value for this property.
139        */
140       void setPermissions(CcPermissions permissions) throws WvcmException;
141    
142       
143    }