More changes to Clearcase and Clearquest stuff
[clearscm.git] / lib / Clearcase / UCM / Pvob.pm
1 =pod
2
3 =head1 NAME $RCSfile: Pvob.pm,v $
4
5 Object oriented interface to a UCM Pvob
6
7 =head1 VERSION
8
9 =over
10
11 =item Author
12
13 Andrew DeFaria <Andrew@ClearSCM.com>
14
15 =item Revision
16
17 $Revision: 1.1 $
18
19 =item Created
20
21 Fri May 14 18:16:16 PDT 2010
22
23 =item Modified
24
25 $Date: 2011/11/09 01:52:39 $
26
27 =back
28
29 =head1 SYNOPSIS
30
31 Provides access to information about a Clearcase Pvob.
32
33   my $pvob = new Clearcase::UCM::Pvob ($name);
34
35 =head1 DESCRIPTION
36
37 This module implements a UCM Pvob object
38
39 =head1 ROUTINES
40
41 The following routines are exported:
42
43 =cut
44
45 package Clearcase::UCM::Pvob;
46
47 use strict;
48 use warnings;
49
50 use parent 'Clearcase::Vob';
51
52 use Carp;
53
54 sub new ($) {
55   my ($class, $tag) = @_;
56   
57 =pod
58
59 =head2 new
60
61 Construct a new Clearcase Pvob object.
62
63 Parameters:
64
65 =for html <blockquote>
66
67 =over
68
69 =item name
70
71 Name of pvob
72
73 =back
74
75 =for html </blockquote>
76
77 Returns:
78
79 =for html <blockquote>
80
81 =over
82
83 =item Clearcase Pvob object
84
85 =back
86
87 =for html </blockquote>
88
89 =cut  
90
91   croak 'Clearcase::UCM::Pvob: Must specify pvob tag' unless $tag;
92
93   $class = bless {
94     tag        => $tag,
95     ucmproject => 1,
96   }, $class; # bless
97     
98   $class->updateVobInfo;
99
100   return $class; 
101 } # new
102   
103 sub tag() {
104   my ($self) = @_;
105
106 =pod
107
108 =head2 tag
109
110 Returns the tag of the pvob
111
112 Parameters:
113
114 =for html <blockquote>
115
116 =over
117
118 =item none
119
120 =back
121
122 =for html </blockquote>
123
124 Returns:
125
126 =for html <blockquote>
127
128 =over
129
130 =item tag
131
132 =back
133
134 =for html </blockquote>
135
136 =cut
137     
138   return $self->{tag};
139 } # tag
140
141 # Alias name to tag
142 sub name() {
143   goto &tag;
144 } # name
145
146 sub streams () {
147   my ($self) = @_;
148   
149 =pod
150
151 =head2 streams
152
153 Returns an array of stream objects in the pvob
154
155 Parameters:
156
157 =for html <blockquote>
158
159 =over
160
161 =item none
162
163 =back
164
165 =for html </blockquote>
166
167 Returns:
168
169 =for html <blockquote>
170
171 =over
172
173 =item array of stream objects in the pvob
174
175 =back
176
177 =for html </blockquote>
178
179 =cut  
180
181   my $cmd = "lsstream -short -invob $self->{name}";
182   
183   $Clearcase::CC->execute ($cmd);
184   
185   return if $Clearcase::CC->status;
186   
187   my @streams;
188
189   push @streams, Clearcase::UCM::Stream->new ($_, $self->{name})
190     for ($Clearcase::CC->output);
191
192   return @streams;  
193 } # streams
194   
195 1;
196
197 =head1 DEPENDENCIES
198
199 =head2 ClearSCM Perl Modules
200
201 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a></p>
202
203 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase/UCM/Baseline.pm">Clearcase::UCM::Baseline</a></p>
204
205 =head1 INCOMPATABILITIES
206
207 None
208
209 =head1 BUGS AND LIMITATIONS
210
211 There are no known bugs in this module.
212
213 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
214
215 =head1 LICENSE AND COPYRIGHT
216
217 Copyright (c) 2007, ClearSCM, Inc. All rights reserved.
218
219 =cut