package Report::Dynamic::Job::RunReport;

use strict;
use warnings;

use Sys::Hostname;

use lib '/app/tools/common/lib';
use Common::Log;
use Common::Assert;
use Common::RSApp;

use lib '/app/tools/job/lib';
use Job::Job;

use lib '/app/tools/report/lib';
use Report::Config;

use base 'Job::Job';

sub _defaultClass    { return 'Report'; }
sub _defaultSubclass { return 'DynamicReport'; }
sub _defaultPriority { return Job::Job::kPriorityNormal; }

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

    # Let's go ahead and construct everything now.
    #
    my $clientID = $self->clientID();

    my $reportID = $self->getCommandLineArg('reportID');
    assert( $reportID, "ERROR - missing reportID" );

    my $config       = Report::Config->new();
    my $reportScript = $config->get('report_script');

    my $commandLine = "nice $reportScript -c $clientID -y $reportID";
    return $commandLine;
}

###
1;    #
###

