Digital Mages

Digital Mages - Net::ICAP::Response(3)


NAME

Net::ICAP::Response - ICAP Response Class


VERSION

$Id: lib/Net/ICAP/Response.pm, v0.03 $


SYNOPSIS

    use Net::ICAP::Response;
    use Net::ICAP::Common qw(:resp);
    $msg = new Net::ICAP::Response;
    $rv  = $msg->parse($fh);
    $method = $msg->status;
    $text   = $msg->statusText;
    $msg = Net::ICAP::Response->new(
        status  => ICAP_OK,
        headers => {
            ISTag => 'sasieEcjEO',
            },
        );
    $rv = $msg->status(ICAP_CONTINUE);
    $rv = $msg->generate($fh);


DESCRIPTION

This module provides an ICAP Response class for parsing and generating ICAP responses. Additional methods available to this class are provided (and documented) in the Net::ICAP::Message manpage.


SUBROUTINES/METHODS

parse

See the Net::ICAP::Message manpage documentation.

generate

See the Net::ICAP::Message manpage documentation.

status

    $rv     = $msg->status($status);
    $status = $msg->method;

This method gets or sets the response status. Only valid statuses are accepted and must be one listed as a constant in the Net::ICAP::Common manpage. No provision exists at this moment to accept additional status codes.

statusText

    $text  = $msg->statusText;
    $text  = $msg->statusText($code);

This method returns a text string describing the status code's purpose. IF no code is specified it returns the string associated with the internal status code currently set.

sanityCheck

This method performs some basic sanity checks that the internal state has parsed, or can generate, a valid ICAP message. This includes checking for the presence of mandatory headers, but no validation is done on the accompanying values.

This method is used internally by both the parse and generate methods.


DEPENDENCIES

the Class::EHierarchy manpage
Paranoid


BUGS AND LIMITATIONS


AUTHOR

Arthur Corliss (corliss@digitalmages.com)


LICENSE AND COPYRIGHT

This software is licensed under the same terms as Perl, itself. Please see http://dev.perl.org/licenses/ for more information.

(c) 2012, Arthur Corliss (corliss@digitalmages.com)