Changeset 1124

Show
Ignore:
Timestamp:
01/24/08 14:37:01 (7 months ago)
Author:
mbriggs
Message:

Added AUTOLOAD function to allow various web service functions provided by Drone Ruby Api.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/trunk/lib/HoneyClient/Manager/Database.pm

    r1103 r1124  
    11use strict; 
     2 
     3use YAML qw'freeze thaw Bless'; 
     4use XML::RPC; 
    25 
    36package HoneyClient::Manager::Database; 
    47 
    5 use YAML qw'freeze'; 
    6 use XML::RPC; 
     8our $AUTOLOAD; 
     9 
     10sub AUTOLOAD { 
     11    my $obj = shift; 
     12    my $obj_yaml = YAML::freeze($obj); 
     13    my $name = $AUTOLOAD; 
     14    $name =~  s/.*://; 
     15     
     16    my $xmlrpc = XML::RPC->new('http://localhost:3000/hc_database/api'); 
     17    return $xmlrpc->call($name,$obj_yaml); 
     18
    719 
    820sub insert { 
     
    1123 
    1224    # Execute insert via XML-RPC and return id 
    13     #eval { 
    14         my $xmlrpc = XML::RPC->new('http://172.16.164.103:3000/hc_database/api'); 
     25    eval { 
     26        my $xmlrpc = XML::RPC->new('http://localhost:3000/hc_database/api'); 
    1527        return $xmlrpc->call("insert",$class,$obj_yaml); 
    16     #}; 
    17     #if ($@) { 
    18     #   return 0; 
    19     #} 
    20 
    21  
    22 #TODO: Implement this method to retrieve web links to visit. 
    23 sub retrieve_urls { 
    24     my ($client_id,$count) = @_; 
    25 
    26  
    27 #TODO: Implement this method to submit a list of web links to the queue. 
    28 sub submit_urls { 
     28    }; 
     29    if ($@) { 
     30        return 0; 
     31    } 
    2932} 
    3033