File Coverage

blib/lib/Net/DRI/Protocol/OVH/WS/Connection.pm
Criterion Covered Total %
statement 6 26 23.0
branch 0 8 0.0
condition n/a
subroutine 2 8 25.0
pod 0 6 0.0
total 8 48 16.6


line stmt bran cond sub pod time code
1             ## Domain Registry Interface, OVH Web Services Connection handling
2             ##
3             ## Copyright (c) 2008,2009,2013 Patrick Mevzek . All rights reserved.
4             ##
5             ## This file is part of Net::DRI
6             ##
7             ## Net::DRI is free software; you can redistribute it and/or modify
8             ## it under the terms of the GNU General Public License as published by
9             ## the Free Software Foundation; either version 2 of the License, or
10             ## (at your option) any later version.
11             ##
12             ## See the LICENSE file that comes with this distribution for more details.
13             ####################################################################################################
14              
15             package Net::DRI::Protocol::OVH::WS::Connection;
16              
17 1     1   830 use strict;
  1         2  
  1         27  
18 1     1   4 use warnings;
  1         1  
  1         254  
19              
20             =pod
21              
22             =head1 NAME
23              
24             Net::DRI::Protocol::OVH::WS::Connection - OVH Web Services Connection handling for Net::DRI
25              
26             =head1 DESCRIPTION
27              
28             Please see the README file for details.
29              
30             =head1 SUPPORT
31              
32             For now, support questions should be sent to:
33              
34             Enetdri@dotandco.comE
35              
36             Please also see the SUPPORT file in the distribution.
37              
38             =head1 SEE ALSO
39              
40             Ehttp://www.dotandco.com/services/software/Net-DRI/E
41              
42             =head1 AUTHOR
43              
44             Patrick Mevzek, Enetdri@dotandco.comE
45              
46             =head1 COPYRIGHT
47              
48             Copyright (c) 2008,2009 Patrick Mevzek .
49             All rights reserved.
50              
51             This program is free software; you can redistribute it and/or modify
52             it under the terms of the GNU General Public License as published by
53             the Free Software Foundation; either version 2 of the License, or
54             (at your option) any later version.
55              
56             See the LICENSE file that comes with this distribution for more details.
57              
58             =cut
59              
60             ####################################################################################################
61              
62             sub login
63             {
64 0     0 0   my ($class,$cm,$id,$pass,$cltrid)=@_;
65 0           my $mes=$cm->();
66 0           $mes->method('login');
67 0           $mes->params([$id,$pass,'fr',0]);
68 0           return $mes;
69             }
70              
71             sub parse_login
72             {
73 0     0 0   my ($class,$mes)=@_;
74 0 0         $mes->errmsg($mes->is_success()? 'Login OK' : 'Login failed') unless $mes->errmsg();
    0          
75 0           return $mes->result_status();
76             }
77              
78             sub extract_session
79             {
80 0     0 0   my ($class,$mes)=@_;
81 0           return { id => $mes->result() };
82             }
83              
84             ####################################################################################################
85              
86             sub logout
87             {
88 0     0 0   my ($class,$cm,$cltrid,$sd)=@_;
89 0           my $mes=$cm->();
90 0           $mes->method('logout');
91 0           $mes->params([$sd->{id}]);
92 0           return $mes;
93             }
94              
95             sub parse_logout
96             {
97 0     0 0   my ($class,$mes)=@_;
98 0 0         $mes->errmsg($mes->is_success()? 'Logout OK' : 'Logout failed') unless $mes->errmsg();
    0          
99 0           return $mes->result_status();
100             }
101              
102             sub transport_default
103             {
104 0     0 0   my ($self,$tname)=@_;
105 0           return (defer => 1, has_login => 1, has_logout => 1);
106             }
107              
108             ####################################################################################################
109             1;