source: ocsinventory-agent/trunk/fuentes/lib/Ocsinventory/Agent/XML/Response.pm @ 468

Last change on this file since 468 was 468, checked in by mabarracus, 4 years ago

Copyt trusty code

File size: 1.0 KB
Line 
1package Ocsinventory::Agent::XML::Response;
2
3use strict;
4use warnings;
5
6use XML::Simple;
7use Data::Dumper;
8
9sub new {
10    my (undef, $params) = @_;
11
12    my $self = {};
13
14    $self->{accountconfig} = $params->{accountconfig};
15    $self->{accountinfo} = $params->{accountinfo};
16    $self->{content}  = $params->{content};
17    $self->{config} = $params->{config};
18    $self->{common} = $params->{common};
19    my $logger = $self->{logger}  = $params->{logger};
20    $self->{origmsg}  = $params->{origmsg};
21
22    $logger->debug("=BEGIN=SERVER RET======");
23    $logger->debug(Dumper($self->{content}));
24    $logger->debug("=END=SERVER RET======");
25
26    $self->{parsedcontent}  = undef;
27
28    bless $self;
29}
30
31sub getRawXML {
32    my $self = shift;
33
34    return $self->{content};
35}
36
37sub getParsedContent {
38    my ($self,$forcearray) = @_;
39
40    if(!$self->{parsedcontent}) {
41        $self->{parsedcontent} = $self->{common}->readXml($self->{content},$forcearray);
42    }
43
44    return $self->{parsedcontent};
45}
46
47sub origMsgType {
48    my ($self, $package) = @_;
49
50    return ref($package);
51}
52
531;
Note: See TracBrowser for help on using the repository browser.