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