File Coverage

blib/lib/Net/EPP/Frame/ObjectSpec.pm
Criterion Covered Total %
statement 6 9 66.6
branch 0 2 0.0
condition n/a
subroutine 2 3 66.6
pod 0 1 0.0
total 8 15 53.3


line stmt bran cond sub pod time code
1             #! $Id: ObjectSpec.pm,v 1.2 2007/12/03 11:44:51 gavin Exp $
2             package Net::EPP::Frame::ObjectSpec;
3 1     1   3 use vars qw($SPEC);
  1         1  
  1         32  
4 1     1   2 use strict;
  1         1  
  1         92  
5              
6             our $SPEC = {
7             'domain' => [ 'urn:ietf:params:xml:ns:domain-1.0', 'urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd' ],
8             'contact' => [ 'urn:ietf:params:xml:ns:contact-1.0', 'urn:ietf:params:xml:ns:contact-1.0 contact-1.0.xsd' ],
9             'host' => [ 'urn:ietf:params:xml:ns:host-1.0', 'urn:ietf:params:xml:ns:host-1.0 host-1.0.xsd' ],
10             'secDNS' => [ 'urn:ietf:params:xml:ns:secDNS-1.1', 'urn:ietf:params:xml:ns:secDNS-1.1 secDNS-1.1.xsd' ],
11             };
12              
13             sub spec {
14 0     0 0   my $type = $_[1];
15              
16 0 0         return (!defined($SPEC->{$type}) ? undef : ($type, @{$SPEC->{$type}}));
  0            
17             }
18              
19             =pod
20              
21             =head1 NAME
22              
23             Net::EPP::Frame::ObjectSpec - metadata about EPP object types
24              
25             =head1 SYNOPSIS
26              
27             use Net::EPP::Frame;
28             use strict;
29              
30             # create an EPP frame:
31             my $check = Net::EPP::Frame::Command::Check->new;
32              
33             # get the spec:
34             my @spec = Net::EPP::Frame::ObjectSpec->spec('domain');
35              
36             # create an object:
37             my $domain = $check->addObject(@spec);
38              
39             # set the attributes:
40             my $name = $check->createElement('domain:name');
41             $name->addText('example.tld');
42              
43             # assemble the frame:
44             $domain->appendChild($name);
45             $check->getCommandNode->appendChild($domain);
46              
47             print $check->toString;
48              
49             =head1 DESCRIPTION
50              
51             EPP is the Extensible Provisioning Protocol. EPP (defined in RFC 4930) is an
52             application layer client-server protocol for the provisioning and management of
53             objects stored in a shared central repository. Specified in XML, the protocol
54             defines generic object management operations and an extensible framework that
55             maps protocol operations to objects. As of writing, its only well-developed
56             application is the provisioning of Internet domain names, hosts, and related
57             contact details.
58              
59             Net::EPP::Frame::ObjectSpec is a simple module designed to provide easy access to
60             metadata for the object types defined in the EPP specification.
61              
62             =head1 USAGE
63              
64             my @spec = Net::EPP::Frame::ObjectSpec->spec($type);
65              
66             This function returns an array containing metadata for the given object type.
67             If no metadata is registered then the function returns undef.
68              
69             The array contains three members:
70              
71             @spec = (
72             $type,
73             $xmlns,
74             $schemaLocation,
75             );
76              
77             C<$type> is the same as the supplied argument, and the other two members
78             correspond to the XML attributes used to specify the object in an EPP
79             CcommandE> or CresponseE> frame.
80              
81             The objects currently registered are:
82              
83             =over
84              
85             =item * C, for domain names.
86              
87             =item * C, for DNS server hosts.
88              
89             =item * C, for contact objects.
90              
91             =item * C, for DNSSEC information.
92              
93             =back
94              
95             Note that secDNS is an extension to the domain object rather than an
96             object in its own right.
97              
98             =head1 AUTHOR
99              
100             CentralNic Ltd (http://www.centralnic.com/).
101              
102             =head1 COPYRIGHT
103              
104             This module is (c) 2016 CentralNic Ltd. This module is free software; you can
105             redistribute it and/or modify it under the same terms as Perl itself.
106              
107             =head1 SEE ALSO
108              
109             =over
110              
111             =item * the L module, for constructing valid EPP frames.
112              
113             =item * the L module, for communicating with EPP servers.
114              
115             =item * RFCs 4930 and RFC 4934, available from L.
116              
117             =item * The CentralNic EPP site at L.
118              
119             =back
120              
121             =cut
122              
123             1;