#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
#------------------------------------------------------------
package Support::JobQueue::Command::HostStatusAjax;

use lib '/app/tools/common/lib';
use RSApache::Response::XSLT;
use RSApache::Command::XMLCommand;
use RSApache::Message;
use Common::Client::ClientList;
use Common::Preference;

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

use lib '/app/tools/support/lib';
use base 'Support::Command::AJAX';

use constant kTemplate => '/app/tools/support/templates/job_queue/gethoststatus.xsl';

sub cmd  { return "gethoststatus"; }
sub area { return "job_queue"; }

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

    my $host = $self->getParam('host');

    # Give any inherited methods the first crack at this.
    # (This checks for login and basic access permissions).
    #
    my $response = $self->SUPER::execute();
    return $response if $response;

    $self->{xml}{JobHostStatus} = Job::JobHostList->new( hostname => $host, );

    #    $self->{xml}{ClientList} = Common::Client::ClientList->new();
    $response = RSApache::Response::XSLT->new( $self->{xml}, kTemplate );

    return $response;
}

1;

