NAME
InfoSys::FreeDB::Connection::CDDBP - FreeDB CDDBP connection
SYNOPSIS
require InfoSys::FreeDB;
require InfoSys::FreeDB::Entry;
# Read entry from the default CD device
my $entry = InfoSys::FreeDB::Entry->new_from_cdparanoia();
# Create a CDDBP connection
my $fact = InfoSys::FreeDB->new();
my $conn = $fact->create_connection( {
client_name => 'testing-InfoSys::FreeDB',
client_version => $InfoSys::FreeDB::VERSION,
protocol => 'CDDBP',
} );
# Query FreeDB
my $res_q = $conn->query( $entry );
scalar( $res_q->get_match() ) ||
die 'no matches found for the disck in the default CD-Rom drive';
# Read the first match
my $res_r = $conn->read( ( $res_q->get_match() )[0] );
# Write the entry to STDERR
use IO::Handle;
my $fh = IO::Handle->new_from_fd( fileno(STDERR), 'w' );
$res_r->get_entry()->write_fh( $fh );
ABSTRACT
FreeDB CDDBP connection
DESCRIPTION
InfoSys::FreeDB::Connection::CDDBP is the CDDBP implementation of the InfoSys::FreeDB::Connection abstract class.
CONSTRUCTOR
- new(OPT_HASH_REF)
-
Creates a new
InfoSys::FreeDB::Connection::CDDBPobject.OPT_HASH_REFis a hash reference used to pass initialization options.OPT_HASH_REFis mandatory. On error an exceptionError::Simpleis thrown.Options for
OPT_HASH_REFmay include:sign_on_response-
Passed to set_sign_on_response().
Options for
OPT_HASH_REFinherited through packageInfoSys::FreeDB::Connectionmay include:client_host-
Passed to set_client_host(). Mandatory option.
client_name-
Passed to set_client_name(). Mandatory option.
client_user-
Passed to set_client_user(). Mandatory option.
client_version-
Passed to set_client_version(). Mandatory option.
freedb_host-
Passed to set_freedb_host(). Mandatory option.
freedb_port-
Passed to set_freedb_port(). Mandatory option.
proto_level-
Passed to set_proto_level(). Defaults to 1.
proxy_host-
Passed to set_proxy_host().
proxy_passwd-
Passed to set_proxy_passwd().
proxy_port-
Passed to set_proxy_port(). Defaults to 8080.
proxy_user-
Passed to set_proxy_user().
METHODS
- connect()
-
This method is an implementation from package
InfoSys::FreeDB::Connection. Connects the object to the FreeDB information service using the object's attributes. Ahellocommend is sent out, the protocol level is queried and set to the highest level available. On error an exceptionError::Simpleis thrown. - discid(ENTRY)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Issues adiscidcommand on the FreeDB database.ENTRYis aInfoSys::FreeDB::Entryobject. On error an exceptionError::Simpleis thrown. - disconnect()
-
This method is overloaded from package
InfoSys::FreeDB::Connection. Disconnects the object from the FreeDB information service. - get_client_host()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Returns the connecting client host. - get_client_name()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Returns the connecting client name. - get_client_user()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Returns the connecting client user. - get_client_version()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Returns the connecting client version. - get_freedb_host()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Returns the FreeDB host. - get_freedb_port()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Returns the FreeDB port. - get_proto_level()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Returns the current protocol level. - get_proxy_host()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Returns the proxy host to use. - get_proxy_passwd()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Returns the proxy password to use. - get_proxy_port()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Returns the proxy port to use. - get_proxy_user()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Returns the proxy user name to use. - get_sign_on_response()
-
Returns the sign-on response.
- hello()
-
Sends a hello command to the FreeDB server. Returns a
InfoSys::FreeDB::Response::Helloobject. On error an exceptionError::Simpleis thrown. - log()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Issues alogcommand on the FreeDB database. TO BE SPECIFIED - lscat()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Issues anlscatcommand on the FreeDB database. Returns aInfoSys::FreeDB::Response::LsCatobject. On error an exceptionError::Simpleis thrown. - motd()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Issues anmotdcommand on the FreeDB database. ReturnsInfoSys::FreeDB::Response::Motdobject. On error an exceptionError::Simpleis thrown. - proto([ LEVEL ])
-
This method is an implementation from package
InfoSys::FreeDB::Connection. Issues aprotocommand on the FreeDB database. IfLEVELis not specified, the protocol level is queried. IfLEVELis specified it is used to set the protocol level. ReturnsInfoSys::FreeDB::Response::Protoobject. On error an exceptionError::Simpleis thrown. - query(ENTRY)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Queries the FreeDB database.ENTRYis aInfoSys::FreeDB::Entryobject. Returns aInfoSys::FreeDB::Response::Queryobject. On error an exceptionError::Simpleis thrown. - quit()
-
This method is an implementation from package
InfoSys::FreeDB::Connection. Issues aquitcommand on the FreeDB database and disconnects. ReturnsInfoSys::FreeDB::Response::Quitobject. On error an exceptionError::Simpleis thrown. - read(MATCH)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Reads an entry from the FreeDB database.MATCHis aInfoSys::FreeDB::Matchobject. Returns aInfoSys::FreeDB::Response::Matchobject. On error an exceptionError::Simpleis thrown. - set_client_host(VALUE)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Set the connecting client host.VALUEis the value.VALUEmay not beundef. On error an exceptionError::Simpleis thrown. - set_client_name(VALUE)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Set the connecting client name.VALUEis the value.VALUEmay not beundef. On error an exceptionError::Simpleis thrown. - set_client_user(VALUE)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Set the connecting client user.VALUEis the value.VALUEmay not beundef. On error an exceptionError::Simpleis thrown. - set_client_version(VALUE)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Set the connecting client version.VALUEis the value.VALUEmay not beundef. On error an exceptionError::Simpleis thrown. - set_freedb_host(VALUE)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Set the FreeDB host.VALUEis the value.VALUEmay not beundef. On error an exceptionError::Simpleis thrown. - set_freedb_port(VALUE)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Set the FreeDB port.VALUEis the value.VALUEmay not beundef. On error an exceptionError::Simpleis thrown. - set_proto_level(VALUE)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Set the current protocol level.VALUEis the value. Default value at initialization is1. On error an exceptionError::Simpleis thrown. - set_proxy_host(VALUE)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Set the proxy host to use.VALUEis the value. On error an exceptionError::Simpleis thrown. - set_proxy_passwd(VALUE)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Set the proxy password to use.VALUEis the value. On error an exceptionError::Simpleis thrown. - set_proxy_port(VALUE)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Set the proxy port to use.VALUEis the value. Default value at initialization is8080. On error an exceptionError::Simpleis thrown. - set_proxy_user(VALUE)
-
This method is inherited from package
InfoSys::FreeDB::Connection. Set the proxy user name to use.VALUEis the value. On error an exceptionError::Simpleis thrown. - set_sign_on_response(VALUE)
-
Set the sign-on response.
VALUEis the value. On error an exceptionError::Simpleis thrown. - sites()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Issues asitescommand on the FreeDB database. Returns aInfoSys::FreeDB::Response::Sitesobject. On error an exceptionError::Simpleis thrown. - stat()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Issues astatcommand on the FreeDB database. Returns aInfoSys::FreeDB::Response::Statobject. On error an exceptionError::Simpleis thrown. - update()
-
This method is an implementation from package
InfoSys::FreeDB::Connection. THIS METHOD IS NOT YET IMPLEMENTED Issues aupdatecommand on the FreeDB database. TO BE SPECIFIED_ - ver()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Issues avercommand on the FreeDB database. Returns aInfoSys::FreeDB::Response::Verobject. On error an exceptionError::Simpleis thrown. - whom()
-
This method is inherited from package
InfoSys::FreeDB::Connection. Issues awhomcommand on the FreeDB database. Returns aInfoSys::FreeDB::Response::Whomobject. On error an exceptionError::Simpleis thrown. - write(ENTRY, CATEGORY)
-
This method is an implementation from package
InfoSys::FreeDB::Connection. THIS METHOD IS NOT YET TESTED Writes an entry to the FreeDB database.ENTRYis aInfoSys::FreeDB::Entryobject.CATEGORYis a valid FreeDB category. Returns aInfoSys::FreeDB::Response::Write::1object in the case an error occurred in the first pass of the writing. Otherwise aInfoSys::FreeDB::Response::Write::2object is returned. On error an exceptionError::Simpleis thrown._
SEE ALSO
InfoSys::FreeDB, InfoSys::FreeDB::Connection, InfoSys::FreeDB::Connection::HTTP, InfoSys::FreeDB::Entry, InfoSys::FreeDB::Entry::Track, InfoSys::FreeDB::Match, InfoSys::FreeDB::Response, InfoSys::FreeDB::Response::DiscId, InfoSys::FreeDB::Response::Hello, InfoSys::FreeDB::Response::LsCat, InfoSys::FreeDB::Response::Motd, InfoSys::FreeDB::Response::Proto, InfoSys::FreeDB::Response::Query, InfoSys::FreeDB::Response::Quit, InfoSys::FreeDB::Response::Read, InfoSys::FreeDB::Response::SignOn, InfoSys::FreeDB::Response::Sites, InfoSys::FreeDB::Response::Stat, InfoSys::FreeDB::Response::Ver, InfoSys::FreeDB::Response::Whom, InfoSys::FreeDB::Response::Write::1, InfoSys::FreeDB::Response::Write::2, InfoSys::FreeDB::Site
BUGS
None known (yet.)
HISTORY
First development: September 2003 Last update: December 2003
AUTHOR
Vincenzo Zocca
COPYRIGHT
Copyright 2003 by Vincenzo Zocca
LICENSE
This file is part of the InfoSys::FreeDB module hierarchy for Perl by Vincenzo Zocca.
The InfoSys::FreeDB module hierarchy 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.
The InfoSys::FreeDB module hierarchy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the InfoSys::FreeDB module hierarchy; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA