hudson.plugins.clearcase
Class ClearToolExec

java.lang.Object
  extended by hudson.plugins.clearcase.ClearToolExec
All Implemented Interfaces:
ClearTool
Direct Known Subclasses:
ClearToolDynamic, ClearToolDynamicUCM, ClearToolSnapshot

public abstract class ClearToolExec
extends java.lang.Object
implements ClearTool


Field Summary
protected  ClearToolLauncher launcher
           
protected  hudson.util.VariableResolver<java.lang.String> variableResolver
           
 
Constructor Summary
ClearToolExec(hudson.util.VariableResolver<java.lang.String> variableResolver, ClearToolLauncher launcher)
           
 
Method Summary
 java.lang.String catcs(java.lang.String viewName)
          Retrieves the config spec for the specified view name
 boolean doesViewExist(java.lang.String viewName)
          Checks whether the given view tag already exists in the ClearCase region.
 void endView(java.lang.String viewName)
          Ends the view
 ClearToolLauncher getLauncher()
          Get the inner CLearToolLauncher.
protected abstract  hudson.FilePath getRootViewPath(ClearToolLauncher launcher)
           
 java.util.Properties getViewData(java.lang.String viewName)
          Gets the view UUID, for thorough view deletion.
 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 viewname)
          Lists activities .......(?)
 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 viewName, java.lang.String branch, java.lang.String[] viewPaths)
          Returns Reader containing output from lshistory.
 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
 void mklabel(java.lang.String viewName, java.lang.String label)
          Attaches version labels to versions of elements
 void mountVobs()
          Mounts all VOBs.
 java.lang.String pwv(java.lang.String viewName)
          Retrieves the canonical working directory for a given view.
 void rmviewtag(java.lang.String viewName)
          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
protected  java.lang.String runAndProcessOutput(hudson.util.ArgumentListBuilder cmd, java.io.InputStream in, hudson.FilePath workFolder, boolean catchExceptions, java.util.List<java.io.IOException> exceptions)
           
 void unregisterView(java.lang.String uuid)
          Unregisters the view tag for a given UUID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.plugins.clearcase.ClearTool
mkview, mkview, rmview, setcs, startView, syncronizeViewWithStream, update
 

Field Detail

launcher

protected ClearToolLauncher launcher

variableResolver

protected hudson.util.VariableResolver<java.lang.String> variableResolver
Constructor Detail

ClearToolExec

public ClearToolExec(hudson.util.VariableResolver<java.lang.String> variableResolver,
                     ClearToolLauncher launcher)
Method Detail

getLauncher

public ClearToolLauncher getLauncher()
Description copied from interface: ClearTool
Get the inner CLearToolLauncher.

Specified by:
getLauncher in interface ClearTool
Returns:
The inner CLearToolLauncher.

getRootViewPath

protected abstract hudson.FilePath getRootViewPath(ClearToolLauncher launcher)

lshistory

public java.io.Reader lshistory(java.lang.String format,
                                java.util.Date lastBuildDate,
                                java.lang.String viewName,
                                java.lang.String branch,
                                java.lang.String[] viewPaths)
                         throws java.io.IOException,
                                java.lang.InterruptedException
Description copied from interface: ClearTool
Returns Reader containing output from lshistory.

Specified by:
lshistory in interface ClearTool
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
viewName - 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
viewPaths - 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

lsactivity

public java.io.Reader lsactivity(java.lang.String activity,
                                 java.lang.String commandFormat,
                                 java.lang.String viewname)
                          throws java.io.IOException,
                                 java.lang.InterruptedException
Description copied from interface: ClearTool
Lists activities .......(?)

Specified by:
lsactivity in interface ClearTool
Returns:
reader containing command output
Throws:
java.io.IOException
java.lang.InterruptedException

mklabel

public void mklabel(java.lang.String viewName,
                    java.lang.String label)
             throws java.io.IOException,
                    java.lang.InterruptedException
Description copied from interface: ClearTool
Attaches version labels to versions of elements

Specified by:
mklabel in interface ClearTool
Parameters:
viewName - the name of the view
label - the label name
Throws:
java.io.IOException
java.lang.InterruptedException

lsview

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

Specified by:
lsview in interface ClearTool
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

