#------------------------------------------------------------
# Copyright (C) 2008 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package BookPub::Tracker::Job::DumpReconciliationReport;

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/bookpub/lib';
use BookPub::Config;

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

use base 'Job::Job';

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

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

    if ( !$clientID ) {
        $clientID = $self->clientID();
    }

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

    my $config     = BookPub::Config->new();
    my $scriptPath = $config->get('dump_report_script_dir');

    my $commandLine = "nice $scriptPath/dump_reconciliation_report.pl -c $clientID -p " . $periodID;

    return $commandLine;
}

# why bother logging someplace special?
#
#sub generateLogBasePath
#{
#    my ($self) = @_;
#
#    my $config = BookPub::Config->new();
#    return $config->get('dump_report_log_dir');
#}

sub _defaultClass    { return 'Tracker'; }
sub _defaultSubclass { return 'DumpReconciliationReport'; }
sub _defaultPriority { return Job::Job::kPriorityNormal; }

###
1;    #
###

