org.swhite.daap
Class Databases

java.lang.Object
  extended byorg.swhite.daap.Databases

public class Databases
extends java.lang.Object

Created on Tuesday May 20, 2003

Author:
Steve White

Constructor Summary
Databases(byte[] data)
          Constructs a new Database Response with the specified daap data.
Databases(java.lang.String hostname, int sessionID, int revisionNumber)
          Constructs a new DatabaseResponse with a default port of 3689
Databases(java.lang.String hostname, int port, int sessionID, int revisionNumber)
          Constructs a new DatabaseResponse
Databases(java.net.URL url)
          Constructs a new DatabaseResponse with the data from the specified URL.
 
Method Summary
 Database getDatabaseAtIndex(int index)
          Returns the specified Database
 java.util.ArrayList getDatabases()
          Returns an ArrayList of all Databases
 int getDatabasesCount()
          Returns the number of databases
 byte getUpdateType()
          Returns the update type (daap tag muty)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Databases

public Databases(byte[] data)
          throws ParserException
Constructs a new Database Response with the specified daap data.

Parameters:
data - Raw daap data

Databases

public Databases(java.net.URL url)
          throws java.io.IOException,
                 ParserException
Constructs a new DatabaseResponse with the data from the specified URL.

Parameters:
url - URL containing the DatabaseResponse, e.g. http://localhost:3689/databases?session-id=@@session-id@@&revision-number=@@revision-number@@

Databases

public Databases(java.lang.String hostname,
                 int sessionID,
                 int revisionNumber)
          throws java.io.IOException,
                 java.net.MalformedURLException,
                 ParserException
Constructs a new DatabaseResponse with a default port of 3689

Parameters:
hostname - The hostname of the daap server
sessionID - The Session ID from LoginResponse
revisionNumber - The Server Revision from UpdateResponse

Databases

public Databases(java.lang.String hostname,
                 int port,
                 int sessionID,
                 int revisionNumber)
          throws java.io.IOException,
                 java.net.MalformedURLException,
                 ParserException
Constructs a new DatabaseResponse

Parameters:
hostname - The hostname of the daap server
port - The Port Number the daap server is listening on
sessionID - The Session ID from LoginResponse
revisionNumber - The Server Revision from UpdateResponse
Method Detail

getUpdateType

public byte getUpdateType()
Returns the update type (daap tag muty)

Returns:
byte

getDatabasesCount

public int getDatabasesCount()
Returns the number of databases

Returns:
int

getDatabaseAtIndex

public Database getDatabaseAtIndex(int index)
Returns the specified Database

Parameters:
index - index of the database
Returns:
Database

getDatabases

public java.util.ArrayList getDatabases()
Returns an ArrayList of all Databases

Returns:
ArrayList

toString

public java.lang.String toString()