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