lscurrentview

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

Specified by:
lscurrentview in interface ClearTool
Returns:
Throws:
java.io.IOException
java.lang.InterruptedException

doesViewExist

public boolean doesViewExist(java.lang.String viewName)
                      throws java.io.IOException,
                             java.lang.InterruptedException
Description copied from interface: ClearTool
Checks whether the given view tag already exists in the ClearCase region.

Specified by:
doesViewExist in interface ClearTool
Parameters:
viewName - the view tag to check
Returns:
true if the view tag exists, false otherwise.
Throws:
java.io.IOException
java.lang.InterruptedException

lsvob

public java.util.List<java.lang.String> lsvob(boolean onlyMounted)
                                       throws java.io.IOException,
                                              java.lang.InterruptedException
Description copied from interface: ClearTool
Lists VOB registry entries

Specified by:
lsvob in interface ClearTool
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

pwv

public java.lang.String pwv(java.lang.String viewName)
                     throws java.io.IOException,
                            java.lang.InterruptedException
Description copied from interface: ClearTool
Retrieves the canonical working directory for a given view.

Specified by:
pwv in interface ClearTool
Parameters:
viewName - the view to use
Returns:
the return from "cleartool pwv"
Throws:
java.io.IOException
java.lang.InterruptedException

catcs

public java.lang.String catcs(java.lang.String viewName)
                       throws java.io.IOException,
                              java.lang.InterruptedException
Description copied from interface: ClearTool
Retrieves the config spec for the specified view name

Specified by:
catcs in interface ClearTool
Parameters:
viewName - the name of the view
Returns:
a string containing the config spec
Throws:
java.io.IOException
java.lang.InterruptedException

mountVobs

public void mountVobs()
               throws java.io.IOException,
                      java.lang.InterruptedException
Description copied from interface: ClearTool
Mounts all VOBs.

Specified by:
mountVobs in interface ClearTool
Throws:
java.io.IOException
java.lang.InterruptedException

getViewData

public java.util.Properties getViewData(java.lang.String viewName)
                                 throws java.io.IOException,
                                        java.lang.InterruptedException
Description copied from interface: ClearTool
Gets the view UUID, for thorough view deletion.

Specified by:
getViewData in interface ClearTool
Throws:
java.io.IOException
java.lang.InterruptedException

endView

public void endView(java.lang.String viewName)
             throws java.io.IOException,
                    java.lang.InterruptedException
Description copied from interface: ClearTool
Ends the view

Specified by:
endView in interface ClearTool
Parameters:
viewName - the name of the view
Throws:
java.io.IOException
java.lang.InterruptedException

rmviewtag

public void rmviewtag(java.lang.String viewName)
               throws java.io.IOException,
                      java.lang.InterruptedException
Description copied from interface: ClearTool
Removes the view tag from the ClearCase registry - used when the view storage in the workspace has already been deleted.

Specified by:
rmviewtag in interface ClearTool
Parameters:
viewName - the name of the view
Throws:
java.io.IOException
java.lang.InterruptedException

unregisterView

public void unregisterView(java.lang.String uuid)
                    throws java.io.IOException,
                           java.lang.InterruptedException
Description copied from interface: ClearTool
Unregisters the view tag for a given UUID.

Specified by:
unregisterView in interface ClearTool
Parameters:
uuid - the unique identifier for the view.
Throws:
java.io.IOException
java.lang.InterruptedException

rmviewUuid

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

Specified by:
rmviewUuid in interface ClearTool
Parameters:
viewUuid - the unique identifier for the view
Throws:
java.io.IOException
java.lang.InterruptedException

runAndProcessOutput

protected java.lang.String runAndProcessOutput(hudson.util.ArgumentListBuilder cmd,
                                               java.io.InputStream in,
                                               hudson.FilePath workFolder,
                                               boolean catchExceptions,
                                               java.util.List<java.io.IOException> exceptions)
                                        throws java.io.IOException,
                                               java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException

logRedundantCleartoolError

public void logRedundantCleartoolError(java.lang.String[] cmd,
                                       java.lang.Exception ex)
Specified by:
logRedundantCleartoolError in interface ClearTool


Copyright © 2010. All Rights Reserved.