package Report::CronScript;

use lib '/app/tools/common/lib';
use lib '/app/tools/rps/lib';
use lib '/app/tools/bookpub/lib';

use base 'Common::CronScript';

# Right now reports only work for RPS clients.  When we extend this to BookPub
# land we will need to update this.

sub _getProductionClientIDs {
    return Common::RSDB::GetAllRPSClientIDs();
}

sub _getWebProductionClientIDs {
    return Common::RSDB::GetRPSClientIDs( Common::RSApp::GetRealHostname() );
}

sub _getLocalClientIDs {
    return Common::RSDB::GetLocalRPSClientIDs();
}

sub _isValidClientType {
    my $self = shift;
    Common::RSDB::_isRPSClient(shift);
}

sub _reportFactory {
    my $self    = shift;
    my $factory = 'RPS::Report::Dynamic::Factory';

    eval "require $factory";

    die $@ if ($@);

    return $factory;
}

1;
