hudson.plugins.clearcase
Interface ClearTool

All Known Implementing Classes:
ClearToolDynamic, ClearToolExec, ClearToolSnapshot

public interface ClearTool

Abstraction to cleartool commands


Nested Class Summary
static class ClearTool.DefaultPromotionLevel
           
static class ClearTool.DiffBlOptions
           
static class ClearTool.SetcsOption
           
 
Method Summary
 java.lang.String catcs(java.lang.String viewTag)
          Retrieves the config spec for the specified view name
 java.io.Reader describe(java.lang.String format, java.lang.String objectSelector)
          Call the cleartool describe with the provided format on the specified object selector See http://www.ipnom.com/ClearCase-Commands/describe.html for valid options
 java.io.Reader diffbl(java.util.EnumSet<ClearTool.DiffBlOptions> options, java.lang.String baseline1, java.lang.String baseline2, java.lang.String viewPath)
          Call diffbl using the two provided baselines (can be stream or baseline)
 boolean doesStreamExist(java.lang.String streamSelector)
           
 boolean doesViewExist(java.lang.String viewTag)
          Checks whether the given view tag already exists in the ClearCase region.
 void endView(java.lang.String viewTag)
          Ends the view
 ClearToolLauncher getLauncher()
          Get the inner CLearToolLauncher.
 java.util.Properties getViewData(java.lang.String viewTag)
          Gets the view UUID, for thorough view deletion.
 boolean lock(java.lang.String comment, java.lang.String objectSelector)
          Lock an object.
 void logRedundantCleartoolError(java.lang.String[] cmd, java.lang.Exception ex)
           
 java.io.Reader lsactivity(java.lang.String activity, java.lang.String commandFormat, java.lang.String viewPath)
          Call lsactivity (see on Rational ClearCase Commands Reference for details)
 java.lang.String lsbl(java.lang.String baselineName, java.lang.String format)
          List attributes of a baseline
 java.lang.String lscurrentview(java.lang.String viewPath)
          Given a relative path, return the associated view tag if it exists.
 java.io.Reader lshistory(java.lang.String format, java.util.Date lastBuildDate, java.lang.String viewPath, java.lang.String branch, java.lang.String[] pathsInView)
          Returns Reader containing output from lshistory.
 java.lang.String lsproject(java.lang.String viewTag, java.lang.String format)
          List attributes of a project
 java.lang.String lsstream(java.lang.String stream, java.lang.String viewTag, java.lang.String format)
          List attributes of a stream
 java.util.List<java.lang.String> lsview(boolean onlyActiveDynamicViews)
          Lists view registry entries.
 java.util.List<java.lang.String> lsvob(boolean onlyMounted)
          Lists VOB registry entries
 java.util.List<Baseline> mkbl(java.lang.String name, java.lang.String viewTag, java.lang.String comment, boolean fullBaseline, boolean identical, java.util.List<java.lang.String> components, java.lang.String dDependOn, java.lang.String aDependOn)
          Creates a new baseline
 void mklabel(java.lang.String viewPath, java.lang.String label)
          Attaches version labels to versions of elements
 void mkstream(java.lang.String parentStream, java.lang.String stream)
          Make a new stream
 void mkview(java.lang.String viewPath, java.lang.String viewTag, java.lang.String streamSelector)
          Creates and registers a view
 void mkview(java.lang.String viewPath, java.lang.String viewTag, java.lang.String streamSelector, java.lang.String defaultStorageDir)
          Creates and registers a view
 void mountVobs()
          Mounts all VOBs.
 java.lang.String pwv(java.lang.String viewPath)
          Retrieves the canonical working directory for a given view.
 void rebaseDynamic(java.lang.String viewTag, java.lang.String baseline)
          Rebase a dynamic view
 void recommendBaseline(java.lang.String streamSelector)
          Recommend the latest baselines on the stream that matches the minimum promotion level of the stream
 void rmtag(java.lang.String tag)
          Removes a view tag or a VOB tag from the networkwide storage registry
 void rmview(java.lang.String viewPath)
          Removes the view from a VOB
 void rmviewtag(java.lang.String viewTag)
          Removes the view tag from the ClearCase registry - used when the view storage in the workspace has already been deleted.
 void rmviewUuid(java.lang.String viewUuid)
          Removes the view (as identified by UUID) from all VOBs
 void setBaselinePromotionLevel(java.lang.String baselineName, ClearTool.DefaultPromotionLevel promotionLevel)
           
 void setBaselinePromotionLevel(java.lang.String baselineName, java.lang.String promotionLevel)
          Set the baseline promotion level to the given level.
 void setcs(java.lang.String viewPath, ClearTool.SetcsOption option, java.lang.String configSpec)
          Sets the config spec of the view
 void setcsTag(java.lang.String viewTag, ClearTool.SetcsOption option, java.lang.String configSpec)
          Synchronizes the Dynamic UCM view with the streams recommended baseline
 void startView(java.lang.String viewTags)
          Starts or connects to a dynamic view's view_server process
 void unlock(java.lang.String comment, java.lang.String objectSelector)
          Unlock an object
 void unregisterView(java.lang.String viewUuid)
          Unregisters the view tag for a given UUID.
 void update(java.lang.String viewPath, java.lang.String[] loadRules)
          Updates the elements in the view
 

