Net::RRP::Entity::NameServer - rrp domain entity representation.


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

Index


Code Index:

NAME

Top

Net::RRP::Entity::NameServer - rrp domain entity representation.

SYNOPSIS

Top

 use Net::RRP::Entity::NameServer;
 my $nameServerEntity = new Net::RRP::Entity::NameServer ( NameServer => [ 'ns1.domain.ru' ],
						       IPAddress  => [ '1.1.1.1' ] );
 my $nameServerEntity1 = new Net::RRP::Entity::NameServer ();
 $nameServerEntity1->setAttribute ( NameServer => [ 'ns1.domain.ru' ] );
 $nameServerEntity1->setAttribute ( IPAddress  => [ '1.1.1.1' ] );

DESCRIPTION

Top

This is a rrp name server entity representation class.

getName

return a 'NameServer'

setAttribute

Add check constraint to attributes. Only NameServer and IPAddress attributes can exists.

getPrimaryAttributeValue

return a "primary" attribute value

AUTHOR AND COPYRIGHT

Top

SEE ALSO

Top

Net::RRP::Entity(3), Net::RRP::Codec(3), RFC 2832, Net::RRP::Exception::InvalidAttributeName(3)


Net-RRP documentation Contained in the Net-RRP distribution.
package Net::RRP::Entity::NameServer;

use strict;
use Net::RRP::Entity;
use Net::RRP::Exception::InvalidAttributeName;
@Net::RRP::Entity::NameServer::ISA = qw(Net::RRP::Entity);
$Net::RRP::Entity::NameServer::VERSION = '0.1';

sub getName { 'NameServer' }

sub setAttribute
{
    my ( $this, $key, $value ) = @_;
    { nameserver => 1, ipaddress => 1, newnameserver => 1 }->{ lc ( $key ) } || throw Net::RRP::Exception::InvalidAttributeName;
    $this->SUPER::setAttribute ( $key => $value );
}

sub getPrimaryAttributeValue
{
    my $this = shift;
    $this->getAttribute ( $this->getName );
}

1;

__END__