db5093a499d4bdb82271a471f988b524fe8bc095
[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 Clearcase;
51 use Clearcase::UCM::Stream;
52
53 sub new ($) {
54   my ($class, $name) = @_;
55   
56 =pod
57
58 =head2 new
59
60 Construct a new Clearcase Pvob object.
61
62 Parameters:
63
64 =for html <blockquote>
65
66 =over
67
68 =item pvob name
69
70 Name of pvob
71
72 =back
73
74 =for html </blockquote>
75
76 Returns:
77
78 =for html <blockquote>
79
80 =over
81
82 =item Clearcase Pvob object
83
84 =back
85
86 =for html </blockquote>
87
88 =cut  
89
90   my $self = bless {
91     name => $name,
92   }, $class; # bless
93     
94   return $self; 
95 } # new
96   
97 sub name () {
98   my ($self) = @_;
99
100 =pod
101
102 =head2 name
103
104 Returns the name of the pvob
105
106 Parameters:
107
108 =for html <blockquote>
109
110 =over
111
112 =item none
113
114 =back
115
116 =for html </blockquote>
117
118 Returns:
119
120 =for html <blockquote>
121
122 =over
123
124 =item pvob's name
125
126 =back
127
128 =for html </blockquote>
129
130 =cut
131     
132   return $self->{name};
133 } # name
134
135 sub streams () {
136   my ($self) = @_;
137   
138 =pod
139
140 =head2 streams
141
142 Returns an array of stream objects in the pvob
143
144 Parameters:
145
146 =for html <blockquote>
147
148 =over
149
150 =item none
151
152 =back
153
154 =for html </blockquote>
155
156 Returns:
157
158 =for html <blockquote>
159
160 =over
161
162 =item array of stream objects in the pvob
163
164 =back
165
166 =for html </blockquote>
167
168 =cut  
169
170   my $cmd = "lsstream -short -invob $self->{name}";
171   
172   $Clearcase::CC->execute ($cmd);
173   
174   return if $Clearcase::CC->status;
175   
176   my @streams;
177
178   push @streams, Clearcase::UCM::Stream->new ($_, $self->{name})
179     foreach ($Clearcase::CC->output);
180
181   return @streams;  
182 } # streams
183   
184 1;
185
186 =head1 DEPENDENCIES
187
188 =head2 ClearSCM Perl Modules
189
190 =for html <p><a href="/php/cvs_man.php?file=lib/Clearcase.pm">Clearcase</a></p>
191
192 =for html <p><a href="/php/cvs_man.php?file=lib/Clearcase/UCM/Baseline.pm">Clearcase::UCM::Baseline</a></p>
193
194 =head1 INCOMPATABILITIES
195
196 None
197
198 =head1 BUGS AND LIMITATIONS
199
200 There are no known bugs in this module.
201
202 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
203
204 =head1 LICENSE AND COPYRIGHT
205
206 Copyright (c) 2007, ClearSCM, Inc. All rights reserved.
207
208 =cut