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, 2009.  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        /**
102         * Does this object have local mastership? If true, this object is mastered
103         * in the same replica as its VOB.  Otherwise, it is mastered at a replica
104         * remote from that of its VOB.
105         */
106        PropertyName<Boolean> HAS_LOCAL_MASTERSHIP =
107            new PropertyName<Boolean>(PROPERTY_NAMESPACE, "has-local-mastership"); //$NON-NLS-1$
108    
109        /**
110         * Get the value of this proxy's {@link #HAS_LOCAL_MASTERSHIP} property.
111         * @return true if this object has local mastership, else false
112         * @throws WvcmException if this proxy doesn't define a value for this property.
113         */
114        boolean getHasLocalMastership() throws WvcmException;
115    
116        
117        /** Replica which has mastery of this resource. */
118        public static final PropertyName<CcReplica> CC_MASTER_REPLICA =
119            new PropertyName<CcReplica>(PROPERTY_NAMESPACE, "cc-master-replica");
120        
121        /**
122         * Returns the value of this proxy's {@link #CC_MASTER_REPLICA} property.
123         * 
124         * @return Replica in which the resource is mastered as a CcReplica instance.
125         *         null if resource cannot be mastered.
126         * @throws WvcmException
127         *             if this proxy doesn't define a value for this property.
128         */
129       public CcReplica getMasterReplica() throws WvcmException;
130     
131       /**
132        * <p>
133        * The permissions applied to this resource.
134        * </p>
135        */
136       PropertyName<CcPermissions> PERMISSIONS =
137           new PropertyName<CcPermissions>(PROPERTY_NAMESPACE, "cc-permissions");
138       
139       /**
140        * Get the value of this resource's {@link #PERMISSIONS} property.
141        * 
142        * @return A permissions object from which specific permissions 
143        * information can be extracted.
144        * @throws WvcmException
145        */
146       CcPermissions getPermissions() throws WvcmException;
147       
148       /**
149        * Set the value of this proxy's {@link #PERMISSIONS} property.
150        * 
151        * @param permissions  A permissions object.  Use the one returned
152        *                     by getPermissions and modify it.
153        * @throws WvcmException
154        *         if this proxy doesn't define a value for this property.
155        */
156       void setPermissions(CcPermissions permissions) throws WvcmException;
157    
158       
159    }