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

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/raptor/lib';
use Raptor::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     = Raptor::Config->new();
    my $scriptPath = $config->get('dump_report_script_dir');

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

    return $commandLine;
}

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

    my $config = Raptor::Config->new();
    return $config->get('dump_report_log_dir');
}

sub _defaultClass    { return 'Tracker'; }
sub _defaultSubclass { return 'DumpRoyaltyReport'; }
sub _defaultHostname { return 'rpsapp04'; }                  # !!!  Only run these on rpsapp04 for the emi trial
sub _defaultPriority { return Job::Job::kPriorityNormal; }

###
1;                                                           #
###