Method Detail

catcs

java.lang.String catcs(java.lang.String viewTag)
                       throws java.io.IOException,
                              java.lang.InterruptedException
Retrieves the config spec for the specified view name

Parameters:
viewTag - The view tag the client want the config spec for.
Returns:
a string containing the config spec
Throws:
java.io.IOException
java.lang.InterruptedException

describe

java.io.Reader describe(java.lang.String format,
                        java.lang.String objectSelector)
                        throws java.io.IOException,
                               java.lang.InterruptedException
Call the cleartool describe with the provided format on the specified object selector See http://www.ipnom.com/ClearCase-Commands/describe.html for valid options

Parameters:
format -
objectSelector -
Returns:
A reader to the command output
Throws:
java.io.IOException - If cleartool throws an error code
java.lang.InterruptedException - If the process is interrupted
Since:
1.3

diffbl

java.io.Reader diffbl(java.util.EnumSet<ClearTool.DiffBlOptions> options,
                      java.lang.String baseline1,
                      java.lang.String baseline2,
                      java.lang.String viewPath)
Call diffbl using the two provided baselines (can be stream or baseline)

Parameters:
options - see http://www.ipnom.com/ClearCase-Commands/diffbl.html
baseline1 -
baseline2 -
viewPath - A view path name needed to retrieve versions from
Returns:

doesStreamExist

boolean doesStreamExist(java.lang.String streamSelector)
                        throws java.io.IOException,
                               java.lang.InterruptedException
Parameters:
streamSelector -
Returns:
true if the specified stream exists
Throws:
java.io.IOException
java.lang.InterruptedException

doesViewExist

boolean doesViewExist(java.lang.String viewTag)
                      throws java.io.IOException,
                             java.lang.InterruptedException
Checks whether the given view tag already exists in the ClearCase region.

Parameters:
viewTag - the view tag to check
Returns:
true if the view tag exists, false otherwise.
Throws:
java.io.IOException
java.lang.InterruptedException

endView

void endView(java.lang.String viewTag)
             throws java.io.IOException,
                    java.lang.InterruptedException
Ends the view

Parameters:
viewTag - the view tag
Throws:
java.io.IOException
java.lang.InterruptedException

getLauncher

ClearToolLauncher getLauncher()
Get the inner CLearToolLauncher.

Returns:
The inner CLearToolLauncher.

getViewData

java.util.Properties getViewData(java.lang.String viewTag)
                                 throws java.io.IOException,
                                        java.lang.InterruptedException
Gets the view UUID, for thorough view deletion.

