NAME
Net::FreeDB2::Connection - FreeDB/CDDB abstract connection class
SYNOPSIS
See Net::FreeDB2.
DESCRIPTION
Net::FreeDB2::Connection is an abstract class to represent connections to FreeDB/CDDB servers. After a successfull connection, FreeDB/CDDB queries, reads etc can be made to obtain/provide information from/to FreeDB/CDDB databases.
CONSTRUCTOR
- new (OPT_HASH_REF)
-
Creates a new
Net::FreeDB2::Connectionobject. By defaultconnect ()is called to initiate the connection but see optionno_connect. See the implementation for complements/restrictions.Options for
OPT_HASH_REFmay include:- client_name
-
Mandatory option to name the connecting client software.
- client_version
-
Mandatory option with the client software version string.
- client_host
-
The hostname of the client. Defaults to
&Sys::Hostname::hostname (). - client_user
-
The user of the client. Defaults to
scalar (getpwuid ($>)); - freedb_host
-
The FreeDB/CDDB host. Defaults to
freedb.freedb.org. - freedb_port
-
The port on the FreeDB/CDDB host.
- proxy_host
-
Proxy host.
- proxy_port
-
Port on the proxy host. Defaults to
8080. - proxy_user
-
Proxy user name to use.
- proxy_passwd
-
Proxy password to use.
- no_connect
-
Do not call
connect ()during instanciation.
METHODS
- connect ()
-
Set up a connection to the FreeDB/CDDB server after which the methods
lscat (),query (),read (),write (),log (),motd (),discid (),proto (),sites (),stat (),ver (),update ()andwhom ()may be called. - lscat ()
-
Issues an
lscatcommand on the FreeDB/CDDB database. Returns anARRAYwith available categories. - query (ENTRY)
-
Queries the FreeDB/CDDB database using
ENTRYwhich is aNet::FreeDB2::Entryobject. Returns aNet::FreeDB2::Response::Queryobject. - read (MATCH)
-
Reads an entry from the FreeDB/CDDB database using
MATCHwhich is aNet::FreeDB2::Matchobject. Returns aNet::FreeDB2::Response::Readobject. - write (ENTITY)
-
Writes the specified
Net::FreeDB2::Entryobject to the FreeDB/CDDB database. TO BE SPECIFIED - log ()
-
Issues an
logcommand on the FreeDB/CDDB database. TO BE SPECIFIED - motd ()
-
Issues an
motdcommand on the FreeDB/CDDB database. Returns anARRAYcontaining the motd lines. - discid (ENTRY)
-
Issues an
discidcommand on the FreeDB/CDDB database using theNet::FreeDB2::EntryobjectENTRY. Returns the discid as calculated by FreeDB/CDDB. - proto ()
-
Issues an
protocommand on the FreeDB/CDDB database. TO BE SPECIFIED - sites ()
-
Issues an
sitescommand on the FreeDB/CDDB database. Returns aNet::FreeDB2::Response::Sitesobject. - stat ()
-
Issues an
statcommand on the FreeDB/CDDB database. TO BE SPECIFIED - ver ()
-
Issues a
vercommand on the FreeDB/CDDB database. TO BE SPECIFIED - update ()
-
Issues an
updatecommand on the FreeDB/CDDB database. TO BE SPECIFIED - whom ()
-
Issues a
whomcommand on the FreeDB/CDDB database. TO BE SPECIFIED - setClientHost (VALUE)
-
Set the client host attribute.
VALUEis the value. - getClientHost ()
-
Returns the client host attribute.
- setClientUser (VALUE)
-
Set the client user attribute.
VALUEis the value. - getClientUser ()
-
Returns the client user attribute.
- setClientName (VALUE)
-
Set the client name attribute.
VALUEis the value. - getClientName ()
-
Returns the client name attribute.
- setClientVersion (VALUE)
-
Set the client version attribute.
VALUEis the value. - getClientVersion ()
-
Returns the client version attribute.
- getClientUser ()
-
Returns the client user attribute.
- setFreeDBHost (VALUE)
-
Set the FreeDB/CDDB host attribute.
VALUEis the value. - getFreeDBHost ()
-
Returns the FreeDB/CDDB host attribute.
- setFreeDBPort (VALUE)
-
Set the FreeDB/CDDB port attribute.
VALUEis the value. - getFreeDBPort ()
-
Returns the FreeDB/CDDB port attribute.
- setProxyHost (VALUE)
-
Set the proxy host attribute.
VALUEis the value. - getProxyHost ()
-
Returns the proxy host attribute.
- setProxyPort (VALUE)
-
Set the proxy port attribute.
VALUEis the value. - getProxyPort ()
-
Returns the proxy port attribute.
- setProxyUser (VALUE)
-
Set the proxy user attribute.
VALUEis the value. - getProxyUser ()
-
Returns the proxy user attribute.
- setProxyPasswd (VALUE)
-
Set the proxy password attribute.
VALUEis the value. - getProxyPasswd ()
-
Returns the proxy password attribute.
- setConnection (VALUE)
-
Set the connection attribute.
VALUEis the value. - getConnection ()
-
Returns the connection attribute.
EXCEPTIONS
Generally, in exceptional situations, Error::Simple exceptions are thrown. See the implementations of this abstract class for details.
SEE ALSO
Net::FreeDB2::Entry, Net::FreeDB2::Match, Net::FreeDB2::Response, Net::FreeDB2::Response::Query and Net::FreeDB2::Response::Read
BUGS
None known (yet).
HISTORY
First development: September 2002
AUTHOR
Vincenzo Zocca <Vincenzo@Zocca.com>
COPYRIGHT
Copyright 2002, Vincenzo Zocca.
LICENSE
This file is part of the Net::FreeDB2 module hierarchy for Perl by Vincenzo Zocca.
The Net::FreeDB2 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 Net::FreeDB2 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 Net::FreeDB2 module hierarchy; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA