# Copyright 1999-2014. Parallels IP Holdings GmbH. All Rights Reserved.
package ContentDumper;

use strict;

use Dumper;
use Parser;
use Logging;
use Mailman;
use XmlNode;
use HelpFuncs;
use Db::Connection;
use Storage::Storage;
use Storage::ContentNameCreator;
use ContentTransport::Rsync;
use ContentTransport::Archive;

use vars qw|@ISA|;

sub new {
  my $self = {};
  bless( $self, shift );
  $self->_init(@_);
  return $self;
}

sub _init {
  my ( $self, $storagepolicy ) = @_;
  $self->{storage} = $storagepolicy;
  $self->{namecreator} = Storage::ContentNameCreator->new();
  
  $self->{content_transport_type} = 'archive';
  $self->{archive_transport} = ContentTransport::Archive->new( $_[0], $self->{storage} );
  # always use archive content transport for some cids (sql_dump, error_docs)
  $self->{content_transport} = $self->{archive_transport};
}

sub getContentTransportDescription {
  my $self = shift;
  return $self->{content_transport}->getContentTransportDescription();
}

1;