Parameters:
viewTag -
Throws:
java.io.IOException
java.lang.InterruptedException

logRedundantCleartoolError

void logRedundantCleartoolError(java.lang.String[] cmd,
                                java.lang.Exception ex)

lock

boolean lock(java.lang.String comment,
             java.lang.String objectSelector)
             throws java.io.IOException,
                    java.lang.InterruptedException
Lock an object. See http://www.ipnom.com/ClearCase-Commands/lock.html

Parameters:
comment - Can be null
objectSelector - Object select. Cannot be null
Returns:
true if the lock succeeded.
Throws:
java.io.IOException
java.lang.InterruptedException

lsactivity

java.io.Reader lsactivity(java.lang.String activity,
                          java.lang.String commandFormat,
                          java.lang.String viewPath)
                          throws java.io.IOException,
                                 java.lang.InterruptedException
Call lsactivity (see on Rational ClearCase Commands Reference for details)

Parameters:
activity - Specifies one or more activities to list.
You can specify an activity as a simple name or as an object selector of the form [activity]:name@vob-selector, where vob-selector specifies a project VOB (see the cleartool reference page).
If you specify a simple name and the current directory is not a project VOB, this command assumes that the activity resides in the project VOB associated with the stream attached to the current view.
If the current directory is a project VOB, that project VOB is the context for identifying the activity.
commandFormat - The output format to be used (-fmt <commandFormat>)
viewPath - view path name to use in order to list activity
Returns:
A reader to the lsactivity command output
Throws:
java.io.IOException
java.lang.InterruptedException

lsbl

java.lang.String lsbl(java.lang.String baselineName,
                      java.lang.String format)
                      throws java.io.IOException,
                             java.lang.InterruptedException
List attributes of a baseline

Parameters:
baselineName -
format -
Returns:
Throws:
java.io.IOException
java.lang.InterruptedException

lscurrentview

java.lang.String lscurrentview(java.lang.String viewPath)
                               throws java.io.IOException,
                                      java.lang.InterruptedException
Given a relative path, return the associated view tag if it exists. Otherwise, it will return null

Returns:
Throws:
java.io.IOException
java.lang.InterruptedException

lshistory

java.io.Reader lshistory(java.lang.String format,
                         java.util.Date lastBuildDate,
                         java.lang.String viewPath,
                         java.lang.String branch,
                         java.lang.String[] pathsInView)
                         throws java.io.IOException,
                                java.lang.InterruptedException
Returns Reader containing output from lshistory.

Parameters:
format - format that should be used by the lshistory command
lastBuildDate - lists events recorded since (that is, at or after) the specified date-time
viewPath - the name of the view
branch - the name of the branch to get history events for; if null then history events for all branches are listed
pathsInView - view paths that should be added to the lshistory command. The view paths must be relative.
Returns:
Reader containing output from command
Throws:
java.io.IOException
java.lang.InterruptedException

lsproject

java.lang.String lsproject(java.lang.String viewTag,
                           java.lang.String format)
                           throws java.lang.InterruptedException,
                                  java.io.IOException
List attributes of a project

Parameters:
viewTag - View tag of a view attached to a stream of the project
format -
Returns:
Throws:
java.lang.InterruptedException
java.io.IOException

lsstream

java.lang.String lsstream(java.lang.String stream,
                          java.lang.String viewTag,
                          java.lang.String format)
                          throws java.io.IOException,
                                 java.lang.InterruptedException
List attributes of a stream

Parameters:
stream - TODO
viewTag - The view tag of a view on the wanted stream
format -
Returns:
Throws:
java.io.IOException
java.lang.InterruptedException

lsview

java.util.List<java.lang.String> lsview(boolean onlyActiveDynamicViews)
                                        throws java.io.IOException,
                                               java.lang.InterruptedException
Lists view registry entries. This command needs to be run inside a view.

Parameters:
onlyActiveDynamicViews - true for only return active dynamic views; false all views are returned
Returns:
list of view names
Throws:
java.io.IOException
java.lang.InterruptedException

