NAME¶
Net::DRI::Protocol::ResultStatus - Encapsulate Details of an Operation Result
(with Standardization on EPP) for Net::DRI
DESCRIPTION¶
An object of this class represents all details of an operation result as given
back from the registry, with standardization on EPP as much as possible, for
error codes and list of fields available.
When an operation is done, data retrieved from the registry is also stored
inside the ResultStatus object (besides being available through
"$dri-"
get_info()>). It can be queried using the
"get_data()" and "get_data_collection" methods as
explained below. The data is stored as a ref hash with 3 levels: the first
keys have as values a reference to another hash where keys are again
associated with values being a reference to another hash where the content
(keys and values) depends on the registry, the operation attempted, and the
result.
Some data will always be there: a "session" first key, with a
"exchange" subkey, will have a reference to an hash with the
following keys:
- duration_seconds
- the duration of the exchange with registry, in a floating
point number of seconds
- raw_command
- the message sent to the registry, as string
- raw_reply
- the message received from the registry, as string
- result_from_cache
- either 0 or 1 if these results were retrieved from Net::DRI
Cache object or not
- object_action
- name of the action that has been done to achieve these
results (ex: "info")
- object_name
- name (or ID) of the object on which the action has been
performed (not necessarily always defined)
- object_type
- type of object on which this operation has been done (ex:
"domain")
- registry, profile, transport, protocol
- registry name, profile name, transport name+version,
protocol name+version used for this exchange
- trid
- transaction ID of this exchange
METHODS¶
is_success()¶
returns 1 if the operation was a success
code()¶
returns the EPP code corresponding to the native code (which depends on the
registry) for this operation (see RFC for full list and source of this file
for local extensions)
native_code()¶
gives the true status code we got back from registry (this breaks the
encapsulation provided by Net::DRI, you should not use it if possible)
message()¶
gives the message attached to the the status code we got back from registry
lang()¶
gives the language in which the message above is written
get_extended_results()¶
gives back an array with additionnal result information from registry,
especially in case of errors. If no data, an empty array is returned.
This method was previously called
info(), before "Net::DRI"
version 0.92_01
get_data()¶
See explanation of data stored in "DESCRIPTION". Can be called with
one or three parameters and always returns a single value (or undef if
failure).
With three parameters, it returns the value associated to the three keys/subkeys
passed. Example:
"get_data("domain","example.com","exist")"
will return 0 or 1 depending if the domain exists or not, after a domain check
or domain info operation.
With only one parameter, it will verify there is only one branch (besides
session/exchange and message/info), and if so returns the data associated to
the parameter passed used as the third key. Otherwise will return undef.
Please note that the input API is
not the same as the one used for
"$dri-"
get_info()>.
get_data_collection()¶
See explanation of data stored in "DESCRIPTION". Can be called with
either zero, one or two parameters and may return a list or a single value
depending on calling context (and respectively an empty list or undef in case
of failure).
With no parameter, it returns the whole data as reference to an hash with 2
levels beneath as explained in "DESCRIPTION" in scalar context, or
the list of keys of this hash in list context.
With one parameter, it returns the hash referenced by the key given as argument
at first level in scalar context, or the list of keys of this hash in list
context.
With two parameters, it walks down two level of the hash using the two
parameters as key and subkey and returns the bottom hash referenced in scalar
context, or the list of keys of this hash in list context.
Please note that in all cases you are given references to the data itself, not
copies. You should not try to modify it in any way, but just read it.
as_string()¶
returns a string with all details, with the extended_results part if passed a
true value
print()¶
same as CORE::print($rs->
as_string(0))
print_full()¶
same as CORE::print($rs->
as_string(1))
trid()¶
in scalar context, gives the transaction id (our transaction id, that is the
client part in EPP) which has generated this result, in array context, gives
the transaction id followed by other ids given by registry (example in EPP:
server transaction id)
is_pending()¶
returns 1 if the last operation was flagged as pending by registry (asynchronous
handling)
is_closing()¶
returns 1 if the last operation made the registry close the connection (should
not happen often)
is(NAME)¶
if you really need to test some other codes (this should not happen often), you
can using symbolic names defined inside this module (see source). Going that
way makes sure you are not hardcoding numbers in your application, and you do
not need to import variables from this module to your application.
SUPPORT¶
For now, support questions should be sent to:
<netdri@dotandco.com>
Please also see the SUPPORT file in the distribution.
SEE ALSO¶
http://www.dotandco.com/services/software/Net-DRI/
AUTHOR¶
Patrick Mevzek, <netdri@dotandco.com>
COPYRIGHT¶
Copyright (c) 2005,2006,2008-2010 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.