InfoSys-FreeDB

 view release on metacpan or  search on metacpan

lib/InfoSys/FreeDB/Connection/HTTP.pm  view on Meta::CPAN

    }

    # Return if the protocol level is greater than 1
    ( $self->get_proto_level() > 1 ) &&
        return(undef);

    # Return if the freedb_host is "freedb.freedb.org"
    ( $self->get_freedb_host() eq "freedb.freedb.org" ) &&
        return(undef);

    # Check the stat
    my $stat = $self->stat();

    # Disconnect and throw exception if error
    if ( $stat->is_error() ) {
        $self->set__connection_();
        throw Error::Simple("ERROR: InfoSys::FreeDB::Connection::HTTP::connect, handshake failed, stat returned an error.");
    }

    # Set the highest protocol
    $self->set_proto_level( $stat->get_proto_max() );

    # Return undef
    return(undef);
}

sub get_freedb_cgi {
    my $self = shift;

    return( $self->{InfoSys_FreeDB_Connection_HTTP}{freedb_cgi} );
}

sub hello {
    throw Error::Simple ("ERROR: InfoSys::FreeDB::Connection::HTTP::hello, this method is not supported over 'HTTP'.");
}

sub proto {
    throw Error::Simple ("ERROR: InfoSys::FreeDB::Connection::HTTP::proto, this method is not supported over 'HTTP'.");
}

sub quit {
    require InfoSys::FreeDB::Response::Quit;
    return( InfoSys::FreeDB::Response::Quit->new( {
        code => 230,
        result => 'OK, goodbye',
        hostname => '<this.is.a.dummy.quit.response>',
    } ) );
}

sub set_freedb_cgi {
    my $self = shift;
    my $val = shift;

    # Check if isa/ref/rx/value is allowed
    &_value_is_allowed( 'freedb_cgi', $val ) || throw Error::Simple("ERROR: InfoSys::FreeDB::Connection::HTTP::set_freedb_cgi, the specified value '$val' is not allowed.");

    # Assignment
    $self->{InfoSys_FreeDB_Connection_HTTP}{freedb_cgi} = $val;
}

sub update {
    throw Error::Simple ("ERROR: InfoSys::FreeDB::Connection::HTTP::update, THIS METHOD IS NOT YET IMPLEMENTED.");
}

sub write {
    throw Error::Simple ("ERROR: InfoSys::FreeDB::Connection::HTTP::write, this method is not supported over 'HTTP'.");
}



( run in 0.911 second using v1.01-cache-2.11-cpan-39bf76dae61 )