#---------------------------------------------------------------
# ____                   _ _         ____  _
#|  _ \ ___  _   _  __ _| | |_ _   _/ ___|| |__   __ _ _ __ ___
#| |_) / _ \| | | |/ _` | | __| | | \___ \| '_ \ / _` | '__/ _ \
#|  _ < (_) | |_| | (_| | | |_| |_| |___) | | | | (_| | | |  __/
#|_| \_\___/ \__, |\__,_|_|\__|\__, |____/|_| |_|\__,_|_|  \___|
#            |___/             |___/
#
# Copyright (C) 2008 RoyaltyShare, Inc.      All Rights Reserved
#---------------------------------------------------------------
package Job::DB::Item::JobHost;
use strict;
use warnings;

use lib '/app/tools/common/lib';
use Common::Assert;
use Common::DB::Item;
use Common::DB::Item::TableState;

use base 'Common::DB::Item';

use constant kTable => 'job_host';
use constant kDB    => Common::DB::Item::kCommonDB;

use constant kStaleHeartbeatThreshold => 600;    # 10 minutes

# Overriding the inherited 'save' method to update this table's entry
# in the 'table_state' table.
# This is just a mechanism we can use to quickly tell whether the table has changed.
#
sub DEPRECATEDsave {
    my ($self) = @_;

    if ( $self->isDirty() ) {

        # We've changed the state of our table, so update the table_state table to reflect that.
        #
        Common::DB::Item::TableState->MarkTableAsChanged(kTable);
    }

    return $self->SUPER::save();
}

sub StateToken {
    return Job::DB::Item::JobHost->GetTableStatusHash()->{Update_time};

    #    return Common::DB::Item::TableState->GetTokenForTable(kTable);
}

###
1;    #
###

