| 1 | ## Domain Registry Interface, EPP Status | ||||||||||||||||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2005,2007,2008,2010,2014 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 | package Net::DRI::Protocol::EPP::Core::Status; | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | use base qw!Net::DRI::Data::StatusList!; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use Net::DRI::Exception; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | Net::DRI::Protocol::EPP::Core::Status - EPP Status for Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | Please see the README file for details. | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | Copyright (c) 2005,2007,2008,2010,2014 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||||||||||||||||
| 54 | All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 57 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 58 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 59 | (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | sub new | ||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | my $class=shift; | |||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | my $self=$class->SUPER::new('epp','1.0'); | |||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | my %s=('delete' => 'clientDeleteProhibited', | |||||||||||||||||||||||||||||||||||||||||
| 73 | 'renew' => 'clientRenewProhibited', | ||||||||||||||||||||||||||||||||||||||||||
| 74 | 'update' => 'clientUpdateProhibited', | ||||||||||||||||||||||||||||||||||||||||||
| 75 | 'transfer' => 'clientTransferProhibited', | ||||||||||||||||||||||||||||||||||||||||||
| 76 | 'publish' => 'clientHold', | ||||||||||||||||||||||||||||||||||||||||||
| 77 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | $self->_register_pno(\%s); | |||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | my $msg=shift; | |||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | return $self unless defined $msg; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | Net::DRI::Exception::err_invalid_parameters() unless ref $msg eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | $self->add(@$msg); | |||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | sub is_core_status | ||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_core_status: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | return (shift=~m/^client(?:Hold|(?:Delete|Renew|Update|Transfer)Prohibited)$/); | |||||||||||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||
| 92 | sub build_xml | ||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_xml: not called CC=10 SCAR=47.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | my ($self,$name,$range)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | $range='core' unless defined($range); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | my @d; | |||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | my $rd=$self->status_details(); | |||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | while(my ($k,$v)=each(%$rd)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | { | ||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | next if (($range eq 'core') xor is_core_status($k)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/4
$range eq "core" xor is_core_status($k)
MC/DC0%0/2
$range eq "core" xor is_core_status($k)
$range eq "core"
is_core_status($k)
Truth table0%0/4
A xor B
A= $range eq "core"B= is_core_status($k)
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | if ($v && ref $v eq 'HASH' && keys %$v) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$v and ref $v eq "HASH" and keys %$v
$v and ref $v eq "HASH"
MC/DC0%0/3
$v and ref $v eq "HASH" and keys %$v
$v
ref $v eq "HASH"
keys %$v
Truth table0%0/4
A and B and C
A= $vB= ref $v eq "HASH"C= keys %$v
| |||||||||||||||||||||||||||||||||||||||||||
| 102 | { | ||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | my %tmp=(s => $k); | |||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | $tmp{lang}=$v->{lang} if exists $v->{lang}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | push @d,[$name,$v->{msg} || '',\%tmp]; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$v->{'msg'} || ''
MC/DC0%0/1
$v->{'msg'} || ''
$v->{'msg'}
Truth table0%0/2
A
A= $v->{'msg'}
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | } else | ||||||||||||||||||||||||||||||||||||||||||
| 107 | { | ||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | push @d,[$name,{s=>$k}]; | |||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | return @d; | |||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | sub is_active { return shift->has_any('ok'); } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_active: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | sub is_published { return shift->has_not(qw/clientHold serverHold inactive/); } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_published: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | ▶ | sub is_pending { return shift->has_any(qw/pendingCreate pendingDelete pendingRenew pendingTransfer pendingUpdate/); } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_pending: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | sub is_linked { return shift->has_any('linked'); } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_linked: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | sub is_grace { return shift->has_any(qw/addPeriod autoRenewPeriod renewPeriod transferPeriod redemptionPeriod pendingRestore pendingDelete/); } ## defined in RFC3915 ยง3.1 | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_grace: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | sub can_delete { my $self=shift; return (!$self->is_linked() && !$self->is_pending() && $self->has_not(qw/clientDeleteProhibited serverDeleteProhibited/))? 1 : 0; } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
can_delete: not called CC=4 SCAR=30.0
Pod
documented
Branch: 1 branch
Condition0%0/6
not $self->is_linked || $self->is_pending and $self->has_not("clientDeleteProhibited", "serverDeleteProhibited")
$self->is_linked || $self->is_pending
MC/DC0%0/3
not $self->is_linked || $self->is_pending and $self->has_not("clientDeleteProhibited", "serverDeleteProhibited")
$self->is_linked
$self->is_pending
$self->has_not("clientDeleteProhibited", "serverDeleteProhibited")
Truth table0%0/4
not(A || B) and C
A= $self->is_linkedB= $self->is_pendingC= $self->has_not("clientDeleteProhibited", "serverDeleteProhibited")
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | ▶ | sub can_renew { my $self=shift; return (!$self->is_pending() && $self->has_not(qw/clientRenewProhibited serverRenewProhibited/))? 1 : 0; } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
can_renew: not called CC=3 SCAR=24.8
Pod
documented
Branch: 1 branch
Condition0%0/3
not $self->is_pending and $self->has_not("clientRenewProhibited", "serverRenewProhibited")
MC/DC0%0/2
not $self->is_pending and $self->has_not("clientRenewProhibited", "serverRenewProhibited")
not $self->is_pending
$self->has_not("clientRenewProhibited", "serverRenewProhibited")
Truth table0%0/3
not(A) and B
A= not $self->is_pendingB= $self->has_not("clientRenewProhibited", "serverRenewProhibited")
| |||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | ▶ | sub can_update { my $self=shift; return (!$self->is_pending() && $self->has_not(qw/clientUpdateProhibited serverUpdateProhibited/))? 1 : 0; } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
can_update: not called CC=3 SCAR=24.8
Pod
documented
Branch: 1 branch
Condition0%0/3
not $self->is_pending and $self->has_not("clientUpdateProhibited", "serverUpdateProhibited")
MC/DC0%0/2
not $self->is_pending and $self->has_not("clientUpdateProhibited", "serverUpdateProhibited")
not $self->is_pending
$self->has_not("clientUpdateProhibited", "serverUpdateProhibited")
Truth table0%0/3
not(A) and B
A= not $self->is_pendingB= $self->has_not("clientUpdateProhibited", "serverUpdateProhibited")
| |||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | sub can_transfer { my $self=shift; return (!$self->is_pending() && $self->has_not(qw/clientTransferProhibited serverTransferProhibited/))? 1 : 0; } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
can_transfer: not called CC=3 SCAR=24.8
Pod
documented
Branch: 1 branch
Condition0%0/3
not $self->is_pending and $self->has_not("clientTransferProhibited", "serverTransferProhibited")
MC/DC0%0/2
not $self->is_pending and $self->has_not("clientTransferProhibited", "serverTransferProhibited")
not $self->is_pending
$self->has_not("clientTransferProhibited", "serverTransferProhibited")
Truth table0%0/3
not(A) and B
A= not $self->is_pendingB= $self->has_not("clientTransferProhibited", "serverTransferProhibited")
| |||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||
| 125 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 126 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||