/usr/share/perl5/Net/DRI/BaseClass.pm is in libnet-dri-perl 0.96-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | ## Domain Registry Interface, Superclass of various classes for Net::DRI
##
## Copyright (c) 2009 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
##
## This file is part of Net::DRI
##
## Net::DRI is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## See the LICENSE file that comes with this distribution for more details.
#
#
#
####################################################################################################
package Net::DRI::BaseClass;
use strict;
use warnings;
use Net::DRI::Exception;
our $VERSION=do { my @r=(q$Revision: 1.1 $=~/\d+/gxm); sprintf '%d'.('.%02d' x $#r), @r; };
####################################################################################################
## CLASS METHODS
sub make_exception_if_not_implemented
{
my ($self,@methods)=@_;
my $class=ref $self || $self;
foreach my $name (@methods)
{
no strict 'refs'; ## no critic (ProhibitNoStrict)
*{"${class}::${name}"}=sub { my $self=shift; Net::DRI::Exception->die(1,'internal',1,sprintf('Method %s not implemented in %s, please report.',$name,ref $self)); };
}
return;
}
sub make_exception_for_unavailable_operations
{
my ($self,@methods)=@_;
my $class=ref $self || $self;
foreach my $name (@methods)
{
my @op=split(/_/,$name,2);
no strict 'refs'; ## no critic (ProhibitNoStrict)
*{"${class}::${name}"}=sub { my $self=shift; Net::DRI::Exception->die(0,'DRD',4,sprintf('No operation %s %s available for registry %s',@op,$self->name())); };
}
no strict 'refs'; ## no critic (ProhibitNoStrict)
*{"${class}::unavailable_operations"}=sub { return @methods; };
return;
}
####################################################################################################
## OBJECT METHODS
sub generate_trid
{
my ($self,$name)=@_;
if (! defined $name) { $name=$self->name(); }
return $self->trid_factory()->($name);
}
sub log_setup_channel { my ($self,@r)=@_; $self->logging()->setup_channel(@r); }
sub log_output { my ($self,@r)=@_; $self->logging()->output(@r); }
####################################################################################################
1;
__END__
=pod
=head1 NAME
Net::DRI::BaseClass - Superclass of various classes inside Net::DRI
=head1 VERSION
This documentation refers to Net::DRI::BaseClass version 1.1
=head1 SYNOPSIS
Not directly used by users, this is a purely internal class, never visible to the outside of Net::DRI.
=head1 DESCRIPTION
This is the superclass of some Net::DRI classes, providing various useful functions.
=head1 EXAMPLES
No user examples.
=head1 SUBROUTINES/METHODS
This is mostly a pure virtual superclass.
=head1 DIAGNOSTICS
None.
=head1 CONFIGURATION AND ENVIRONMENT
None.
=head1 DEPENDENCIES
This modules has to be used inside the Net::DRI framework and needs the following composants:
=over
=item L<Net::DRI::Exception>
=back
=head1 INCOMPATIBILITIES
None
=head1 BUGS AND LIMITATIONS
No known bugs. Please report problems to author (see below) or use CPAN RT system. Patches are welcome.
This should probably be better done with Moose and roles. It would however require a major overhaul
to everything inside Net::DRI, so this would probably not happen very soon, maybe with a Perl6 port.
This class was introduced very late in Net::DRI, multiple parts of this framework should be
modified to take advantage of this class.
=head1 SUPPORT
For now, support questions should be sent to:
E<lt>netdri@dotandco.comE<gt>
Please also see the SUPPORT file in the distribution.
=head1 SEE ALSO
E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
=head1 AUTHOR
Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
=head1 LICENSE AND COPYRIGHT
Copyright (c) 2009 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
See the LICENSE file that comes with this distribution for more details.
=cut
|