#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::Catalog::Command::DistributionCache;
use strict;
use warnings;

use lib '/app/tools/rps/lib';
use RPS::Catalog::DistributionCache;

use base 'RSApache::Command::XMLCommand';

use lib '/app/tools/common/lib';
use RSApache::Response::JSON;

use lib '/app/tools/appuser/lib';
use AppUser::DB::Item::AccessLevel;

sub cmd  { return 'dist_cache'; }
sub area { return 'catalog'; }

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

    my $response = $self->SUPER::execute();
    return $response if $response;

    my $result = new RPS::Catalog::DistributionCache();
    my $output = $result->refreshCache();

    $response = RSApache::Response::JSON->new($output);

    return $response;
}

1;
