cleaning cycle; in this case, the user will just need to delay further Amanda
activities until the cleaning is complete.
+=head3 $chg->eject(finished_cb => $cb, drive => $drivename)
+
+Eject the volume in a drive, if the changer supports it. Drivename is as
+specified to C<clean>. If possible, applications should prefer to eject a
+reserved volume when finished with it (C<< $res->release(eject => 1) >>), to
+ensure that the correct volume is ejected from a multi-drive changer.
+
=head3 $chg->update(finished_cb => $cb, changed => $changed)
The user has changed something -- loading or unloading tapes,
}
}
+sub eject {
+ my $self = shift;
+ my %params = @_;
+
+ my $class = ref($self);
+ if (exists $params{'finished_cb'}) {
+ $params{'finished_cb'}->("$class does not support eject()");
+ }
+}
+
sub update {
my $self = shift;
my %params = @_;
$self->{'released'} = 1;
$self->do_release(%params);
-
- if (exists $params{'finished_cb'}) {
- Amanda::MainLoop::call_later($params{'finished_cb'}, undef);
- }
}
sub do_release {
+ my $self = shift;
+ my %params = @_;
+
# this is the one subclasses should override
+
+ if (exists $params{'finished_cb'}) {
+ Amanda::MainLoop::call_later($params{'finished_cb'}, undef);
+ }
}
1;