CQCC::CCase - Base class to manage communications with ClearCase
This class provides a base class for all ClearCase interfaces and also
manages a standard interface to ClearCase using external cleartool
processes. The CCase class is used by default; to select a different
subclass the configuration file must ask for it as the
ClearCaseInterface class as shown above in the TriggerConfig.pl file.
&SetConfigParm(``ClearCaseInterface'', ``CQCC::CCase'');
SUPPORT POLICY: See TriggerCQCC.pm for the Rational Support Policy.
ClassInit()
-
This class function is automatically invoked to define class
parameters using CQCC::Parm objects. Current parameters include:
CLEARCASE_OP_KIND
-
ClearCase environment variable for the requested operation type.
CLEARCASE_PN
-
ClearCase environment variable for the unextended pathname.
CLEARCASE_XPN
-
ClearCase environment variable for the extended pathname.
CLEARCASE_VOB_PN
-
ClearCase environment variable for the VOB pathname.
ClearCaseInterface
-
Name of CCase subclass to use for this session, used by
IOClassFactory(). Set to ``CQCC::CCase'' by default.
ClassTest(@args)
-
This class function uses sets up a local environment for testing;
calls
IOClassFactory()
to get an instance of the desired subclass;
and invokes the object's SelfTest method for testing.
EditLinks($AddAssocList, $DeleteAssocList)
-
This method changes the current associations being maintained in
ClearCase by adding the items in the AddAssocList and deleting those
in the DeleteAssocList. It will complain about preexisting links
that may be overridden but it will not take special action on them.
ExistingAssocList()
-
This method gets the current association LinkKeys hash list and
converts it to an AssocList for return.
GetVOList( "PN" or "XPN")
-
This method is used to retrieve a list containing the pathname (PN) or
extended pathname (XPN), VOB uuid, and object ID for the current
version; a fourth element includes the old OID (checkin needs to know
both checkout and checkin OIDs). When used in a scalar context it
returns a string with a comma separated list instead.
($cqname, $uuid, $oid, $oldOID) = $cc->GetVOList(pathname);
LinkKeys()
-
Internal method used to retrieve the existing hyperlinks from
ClearCase for the current version being worked on. The returned hash
list associates keys (CQRequests in the form <entity>:<db><00000nnn>,
i.e. ``defect:SAMPL00000008'') with ClearCase CrmRequest hyperlinks
(<linktype>@<id>@<vobtag>, i.e. ``CrmRequest@0700@\cqcc_test''.
%linkKeysList = $cc->LinkKeys()>
Once built, it is stored locally in an object instance variable for
later reference and will be modified by EditLink()
operations in
parallel with commands to ClearCase to change the associations to
avoid the need to reload the array each time a change is made.
Note: The Entity name should be expected to vary with different links
so derive per link as needed.
new CQCC::CCase()
-
This method presets the objects attributes to read in the basic
ClearCase trigger environment values (PN, XPN, VOB_PN); defines the
hyperlink type name and ClearTool process pathname; and presets the
data list to empty.
PostCommand($operation)
-
This method sends a ClearCase command to ClearTool and
returns an array of output lines.
@resultLines = $cc->PostCommand($operation);
_PostCommandPiped($cmd)
-
This internal method manages the cleartool connection using a two
way pipeline and is used when the USE_PIPE attribute is enabled.
@resultLines = $cc->_PostCommandPiped($cmd);
SelfTest(@args)
-
This method runs basic unit testing on the object instance which
currently includes creating hyperlinks; displaying the current
hyperlinks to show that they exist; deleting the new hyperlinks;
and then displaying the current hyperlinks to show confirm deletion.
SetXPN(vob_pn, xpn)
-
This method overrides the environment settings for the VOB_PN and
XPN values from the provided arguments. It also adjusts the PN
value as well. It is intended only for use by command line operations
that are not being invoked through the ClearCase environment.
UnCheckout($pathname)
-
This method unchecks out the provided pathname. This is used when
a postop checkout operation fails as a way to cancel the checkout
operation.