#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::Mechanical::Job::CommitMechanicalRun;

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/rps/lib';
use RPS::Config;

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

# We won't have this inherit from the 'Base' class, mostly because I don't want these
# jobs to log in the same place.
use base 'Job::Job';


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

    my $runID = $self->getCommandLineArg('runID');
    assert($runID);

    my $clientID = $self->clientID();

    my $logLevel = $self->getCommandLineArg('logLevel');
    $logLevel = 4 unless $logLevel;


    my $config = RPS::Config->new();
    my $scriptPath = $config->get('royalty_script_dir');

    my $commandLine = "nice $scriptPath/".$self->_scriptName()." -c $clientID -r $runID -V$logLevel";

    return $commandLine;
}

sub _defaultClass       { return 'RunUtility'; }
sub _defaultPriority    { return Job::Job::kPriorityHigh; }

sub _defaultSubclass    { assert(0, 'override this'); }
sub _scriptName         { assert(0, 'override this'); }

###
1;#
###

