Apache-Wombat

 view release on metacpan or  search on metacpan

lib/Apache/Wombat/Request.pm  view on Meta::CPAN

# -*- Mode: Perl; indent-tabs-mode: nil; -*-

package Apache::Wombat::Request;

=pod

=head1 NAME

Apache::Wombat::Request - Apache connector request class

=head1 SYNOPSIS

=head1 DESCRIPTION

Apache connector request class. Extends
B<Wombat::Connector::HttpRequestBase>. Overrides many superclass
methods to delegate to an underlying B<Apache::Request> instance.

=cut

use base qw(Wombat::Connector::HttpRequestBase);
use fields qw(apr);
use strict;
use warnings;

use Apache::Request ();
use Apache::Util ();

=pod

=head1 CONSTRUCTOR

=over

=item new()

Create and return an instance, initializing fields to default values.

=back

=cut

sub new {
    my $self = shift;

    $self = fields::new($self) unless ref $self;
    $self->SUPER::new(@_);

    return $self;
}

=pod

=head1 METHODS

=over

=item getAttribute($name)

Return the value of the named attribute from the B<Apache> pnotes table.

B<Parameters:>

=over

=item $name

the name of the attribute

=back

=cut

sub getAttribute {
    my $self = shift;
    my $name = shift;

    return $self->{apr}->pnotes($name);
}

=item getAttributeNames()

Return an array containing the names of the attributes available in
the B<Apache> pnotes table.

=cut

sub getAttributeNames {
    my $self = shift;

    my $pnotes = $self->{apr}->pnotes();
    my @names = grep { /::/ } keys %$pnotes;

    return wantarray ? @names : \@names;
}

=pod

=item removeAttribute($name)

Remove the named attribute from the B<Apache> pnotes table.

B<Parameters:>

=over

=item $name

lib/Apache/Wombat/Request.pm  view on Meta::CPAN


    $self->{apr} = $apr;

    return 1;
}

=pod

=item getRequestURI()

Return the request URI for this Request.

=cut

sub getRequestURI {
    my $self = shift;

    return $self->{apr}->uri();
}

=pod

=item setRequestURI($uri)

Set the unparsed request URI for this Request. This is normally called
by the Connector when it parses the request headers.

B<Parameters:>

=over

=item $uri

the request URI

=back

=cut

sub setRequestURI {
    my $self = shift;
    my $uri = shift;

    $self->{apr}->uri($uri);

    return 1;
}

=pod

=item recycle()

Release all object references and initialize instances variables in
preparation for use or reuse of this object.

=cut

sub recycle {
    my $self = shift;

    $self->SUPER::recycle();

    $self->{apr} = undef;

    return 1;
}

1;
__END__

=pod

=back

=head1 SEE ALSO

L<Apache>,
L<Apache::Request>,
L<Apache::Table>,
L<Apache::Util>,
L<Wombat::Connector::HttpRequestBase>

=head1 AUTHOR

Brian Moseley, bcm@maz.org

=cut



( run in 1.294 second using v1.01-cache-2.11-cpan-5b529ec07f3 )