DJabberd::SASL::ManagerBase - Abstract base clase for the main SASL object.


DJabberd documentation Contained in the DJabberd distribution.

Index


Code Index:

NAME

Top

DJabberd::SASL::ManagerBase - Abstract base clase for the main SASL object.

DESCRIPTION

Top

The SASL Manager is the main object instantiated when a negotiation starts. It's a wrapper around Authen::SASL, plus some helpers.

INTERFACE

Top

see Authen::SASL and Authen::SASL::Perl for the base methods.

plugin

returns the DJabberd::SASL plugin responsible for instantiating this manager.

server_new

has the same interface, but returns a DJabberd::SASL::Connection instance instead of a regular SASL Mechanism handling class.

is_mechanism_supported($mechanism)

Subclasses should provide this method.

returns true or false depending if $mechanism is supporte by the underlaying implementation and the current configuration.

COPYRIGHT

Top


DJabberd documentation Contained in the DJabberd distribution.

package DJabberd::SASL::ManagerBase;

use strict;
use warnings;

sub new {
    my $class  = shift;
    my $plugin = shift;
    my $self = bless {
        __sasl_plugin => $plugin,
    }, ref $class || $class;
    $self->{impl} = $self->manager_implementation(@_);
    return $self;
}

sub plugin {
    my $mgr = shift;
    return $mgr->{__sasl_plugin};
}
sub is_mechanism_supported { die "implement" }

sub DESTROY { }

sub AUTOLOAD {
    my $obj = shift;
    (my $meth = our $AUTOLOAD) =~ s/^.*:://;
    return $obj->{impl}->$meth(@_);
}

1;
__END__

# Local Variables:
# mode: perl
# c-basic-indent: 4
# indent-tabs-mode: nil
# End: