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

# !!! This seems to be deprecated now: use RPS::Mechanical::Job::Base

use strict;
use warnings;

use Sys::Hostname;

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

use lib '/app/tools/rps/lib';
use RPS::Config;

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

use base 'Job::Job';

sub _defaultClass {
    my ($class) = @_;
    assert( 0, 'override this' );
}

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

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

    return LogFilePath( $clientID, $runID );
}

# I'm making this a static public method, so I can somewhat abstractly generate paths
# from things like the delete script (which won't have a Job object to kick around).
#
sub LogFilePath {
    my ( $clientID, $runID ) = @_;
    assert($clientID);
    assert($runID);

    my $rpsConfig = RPS::Config->new();
    my $basePath  = $rpsConfig->get('royalty_log_dir');

    my $clientData = Common::DB::Item::Client->Lookup( client_id => $clientID );

    $basePath .= '/' . $clientData->client_name_clean . "/uk_mechanical/$runID";

    return $basePath;
}

###
1;    #
###

