| 1 | package Net::RRP::Entity::Replica; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use Net::RRP::Entity; | ||
| 5 | use Net::RRP::Exception::InvalidAttributeName; | ||
| 6 | @Net::RRP::Entity::Replica::ISA = qw(Net::RRP::Entity); | ||
| 7 | $Net::RRP::Entity::Replica::VERSION = '0.1'; | ||
| 8 | |||
| 9 | =head1 NAME | ||
| 10 | |||
| 11 | Net::RRP::Entity::Replica - rrp replica entity representation. | ||
| 12 | |||
| 13 | =head1 SYNOPSIS | ||
| 14 | |||
| 15 | use Net::RRP::Entity::Replica; | ||
| 16 | my $replicaEntity = new Net::RRP::Entity::Replica ( name => 'replicaname', | ||
| 17 | => 'password', | ||
| 18 | .... ); | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | This is a rrp replica entity representation class. | ||
| 23 | |||
| 24 | =cut | ||
| 25 | |||
| 26 | =head2 getName | ||
| 27 | |||
| 28 | return a 'Replica' | ||
| 29 | |||
| 30 | =cut | ||
| 31 | |||
| 32 | sub getName { 'Replica' } | ||
| 33 | |||
| 34 | =head2 setAttribute | ||
| 35 | |||
| 36 | Add check constraint to attributes. Only techcontact, serial, name and password may be exists | ||
| 37 | |||
| 38 | =cut | ||
| 39 | |||
| 40 | sub setAttribute | ||
| 41 | { | ||
| 42 | my ( $this, $key, $value ) = @_; | ||
| 43 | { replicaname => 1, techcontact => 1, serial => 1, password => 1 }->{ lc ( $key ) } || throw Net::RRP::Exception::InvalidAttributeName (); | ||
| 44 | $this->SUPER::setAttribute ( $key => $value ); | ||
| 45 | } | ||
| 46 | |||
| 47 | 1; | ||
| 48 | |||
| 49 | =head1 AUTHOR AND COPYRIGHT | ||
| 50 | |||
| 51 | Net::RRP::Entity::Replica (C) Michael Kulakov, Zenon N.S.P. 2000 | ||
| 52 | 125124, 19, 1-st Jamskogo polja st, | ||
| 53 | Moscow, Russian Federation | ||
| 54 | |||
| 55 | mkul@cpan.org | ||
| 56 | |||
| 57 | All rights reserved. | ||
| 58 | |||
| 59 | You may distribute this package under the terms of either the GNU | ||
| 60 | General Public License or the Artistic License, as specified in the | ||
| 61 | Perl README file. | ||
| 62 | |||
| 63 | =head1 SEE ALSO | ||
| 64 | |||
| 65 | L<Net::RRP::Entity(3)>, L<Net::RRP::Codec(3)>, RFC 2832, | ||
| 66 | L<Net::RRP::Exception::InvalidAttributeName(3)> | ||
| 67 | |||
| 68 | =cut | ||
| 69 | |||
| 70 | __END__ |