org.lyra.Database
Class Library

java.lang.Object
  extended by org.lyra.Database.Library
All Implemented Interfaces:
java.lang.Runnable, UpdateListener

public class Library
extends java.lang.Object
implements java.lang.Runnable, UpdateListener

Deals with the basic status handling of the Music Player Daemon protocol and its interaction with the rest of the system.

Version:
1.0.5, %Revision, 174%, %LastChangedDate, 27/10/12 3:33PM%
Author:
Martin Foster

Field Summary
private  AbstractBlock Block
           
private static java.lang.String CLASS
           
private  Terminus Host
           
private  Status Information
           
private  java.util.Map<java.lang.String,java.lang.String> Lang
           
private  Ledger Logger
           
private  Comptroller Manager
           
private  java.lang.Thread Synch
           
 
Constructor Summary
Library(Ledger logger, Comptroller manager, Terminus host, AbstractBlock block, Status information, java.util.Map<java.lang.String,java.lang.String> lang)
          Primary constructor for this class.
Library(Ledger logger, Comptroller manager, Terminus host, Status information, java.util.Map<java.lang.String,java.lang.String> lang)
          This is an alternate constructor used when there is no need to block a user interface.
 
Method Summary
 void hostUpdated(UpdateEvent update)
          Updates of host information as passed through this specific method.
 void run()
           
 void syncLibrary()
          Manages the database of songs stored on our local database and the host daemon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Logger

private Ledger Logger

Manager

private Comptroller Manager

Host

private Terminus Host

Block

private AbstractBlock Block

Information

private Status Information

Lang

private java.util.Map<java.lang.String,java.lang.String> Lang

Synch

private java.lang.Thread Synch

CLASS

private static final java.lang.String CLASS
See Also:
Constant Field Values
Constructor Detail

Library

public Library(Ledger logger,
               Comptroller manager,
               Terminus host,
               AbstractBlock block,
               Status information,
               java.util.Map<java.lang.String,java.lang.String> lang)
Primary constructor for this class. Primarily responsible for passing up the base Classes for management and generating the initial maps.

Parameters:
logger - Ledger instance for logging and debugging purposes.
manager - Comptroller instance for interacting with the database.
host - Terminus instance for direct interaction with the Host.
block - Blocking capability instance.
information - Status information from the Music Player Daemon.
lang - Map containing language elements.

Library

public Library(Ledger logger,
               Comptroller manager,
               Terminus host,
               Status information,
               java.util.Map<java.lang.String,java.lang.String> lang)
This is an alternate constructor used when there is no need to block a user interface.

Parameters:
logger - Ledger instance for logging and debugging purposes.
manager - Comptroller instance for interacting with the database.
host - Terminus instance for direct interaction with the Host.
information - Status information from the Music Player Daemon.
lang - Map containing language elements.
Method Detail

syncLibrary

public void syncLibrary()
Manages the database of songs stored on our local database and the host daemon. Attempts to make the overall transition more straight forward.


run

public void run()
Specified by:
run in interface java.lang.Runnable

hostUpdated

public void hostUpdated(UpdateEvent update)
Description copied from interface: UpdateListener
Updates of host information as passed through this specific method. Multiple updates can be triggered from this, so it becomes important to check for a specific update if necessary in order to avoid undue

Specified by:
hostUpdated in interface UpdateListener
Parameters:
update - Update notification method.
See Also:
UpdateEvent