lsvob

java.util.List<java.lang.String> lsvob(boolean onlyMounted)
                                       throws java.io.IOException,
                                              java.lang.InterruptedException
Lists VOB registry entries

Parameters:
onlyMounted - true for only return mounted vobs; false all vobs are returned
Returns:
list of vob names
Throws:
java.io.IOException
java.lang.InterruptedException

mklabel

void mklabel(java.lang.String viewPath,
             java.lang.String label)
             throws java.io.IOException,
                    java.lang.InterruptedException
Attaches version labels to versions of elements

Parameters:
viewPath - The view path name (relative to the workspace)
label - the label name
Throws:
java.io.IOException
java.lang.InterruptedException

mkbl

java.util.List<Baseline> mkbl(java.lang.String name,
                              java.lang.String viewTag,
                              java.lang.String comment,
                              boolean fullBaseline,
                              boolean identical,
                              java.util.List<java.lang.String> components,
                              java.lang.String dDependOn,
                              java.lang.String aDependOn)
                              throws java.io.IOException,
                                     java.lang.InterruptedException
Creates a new baseline

Parameters:
name - The base name for the baseline
viewTag - The view from which to create baseline. Baselines are created in the stream linked to this view
comment -
fullBaseline -
identical -
components -
dDependOn - TODO
aDependOn - TODO
Returns:
Throws:
java.io.IOException
java.lang.InterruptedException

mkstream

void mkstream(java.lang.String parentStream,
              java.lang.String stream)
              throws java.io.IOException,
                     java.lang.InterruptedException
Make a new stream

Parameters:
parentStream - The parent stream name
stream - The new stream name
Throws:
java.io.IOException
java.lang.InterruptedException

mkview

void mkview(java.lang.String viewPath,
            java.lang.String viewTag,
            java.lang.String streamSelector)
            throws java.io.IOException,
                   java.lang.InterruptedException
Creates and registers a view

Parameters:
viewPath - The view path name (relative to the workspace)
viewTag - the name of the view
streamSelector - optional stream selector, null if not used.
launcher - launcher for launching the command
Throws:
java.io.IOException
java.lang.InterruptedException

mkview

void mkview(java.lang.String viewPath,
            java.lang.String viewTag,
            java.lang.String streamSelector,
            java.lang.String defaultStorageDir)
            throws java.io.IOException,
                   java.lang.InterruptedException
Creates and registers a view

Parameters:
viewPath - The view path name (relative to the workspace)
viewTag - The view tag (unique server identifier for the view)
streamSelector - optional stream selector, null if not used.
launcher - launcher for launching the command
Throws:
java.io.IOException
java.lang.InterruptedException

mountVobs

void mountVobs()
               throws java.io.IOException,
                      java.lang.InterruptedException
Mounts all VOBs.

Throws:
java.io.IOException
java.lang.InterruptedException

pwv

java.lang.String pwv(java.lang.String viewPath)
                     throws java.io.IOException,
                            java.lang.InterruptedException
Retrieves the canonical working directory for a given view.

Parameters:
viewPath - The view path to use to execute pwv
Returns:
the return from "cleartool pwv"
Throws:
java.io.IOException
java.lang.InterruptedException

rebaseDynamic

void rebaseDynamic(java.lang.String viewTag,
                   java.lang.String baseline)
                   throws java.io.IOException,
                          java.lang.InterruptedException
Rebase a dynamic view

Parameters:
viewTag - the view to rebase. It must be a dynamic view
baseline - The new foundation baseline to use
Throws:
java.io.IOException
java.lang.InterruptedException

recommendBaseline

void recommendBaseline(java.lang.String streamSelector)
                       throws java.io.IOException,
                              java.lang.InterruptedException
Recommend the latest baselines on the stream that matches the minimum promotion level of the stream

Parameters:
streamSelector -
Throws:
java.io.IOException
java.lang.InterruptedException

rmview

