• Home
  • Services
    • Consultancy
    • Custom Software Solutions
    • Systems Adminsitration
    • SCM
      • Clearcase
      • Multisite
      • Clearquest
      • Release Managment
      • CVS
    • Web Applications
    • Customers
  • Publications
    • Clearcase
      • Triggers
      • Open Source Builds
    • Clearquest
      • Clearquest Daemon
      • DB Conversions
    • Systems Admin
      • Unix/Linux
      • Windows
    • Scripting
      • Perl
      • PHP
      • ECRDig
  • About
    • Services
    • Our People
    • Our Philosophy
    • Contact Us
 

ClearSCM Inc.

You are viewing an unstyled version of this page. Either your browser does not support Cascading Style Sheets (CSS) or CSS styling has been disabled.

NAME Vob.pm

Object oriented interface to a Clearcase VOB

VERSION

Author

Andrew DeFaria <Andrew@ClearSCM.com>

Revision

Revision 1.8

Created

Thu Dec 29 12:07:59 PST 2005

Modified

Modifed 2008/02/29 15:08:56

SYNOPSIS

Provides access to information about a Clearcase VOB. Note that information about the number of elements, branches, etc. that is provided by countdb are not initially instantiated with the VOB object, rather those member variables are expanded if and when accessed. This helps the VOB object to be more efficient.

 # Create VOB object
 my $vob = new Clearcase::Vob (tag => "/vobs/test");

 # Access member variables...
 display "Tag:\t\t"             . $vob->tag;
 display "Global path:\t"       . $vob->gpath;
 display "Sever host:\t"        . $vob->shost;
 display "Access:\t\t"          . $vob->access;
 display "Mount options:\t"     . $vob->mopts;
 display "Region:\t\t"          . $vob->region;
 display "Active:\t\t"          . $vob->active;
 display "Replica UUID:\t"      . $vob->replica_uuid;
 display "Host:\t\t"            . $vob->host;
 display "Access path:\t"       . $vob->access_path;
 display "Family UUID:\t"       . $vob->family_uuid;

 # This members are not initially expanded until accessed
 display "Elements:\t"          . $vob->elements;
 display "Branches:\t"          . $vob->branches;
 display "Versions:\t"          . $vob->versions;
 display "DB Size:\t"           . $vob->dbsize;
 display "Adm Size:\t"          . $vob->admsize;
 display "CT Size:\t"           . $vob->ctsize;
 display "DO Size:\t"           . $vob->dbsize;
 display "Src Size:\t"          . $vob->srcsize;
 display "Size:\t\t"            . $vob->size;

 # VOB manipulation
 display "Umounting " . $vob->tag . "...";

 $vob->umount;

 display "Mounting " . $vob->tag . "...";

 $vob->mount;

DESCRIPTION

This module, and others below the Clearcase directory, implement an object oriented approach to Clearcase. In general Clearcase entities are made into objects that can be manipulated easily in Perl. This module is the main or global module. Contained herein are members and methods of a general or global nature. Also contained here is an IPC interface to cleartool such that cleartool runs in the background and commands are fed to it via the exec method. When making repeated calls to cleartool this can result in a substantial savings of time as most operating systems' fork/exec sequence is time consuming. Factors of 8 fold improvement have been measured.

Additionally a global variable, $cc, is implemented from this module such that you should not need to instantiate another one, though you could.

ROUTINES

The following routines are exported:

new (tag)

Construct a new Clearcase VOB object. Note that not all members are initially populated because doing so would be time consuming. Such member variables will be expanded when accessed.

Parameters:

tag

VOB tag to be instantiated. You can use either an object oriented call (i.e. my $vob = new Clearcase::Vob (tag => ``/vobs/test'')) or the normal call (i.e. my $vob = new Clearcase::Vob (``/vobs/test'')). You can also instantiate a new vob by supplying a tag and then later calling the create method.

Returns:

Clearcase VOB object

tag

Returns the VOB's tag

Parameters:

none

Returns:

VOB's tag

gpath

Returns the VOB's global path

Parameters:

none

Returns:

VOB's gpath

shost

Returns the VOB's server host

Parameters:

none

Returns:

VOB's server host

access

Returns the type of VOB access

Parameters:

none

Returns:

access

Returns either public for public VOBs or private for private VOBs

mopts

Returns the mount options

Parameters:

none

Returns:

VOB's mount options

region

Returns the region for this VOB tag

Parameters:

none

Returns:

region

active

Returns that active status (whether or not the vob is currently mounted) of the VOB

Parameters:

none

Returns:

Returns YES for an active VOB or NO for an inactive one

replica_uuid

Returns the VOBS replica_uuid

Parameters:

none

Returns:

VOB replica_uuid

host

Returns the VOB's host

Parameters:

none

Returns:

VOB's host

access_path

Returns the VOB's access path

Parameters:

none

Returns:

VOB access path

This is the path relative to the VOB's host

family_uuid

Returns the VOB family UUID

Parameters:

none

Returns:

VOB family UUID

elements

Returns the number of elements in the VOB (obtained via countdb)

Parameters:

none

Returns:

number of elements

branches

Returns the number of branch types in the vob

Parameters:

none

Returns:

number of branch types

versions

Returns the number of element versions in the VOB

Parameters:

none

Returns:

number of element versions

dbsize

Returns the size of the VOB's database

Parameters:

none

Returns:

database size

admsize

Returns the size of administrative data in the VOB

Parameters:

none

Returns:

adminstrative size

ctsize

Returns the size of the cleartext pool

Parameters:

none

Returns:

cleartext pool size

dosize

Returns the size of the derived object pool

Parameters:

none

Returns:

derived object pool size

srcsize

Returns the size of the source pool

Parameters:

none

Returns:

source pool size

size

Returns the size of the VOB

Parameters:

none

Returns:

size

mount

Mount the current VOB

Parameters:

none

Returns:

$status

Status of the mount command

@output

An array of lines output from the cleartool mount command

umount

Unmounts the current VOB

Parameters:

none

Returns:

$status

Status from cleartool

@output

Ouput from cleartool

exists

Returns true or false if the VOB exists

Parameters:

none

Returns:

boolean

create

Creates a VOB. First instantiate a VOB object with a tag. Then call create. A small subset of parameters is supported for create.

Parameters:

$host (optional)

Host to create the vob on. Default is the current host.

$vbs (optional)

VOB storage area. This is a global pathname to the VOB storage area. Default will attempt to use -stgloc -auto.

$comment (optional)

Comment for this VOB's creation. Default is -nc

Returns:

$status

Status from cleartool

@output

Ouput from cleartool

remove

Removed this VOB

Parameters:

none

Returns:

$status

Status from cleartool

@output

Ouput from cleartool