Net::RRP::Request::Transfer - rrp transfer request representation.


Net-RRP documentation Contained in the Net-RRP distribution.

Index


Code Index:

NAME

Top

Net::RRP::Request::Transfer - rrp transfer request representation.

SYNOPSIS

Top

 use Net::RRP::Request::Transfer;
 my $transferRequest = new Net::RRP::Request::Transfer
    ( entity  => new Net::RRP::Entity::Domain ( DomainName => [ 'domain.ru' ] ),
      options => { Approve => 'no' } )
 my $transferRequest1 = new Net::RRP::Request::Transfer ();
 $transferRequest1->setEntity ( new Net::RRP::Entity::Domain ( DomainName => [ 'domain.ru' ] );
 $transferRequest1->setOption ( Approve => 'no' );

DESCRIPTION

Top

This is a rrp transfer request representation class.

getName

return a 'Transfer'

setEntity

throw Net::RRP::Exception::InvalidEntityValue unless entity is Net::RRP::Entity::Domain

setOption

Pass only Approve option and yes/no value

AUTHOR AND COPYRIGHT

Top

SEE ALSO

Top

Net::RRP::Request(3), Net::RRP::Codec(3), Net::RRP::Entity::Domain(3), RFC 2832,Net::RRP::Exception::InvalidCommandOption(3), Net::RRP::Exception::InvalidEntityValue(3), Net::RRP::Exception::InvalidOptionValue(3)


Net-RRP documentation Contained in the Net-RRP distribution.
package Net::RRP::Request::Transfer;

use strict;
use Net::RRP::Request;
use Net::RRP::Exception::InvalidCommandOption;
use Net::RRP::Exception::InvalidEntityValue;
use Net::RRP::Exception::InvalidOptionValue;

@Net::RRP::Request::Transfer::ISA = qw(Net::RRP::Request);
$Net::RRP::Request::Transfer::VERSION = '0.1';

sub getName { 'Transfer' };

sub setEntity
{
    my ( $this, $entity ) = @_;
    my $ref = ref ( $entity ) || throw Net::RRP::Exception::InvalidEntityValue ();
    $ref eq 'Net::RRP::Entity::Domain' || throw throw Net::RRP::Exception::InvalidEntityValue ();
    $this->SUPER::setEntity ( $entity );
}

sub setOption
{
    my ( $this, $key, $value ) = @_;
    throw Net::RRP::Exception::InvalidCommandOption () if lc ( $key ) ne "approve";
    throw Net::RRP::Exception::InvalidOptionValue   () unless lc ( $value ) =~ /^yes|no$/;
    $this->SUPER::setOption ( $key => $value );
}

1;

__END__