void rmview(java.lang.String viewPath)
            throws java.io.IOException,
                   java.lang.InterruptedException
Removes the view from a VOB

Parameters:
viewPath - The path used for the view
Throws:
java.io.IOException
java.lang.InterruptedException

rmviewtag

void rmviewtag(java.lang.String viewTag)
               throws java.io.IOException,
                      java.lang.InterruptedException
Removes the view tag from the ClearCase registry - used when the view storage in the workspace has already been deleted.

Parameters:
viewTag - The view tag (server identifier of the view)
Throws:
java.io.IOException
java.lang.InterruptedException

rmtag

void rmtag(java.lang.String tag)
           throws java.io.IOException,
                  java.lang.InterruptedException
Removes a view tag or a VOB tag from the networkwide storage registry

Parameters:
tag -
Throws:
java.io.IOException
java.lang.InterruptedException

rmviewUuid

void rmviewUuid(java.lang.String viewUuid)
                throws java.io.IOException,
                       java.lang.InterruptedException
Removes the view (as identified by UUID) from all VOBs

Parameters:
viewUuid - the unique identifier for the view
Throws:
java.io.IOException
java.lang.InterruptedException

setBaselinePromotionLevel

void setBaselinePromotionLevel(java.lang.String baselineName,
                               java.lang.String promotionLevel)
                               throws java.io.IOException,
                                      java.lang.InterruptedException
Set the baseline promotion level to the given level. The predefined promotion levels are defined in ClearTool.DefaultPromotionLevel.

Parameters:
baselineName -
promotionLevel -
Throws:
java.io.IOException
java.lang.InterruptedException

setBaselinePromotionLevel

void setBaselinePromotionLevel(java.lang.String baselineName,
                               ClearTool.DefaultPromotionLevel promotionLevel)
                               throws java.io.IOException,
                                      java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException

setcs

void setcs(java.lang.String viewPath,
           ClearTool.SetcsOption option,
           java.lang.String configSpec)
           throws java.io.IOException,
                  java.lang.InterruptedException
Sets the config spec of the view

Parameters:
viewPath - The view path name (relative to the workspace)
option - The type of setcs that needs to be performed
configSpec - the name of the file containing a config spec
Throws:
java.io.IOException
java.lang.InterruptedException

setcsTag

void setcsTag(java.lang.String viewTag,
              ClearTool.SetcsOption option,
              java.lang.String configSpec)
              throws java.io.IOException,
                     java.lang.InterruptedException
Synchronizes the Dynamic UCM view with the streams recommended baseline

Parameters:
viewTag -
option - The option to use
configSpec - The config spec to apply. If omitted, the view tag
Throws:
java.io.IOException
java.lang.InterruptedException

startView

void startView(java.lang.String viewTags)
               throws java.io.IOException,
                      java.lang.InterruptedException
Starts or connects to a dynamic view's view_server process

Parameters:
viewTags - One or more currently registered view tags (that is, view tags visible to lsview).
Throws:
java.io.IOException
java.lang.InterruptedException

unlock

void unlock(java.lang.String comment,
            java.lang.String objectSelector)
            throws java.io.IOException,
                   java.lang.InterruptedException
Unlock an object

Parameters:
comment -
objectSelector -
Throws:
java.io.IOException
java.lang.InterruptedException

unregisterView

void unregisterView(java.lang.String viewUuid)
                    throws java.io.IOException,
                           java.lang.InterruptedException
Unregisters the view tag for a given UUID.

Parameters:
viewUuid - the unique identifier for the view.
Throws:
java.io.IOException
java.lang.InterruptedException

update

void update(java.lang.String viewPath,
            java.lang.String[] loadRules)
            throws java.io.IOException,
                   java.lang.InterruptedException
Updates the elements in the view

Parameters:
viewPath - the name of the view
loadRules - optional load rules, null if not used.
Throws:
java.io.IOException
java.lang.InterruptedException


Copyright © 2010. All Rights Reserved.