0b3994939c218350c6f239255d0ea44211b0e76c
[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 # Would be better represented by use parent "Clearcase::Vob" but we're
51 # working with old versions of Perl here...
52 use base 'Clearcase::Vob';
53
54 use Carp;
55
56 sub new ($) {
57   my ($class, $tag) = @_;
58   
59 =pod
60
61 =head2 new
62
63 Construct a new Clearcase Pvob object.
64
65 Parameters:
66
67 =for html <blockquote>
68
69 =over
70
71 =item name
72
73 Name of pvob
74
75 =back
76
77 =for html </blockquote>
78
79 Returns:
80
81 =for html <blockquote>
82
83 =over
84
85 =item Clearcase Pvob object
86
87 =back
88
89 =for html </blockquote>
90
91 =cut  
92
93   croak 'Clearcase::UCM::Pvob: Must specify pvob tag' unless $tag;
94
95   $class = bless {
96     tag => $tag,
97   }, $class; # bless
98     
99   $class->updateVobInfo;
100
101   return $class; 
102 } # new
103   
104 sub create (;$$$%) {
105   my ($self, $host, $vbs, $comment, %opts) = @_;
106
107 =pod
108
109 =head2 create
110
111 Creates a pvob
112
113 Parameters:
114
115 =for html <blockquote>
116
117 =over
118
119 =item none
120
121 =back
122
123 =for html </blockquote>
124
125 Returns:
126
127 =for html <blockquote>
128
129 =over
130
131 =item none
132
133 =back
134
135 =for html </blockquote>
136
137 =cut
138
139   $opts{ucmproject} = undef;
140
141   return $self->SUPER::create ($host, $vbs, $comment, %opts);
142 } # create
143
144 sub tag() {
145   my ($self) = @_;
146
147 =pod
148
149 =head2 tag
150
151 Returns the tag of the pvob
152
153 Parameters:
154
155 =for html <blockquote>
156
157 =over
158
159 =item none
160
161 =back
162
163 =for html </blockquote>
164
165 Returns:
166
167 =for html <blockquote>
168
169 =over
170
171 =item tag
172
173 =back
174
175 =for html </blockquote>
176
177 =cut
178     
179   return $self->{tag};
180 } # tag
181
182 # Alias name to tag
183 sub name() {
184   goto &tag;
185 } # name
186
187 sub streams () {
188   my ($self) = @_;
189   
190 =pod
191
192 =head2 streams
193
194 Returns an array of stream objects in the pvob
195
196 Parameters:
197
198 =for html <blockquote>
199
200 =over
201
202 =item none
203
204 =back
205
206 =for html </blockquote>
207
208 Returns:
209
210 =for html <blockquote>
211
212 =over
213
214 =item array of stream objects in the pvob
215
216 =back
217
218 =for html </blockquote>
219
220 =cut  
221
222   my $cmd = "lsstream -short -invob $self->{name}";
223   
224   $Clearcase::CC->execute ($cmd);
225   
226   return if $Clearcase::CC->status;
227   
228   my @streams;
229
230   push @streams, Clearcase::UCM::Stream->new ($_, $self->{name})
231     for ($Clearcase::CC->output);
232
233   return @streams;  
234 } # streams
235   
236 1;
237
238 =head1 DEPENDENCIES
239
240 =head2 ClearSCM Perl Modules
241
242 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase.pm">Clearcase</a></p>
243
244 =for html <p><a href="/php/scm_man.php?file=lib/Clearcase/UCM/Baseline.pm">Clearcase::UCM::Baseline</a></p>
245
246 =head1 INCOMPATABILITIES
247
248 None
249
250 =head1 BUGS AND LIMITATIONS
251
252 There are no known bugs in this module.
253
254 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
255
256 =head1 LICENSE AND COPYRIGHT
257
258 Copyright (c) 2007, ClearSCM, Inc. All rights reserved.
259
260 =cut