App-MBUtiny

 view release on metacpan or  search on metacpan

lib/App/MBUtiny/Collector.pm  view on Meta::CPAN


    my @collector_list = $collector->collectora;

Returns list of initialized collectors

=head2 dbi

    my $dbi = $collector->dbi;

Returns DBI object of local database (local collector)

=head2 error

    print $collector->error("Foo"); # Foo
    print $collector->error("Bar"); # Foo\nBar
    print $collector->error; # Foo\nBar
    print $collector->error(""); # <"">

Sets and gets the error pool

=head2 fixup

    my @collector_ids = $collector->fixup(
        operation => "del",
        name => "foo",
        file => "foo-2019-06-25.tar.gz",
    );

Fixation of the "del" operation on current storage

    my @collector_ids = $collector->fixup(
        operation => "put",
        name => "foo",
        file => "foo-2019-06-25.tar.gz",
        size => 123453,
        md5 => "...",
        sha1 => "...",
        status => 1,
        error => "...",
        comment => "...",
    );

Fixation of the "put" operation on current storage

=over 4

=item B<comment>

Comment of the "put" operation

Scope: put

=item B<error>

Error message of the performed operation

Scope: put

=item B<file>

Name of backup file. Required argument

Scope: put, del

=item B<md5>, B<sha1>

MD5 and SHA1 checksums of backup file

Scope: put

=item B<name>

Name of backup. Required argument

Scope: put, del

=item B<operation>

Name of operation: del/put

Default: put

=item B<size>

Size of backup file

Scope: put

=item B<status>

Status of backup operation: 0 or 1

Default: 0 (operation failed)

Scope: put

=back

=head2 info

    my %info = $collector->info(
        name => "foo",
        file => "foo-2019-06-25.tar.gz",
    );

Gets information about specified file name

Returns hash of values in "AS IN DATABASE DEFINED" format,
see L<App::MBUtiny::Collector::DBI>

=head2 report

    my @last_backup_files = $collector->report( start => 123456789 );

Returns list of last backups from all collectors as array of info-hashes.

See L</info> method

=head1 PUBLIC FUNCTIONS

=head2 int2type

    my $type = int2type(0); # internal

Returns name of specified type

NOTE: This variable NOT imported automatically

=head1 VARIABLES

=head2 COLLECTOR_TYPES

Returns hash-structure ("type_name" => int_value) of available collector types

NOTE: This variable imported automatically

=head1 HISTORY

See C<Changes> file

=head1 TO DO

See C<TODO> file

=head1 SEE ALSO

L<App::MBUtiny>

=head1 AUTHOR

Serż Minus (Sergey Lepenkov) L<http://www.serzik.com> E<lt>abalama@cpan.orgE<gt>

=head1 COPYRIGHT

Copyright (C) 1998-2019 D&D Corporation. All Rights Reserved

=head1 LICENSE

This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

See C<LICENSE> file and L<https://dev.perl.org/licenses/>

=cut

use vars qw/ $VERSION @EXPORT @EXPORT_OK /;
$VERSION = '1.03';

use Carp;
use CTK::ConfGenUtil;
use CTK::TFVals qw/ :ALL /;
use App::MBUtiny::Collector::DBI;
use App::MBUtiny::Collector::Client;
use App::MBUtiny::Util qw/hide_password/;



( run in 1.255 second using v1.01-cache-2.11-cpan-39bf76dae61 )