org.swhite.daap
Class ServerInfoResponse

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

public class ServerInfoResponse
extends java.lang.Object

ServerInfoResponse holds the data from the response of a /server-info request. Created on Tuesday May 20, 2003

Author:
Steve White

Constructor Summary
ServerInfoResponse(byte[] data)
          Constructs a new ServerInfoResponse from the specified daap data.
ServerInfoResponse(java.lang.String hostname)
          Constructs a new ServerInfoResponse with a default port of 3689
ServerInfoResponse(java.lang.String hostname, int port)
          Constructs a new ServerInfoResponse
ServerInfoResponse(java.net.URL url)
          Constructs a new ServerInfoResponse with the data from the specified URL.
 
Method Summary
 byte getAuthenticationMethod()
          Returns the authentication method required by the server (daap tag msau)
 double getDAAPProtocolVersion()
          Returns the daap protocol version (daap tag apro)
 int getDatabasesCount()
          Returns the database count (daap tag msdc)
 double getDMAPProtocolVersion()
          Returns the dmap protocol version (daap tag mpro)
 java.lang.String getItemName()
          Returns the name of the daap server (daap tag minm)
 int getTimeoutInterval()
          Returns the timeout interval in seconds (daap tag mstm)
 boolean loginrequired()
          Returns the server info response code (daap tag msrv)
 boolean supportsAutologout()
          Returns true if the server supports auto logout (daap tag msal)
 boolean supportsBrowse()
          Returns true if the server supports browse (daap tag msbr)
 boolean supportsExtensions()
          Returns true if the server supports extensions (daap tag msex)
 boolean supportsIndex()
          Returns true if the servver supoprts index (daap tag msix)
 boolean supportsPersistentIDs()
          Returns true if the server supports persistent ids (daap tag mspi)
 boolean supportsQuery()
          Returns true if the server supports query (daap tag msqy)
 boolean supportsResolve()
          Returns true if the server supports resolve (daap tag msrs)
 boolean supportsUpdate()
          Returns true if the server supports update (daap tag msup)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerInfoResponse

public ServerInfoResponse(byte[] data)
                   throws ParserException
Constructs a new ServerInfoResponse from the specified daap data.

Parameters:
data - Raw daap data

ServerInfoResponse

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

Parameters:
url - URL containing the ServerInfoResponse, e.g. http://localhost:3689/server-info

ServerInfoResponse

public ServerInfoResponse(java.lang.String hostname)
                   throws java.io.IOException,
                          java.net.MalformedURLException,
                          ParserException
Constructs a new ServerInfoResponse with a default port of 3689

Parameters:
hostname - The hostname of the daap server

ServerInfoResponse

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

Parameters:
hostname - The hostname of the daap server
port - The port number the daap server is listening on
Method Detail

getDMAPProtocolVersion

public double getDMAPProtocolVersion()
Returns the dmap protocol version (daap tag mpro)

Returns:
an double (e.g. 1.0 for dmap v1.0)

getDAAPProtocolVersion

public double getDAAPProtocolVersion()
Returns the daap protocol version (daap tag apro)

Returns:
an double (e.g. 1.0 for daap v1.0)

getItemName

public java.lang.String getItemName()
Returns the name of the daap server (daap tag minm)

Returns:
the name of the daap server, e.g. "Mike's Music"

loginrequired

public boolean loginrequired()
Returns the server info response code (daap tag msrv)

Returns:
true if a /login request must be made

getTimeoutInterval

public int getTimeoutInterval()
Returns the timeout interval in seconds (daap tag mstm)

Returns:
int

getAuthenticationMethod

public byte getAuthenticationMethod()
Returns the authentication method required by the server (daap tag msau)

Returns:
byte

supportsAutologout

public boolean supportsAutologout()
Returns true if the server supports auto logout (daap tag msal)

Returns:
boolean

supportsUpdate

public boolean supportsUpdate()
Returns true if the server supports update (daap tag msup)

Returns:
boolean

supportsPersistentIDs

public boolean supportsPersistentIDs()
Returns true if the server supports persistent ids (daap tag mspi)

Returns:
boolean

supportsExtensions

public boolean supportsExtensions()
Returns true if the server supports extensions (daap tag msex)

Returns:
boolean

supportsBrowse

public boolean supportsBrowse()
Returns true if the server supports browse (daap tag msbr)

Returns:
boolean

supportsQuery

public boolean supportsQuery()
Returns true if the server supports query (daap tag msqy)

Returns:
boolean

supportsIndex

public boolean supportsIndex()
Returns true if the servver supoprts index (daap tag msix)

Returns:
boolean

supportsResolve

public boolean supportsResolve()
Returns true if the server supports resolve (daap tag msrs)

Returns:
boolean

getDatabasesCount

public int getDatabasesCount()
Returns the database count (daap tag msdc)

Returns:
int

toString

public java.lang.String toString()