001    /*
002    * file CcProject.java
003    *
004    * Licensed Materials - Property of IBM
005    * Restricted Materials of IBM
006    * 
007    * com.ibm.rational.wvcm.stp.cc.CcProject
008    *
009    * (C) Copyright IBM Corporation 2004, 2013.  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 javax.wvcm.Feedback;
019    import javax.wvcm.PropertyNameList.PropertyName;
020    import javax.wvcm.ResourceList;
021    import javax.wvcm.WvcmException;
022    
023    import com.ibm.rational.wvcm.stp.cq.CqRecordType;
024    import com.ibm.rational.wvcm.stp.cq.CqUserDb;
025    import com.ibm.rational.wvcm.stpex.StpExEnumeration;
026    
027    import java.util.List;
028    
029    /**
030     * <p>A proxy for a ClearCase UCM project.
031     * </p>
032     * <p>A UCM project contains the configuration information needed to manage a
033     * significant development effort, such as a product release. A project contains
034     * one main shared <i>integration stream</i> and typically multiple per-user
035     * <i>development streams</i>.
036     * </p>
037     * <p>A UCM project may be <i>ClearQuest-enabled </i> by linking it to a particular
038     * ClearQuest database. In ClearQuest-enabled projects, all UCM activities are
039     * associated with ClearQuest entities in the ClearQuest database. ClearQuest
040     * provides richer activity management functionality than is available from
041     * ClearCase alone.
042     * </p>
043     * <p>
044     * For more project information, see the ClearCase "Guide to Developing Software with UCM"
045     * manual, and the cleartool man page "mkproject".
046     * </p>
047     */
048    public interface CcProject extends CcVobResource {
049    
050        /**
051         * A UCM project is "ClearQuest-enabled" if it is bound to a ClearQuest
052         * user database and participates in the ClearQuest/UCM integration.
053         */
054        enum ClearQuestEnabledState implements StpExEnumeration  {
055    
056            /**
057             * This project is not ClearQuest-enabled.
058             */
059            NOT_ENABLED,
060    
061            /**
062             * This project is ClearQuest-enabled.
063             */
064            ENABLED,
065    
066            /**
067             * This project is ClearQuest-enabled, but the integration is
068             * temporarily suspended.
069             */
070            SUSPENDED;
071        }
072        
073        /** 
074         * Defines the baseline name template for a project. 
075         * The property specifies the tokens to be used in the baseline name and 
076         * it can include any of the following tokens separated by commas:
077         * <ul>
078         * <li>basename
079         * <li>project
080         * <li>stream
081         * <li>component
082         * <li>date
083         * <li>time
084         * <li>user
085         * <li>host
086         * </ul>
087         * When the baseline is created, UCM replaces commas with underscores in the baseline name.
088         */
089        PropertyName<String> BASELINE_NAMING_TEMPLATE =
090            new PropertyName<String>(PROPERTY_NAMESPACE, "baseline-naming-template");
091        
092        /**
093         * Get the value of this proxy's {@link #BASELINE_NAMING_TEMPLATE} property.
094         * @return a string containing this projects baseline naming template
095         * @throws WvcmException if this proxy doesn't define a value for this property.
096         */
097        String getBaselineNamingTemplate() throws WvcmException;
098    
099        /**
100         * Set the template to be used when naming a newly created baseline.
101         * Specifying an empty string for a template will result in the default
102         * template being set (currently "basename").
103         * @param bl_template A string containing the desired naming template
104         */
105        void setBaselineNamingTemplate(String bl_template);
106        
107        /** This UCM project's integration stream. */
108        PropertyName<CcStream> INTEGRATION_STREAM =
109            new PropertyName<CcStream>(PROPERTY_NAMESPACE, "integration-stream");
110    
111        /**
112         * Get the value of this proxy's {@link #INTEGRATION_STREAM} property.
113         * @return a client proxy for this project's integration stream,
114         *     or null if project doesn't have an integration stream
115         * @throws WvcmException if this proxy doesn't define a value for this property.
116         */
117        CcStream getIntegrationStream() throws WvcmException;
118    
119        /** The list of streams in this UCM project. */
120        PropertyName<ResourceList<CcStream>> STREAM_LIST =
121            new PropertyName<ResourceList<CcStream>>(PROPERTY_NAMESPACE, "stream-list");
122    
123        /**
124         * Get the value of this proxy's {@link #STREAM_LIST} property.
125         * @return list of project's streams as a ResourceList of UcmStream instances.
126         * @throws WvcmException if this proxy doesn't define a value for this property.
127         */
128        ResourceList<CcStream> getStreamList() throws WvcmException;
129             
130        /** The list of UCM policies enabled for this project. */
131        PropertyName<List<CcUcmPolicy>> ENABLED_POLICY_LIST =
132            new PropertyName<List<CcUcmPolicy>>(PROPERTY_NAMESPACE, "enabled-policy-list");
133               
134        /**
135         * Get the value of this proxy's {@link #ENABLED_POLICY_LIST} property.
136         * @return list of policies which have been enabled for this project.
137         * @throws WvcmException if this proxy doesn't define a value for this property.
138         */
139        List<CcUcmPolicy> getEnabledPolicyList() throws WvcmException;
140          
141        /**
142         * Set the value of this proxy's {@link #ENABLED_POLICY_LIST} property.
143         * @param enabledPolicyList List of policies to be enabled for this project.      
144         */
145        void setEnabledPolicyList(List<CcUcmPolicy> enabledPolicyList);
146    
147        /** The list of UCM policies disabled for this project. */
148        PropertyName<List<CcUcmPolicy>> DISABLED_POLICY_LIST =
149            new PropertyName<List<CcUcmPolicy>>(PROPERTY_NAMESPACE, "disabled-policy-list");
150          
151        /**
152         * Get the value of this proxy's {@link #DISABLED_POLICY_LIST} property.
153         * @return list of policies which have been disabled for this project.
154         * @throws WvcmException if this proxy doesn't define a value for this property.
155         */
156        List<CcUcmPolicy> getDisabledPolicyList() throws WvcmException;
157           
158        /**
159         * Set the value of this proxy's {@link #DISABLED_POLICY_LIST} property.
160         * @param disabledPolicyList List of policies to be disabled for this project.      
161         */
162        void setDisabledPolicyList(List<CcUcmPolicy> disabledPolicyList);
163           
164        /** The list of UCM policies set per stream for this project. 
165         *  Not applicable for a single-stream UCM project. 
166         */
167        PropertyName<List<CcUcmPolicy>> PER_STREAM_POLICY_LIST =
168            new PropertyName<List<CcUcmPolicy>>(PROPERTY_NAMESPACE, "per-stream-policy-list");
169                 
170        /**
171         * Get the value of this proxy's {@link #PER_STREAM_POLICY_LIST} property.
172         * @return list of policies which have been set per stream for this project.
173         * @throws WvcmException if this proxy doesn't define a value for this property.
174         */
175        List<CcUcmPolicy> getPerStreamPolicyList() throws WvcmException;
176            
177        /**
178         * Set the value of this proxy's {@link #PER_STREAM_POLICY_LIST} property.
179         * @param perStreamPolicyList List of policies to be set at stream level for this project
180         *          or an empty list to disable policies currently set per stream.  
181         */
182        void setPerStreamPolicyList(List<CcUcmPolicy> perStreamPolicyList);
183    
184        /** The list of UCM enabled CQ record types in this UCM project. */
185        PropertyName<ResourceList<CqRecordType>> UCM_ENABLED_CQ_RECORD_TYPE_LIST =
186            new PropertyName<ResourceList<CqRecordType>>(PROPERTY_NAMESPACE, "ucm-enabled-cq-record-type-list");
187    
188        /**
189         * Get the value of this proxy's {@link #UCM_ENABLED_CQ_RECORD_TYPE_LIST} property.
190         * @return list of project's ucm enabled cq record types as a ResourceList of CqRecordType instances.
191         * @throws WvcmException if this proxy doesn't define a value for this property.
192         */
193        ResourceList<CqRecordType> getUcmEnabledCqRecordTypeList() throws WvcmException;
194    
195        /** The list of UCM components that can be modified in the UCM stream(s)
196         *  associated with this UCM project. 
197         */
198        PropertyName<ResourceList<CcComponent>> MODIFIABLE_COMPONENT_LIST =
199            new PropertyName<ResourceList<CcComponent>>(PROPERTY_NAMESPACE, "modifiable-component-list");
200    
201        /**
202         * Get the value of this proxy's {@link #MODIFIABLE_COMPONENT_LIST} property.
203         * @return list of modifiable components as ResourceList of UcmComponent instances.
204         * @throws WvcmException if this proxy doesn't define a value for this property.
205         */
206        ResourceList<CcComponent> getModifiableComponentList() throws WvcmException;
207        
208        /**
209         * Set the value of this proxy's {@link #MODIFIABLE_COMPONENT_LIST} property,
210         * during project creation time.
211         * @param modCompList List of components to be added as modifiable components
212         * for the UCM stream(s) associated with the project being created. 
213         */
214        void setModifiableComponentList (ResourceList<CcComponent> modCompList); 
215             
216        
217        /**
218         * Set the value of this proxy's {@link #MODIFIABLE_COMPONENT_LIST} property.
219         * It modifies the list of UCM components for the UCM stream(s)associated with this project,
220         * by adding and removing the items from the specified lists.
221         * An intersection between the addition and removal lists is considered an error.
222         * @param addCompList List of components to be added to the list of UCM components
223         * associated with this project's streams.Items in this list which are already associated
224         * with the UCM stream(s) are ignored.
225         * @param delCompList List of components to be removed from the list of UCM components
226         * associated with this project's streams.Items in this list which are not associated
227         * with the UCM stream(s) are ignored.
228         */
229        void setModifiableComponentList (ResourceList<CcComponent> addCompList, 
230                                         ResourceList<CcComponent> delCompList);
231    
232        /** Is this a single-stream UCM project? */
233        PropertyName<Boolean> IS_SINGLE_STREAM =
234            new PropertyName<Boolean>(PROPERTY_NAMESPACE, "is-single-stream");
235    
236        /**
237         * Get the value of this proxy's {@link #IS_SINGLE_STREAM} property.
238         * @return true if this is a single-stream UCM project, else false.
239         * @throws WvcmException if this proxy doesn't define a value for this property.
240         */
241        boolean getIsSingleStream() throws WvcmException;
242    
243        /**
244         * Set the value of this proxy's {@link #IS_SINGLE_STREAM} property. 
245         * This property can only be set at project creation time.
246         * @param isSingleStream true if the project should be single stream, false otherwise.
247         */
248        void setIsSingleStream(boolean isSingleStream);
249    
250        /** Is this a ClearQuest-enabled UCM project? */
251        PropertyName<ClearQuestEnabledState> CLEARQUEST_ENABLED_STATE =
252            new PropertyName<ClearQuestEnabledState>(PROPERTY_NAMESPACE, "clearquest-enabled-state");
253    
254        /**
255         * Get the value of this proxy's {@link #CLEARQUEST_ENABLED_STATE} property.
256         * @return ENABLED, NOT_ENABLED, or SUSPENDED depending on this project's state.
257         * @throws WvcmException if this proxy doesn't define a value for this property.
258         */
259        ClearQuestEnabledState getClearQuestEnabledState() throws WvcmException;
260    
261        /** The ClearQuest user database this CQ-enabled UCM project is associated with. */
262        PropertyName<CqUserDb> CLEARQUEST_USER_DB =
263            new PropertyName<CqUserDb>(PROPERTY_NAMESPACE, "clearquest-user-db");
264    
265        /**
266         * Get the value of this proxy's {@link #CLEARQUEST_USER_DB} property.
267         * @return a proxy for the CqUserDb associated with this CQ-enabled
268         * UCM project, or null if project is not CQ-enabled
269         * @throws WvcmException if this proxy doesn't define a value for this property.
270         */
271        CqUserDb getClearQuestUserDb() throws WvcmException;
272    
273        /** The UCM folder in which this UCM project resides */
274        PropertyName<CcProjectFolder> PROJECT_FOLDER =
275            new PropertyName<CcProjectFolder>(PROPERTY_NAMESPACE, "project-folder");
276    
277        /**
278         * Get the value of this proxy's {@link #PROJECT_FOLDER} property.
279         * @return A client proxy for the UCM folder that contains this UCM project.
280         * @throws WvcmException if this proxy doesn't define a value for this property.
281         */
282        CcProjectFolder getProjectFolder() throws WvcmException;
283    
284        /**
285         * Set the parent UCM folder for this project
286         * @param folder client proxy for the parent project folder.
287         */
288        void setProjectFolder(CcProjectFolder folder);    
289    
290        /** 
291         * A list of all streams in this UCM project that have posted deliveries
292         * in progress. A delivery is posted if the source stream is mastered
293         * at a different replica than the target stream at the time of the delivery.
294         */
295        PropertyName<ResourceList<CcStream>> POSTED_DELIVERY_LIST =
296            new PropertyName<ResourceList<CcStream>>(PROPERTY_NAMESPACE, "ccproject-posted-delivery-list");
297        
298        /**
299         * Get the value of this proxy's {@link #POSTED_DELIVERY_LIST} property.
300         * @return A list containing this project's posted deliveries.
301         * @throws WvcmException if this proxy doesn't define a value for this property.
302         */
303        ResourceList<CcStream> getPostedDeliveryList() throws WvcmException;
304        
305        /**
306         * Promotion level required by baselines to be recommended in the UCM Stream(s) 
307         * associated with this project.
308         */
309        PropertyName<String> REBASE_PROMOTION_LEVEL=
310            new PropertyName<String>(PROPERTY_NAMESPACE, "rebase-promotion-level");  
311        
312        /**
313         * Get the value of this proxy's {@link #REBASE_PROMOTION_LEVEL} property.
314         * @return a string containing the rebase promotion level of this project.
315         * @throws WvcmException if this proxy doesn't define a value for this property.
316         */
317        String getRebasePromotionLevel() throws WvcmException ;
318            
319        /**
320         * Set the value of this project's {@link #REBASE_PROMOTION_LEVEL} property.
321         * @param rebasePromotionLevel the rebase promotion level of this project.
322         */
323        void setRebasePromotionLevel (String  rebasePromotionLevel);        
324        
325        /**
326         * Create a new UCM project at the location specified by this proxy. The
327         * location should be an object name selector specifying the project's name
328         * and the repository (project VOB/project Folder) in which to create it.
329         */
330        CcProject doCreateCcProject(Feedback feedback) throws WvcmException;
331    }