# Copyright 1999-2012. Parallels IP Holdings GmbH. All Rights Reserved.
package Storage::DbBundle;

use strict;
use Storage::Bundle;
use Db::Connection;
use vars qw|@ISA|;

@ISA = qw|Storage::Bundle|;

sub _init {
  my ($self, %params) = @_;
  $self->SUPER::_init(%params);

  $self->{params} = \%params;

  return 1;
}

sub commandLine {
  my ($self) = @_;
  return Db::Connection::getDumpCmdLine(%{$self->{params}});
}

sub isLogAllowed {
  my ($self) = @_;
  return Db::Connection::isLogAllowed();
}

sub cleanup {
  my ($self) = @_;

  my $exit_code = $self->SUPER::cleanup();
  
  my @files = Db::Connection::getFileToRemove(%{$self->{params}});
  
  foreach my $file (@files) {
    unlink $file;
  }

  return $exit_code;
}


1;