org.lyra.LastDotFm
Class Snooper

java.lang.Object
  extended by org.lyra.LastDotFm.Snooper
All Implemented Interfaces:
UpdateListener

public class Snooper
extends java.lang.Object
implements UpdateListener

The snooper is a direct tie in into Last.fm service that will provide the 'Scrobbling' capability. This will inform the service of a new song being played.

Since:
1.0.1
Version:
1.0.5, %Revision, 174%, %LastChangedDate, 27/10/12 3:33PM%
Author:
Martin Foster
See Also:
Demarcation, UpdateListener

Field Summary
private static java.lang.String CLASS
           
private  java.util.Map<java.lang.String,java.lang.String> CurrentSong
           
private  java.lang.String CurrentState
           
private  Demarcation Deploy
           
private  java.util.Map<java.lang.String,java.lang.String> Global
           
private  Status Info
           
private  java.util.Map<java.lang.String,java.lang.String> Lang
           
private  Ledger Logger
           
private static int MIN_SONG
           
private  java.lang.Long StartTime
           
 
Constructor Summary
Snooper(Status info, Ledger logger, java.util.Map<java.lang.String,java.lang.String> global, java.util.Map<java.lang.String,java.lang.String> lang)
          Base constructor for the Snooper.
 
Method Summary
 void hostUpdated(UpdateEvent update)
          Updates of host information as passed through this specific method.
private  java.util.Map<java.lang.String,java.lang.String> updateDetails(java.util.Map<java.lang.String,java.lang.String> state)
          Extracts the information from the org.lyra.Host.Status class and extracts the currently playing song.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Info

private Status Info

Logger

private Ledger Logger

Global

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

Lang

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

Deploy

private Demarcation Deploy

CurrentSong

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

CurrentState

private java.lang.String CurrentState

StartTime

private java.lang.Long StartTime

MIN_SONG

private static final int MIN_SONG
See Also:
Constant Field Values

CLASS

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

Snooper

public Snooper(Status info,
               Ledger logger,
               java.util.Map<java.lang.String,java.lang.String> global,
               java.util.Map<java.lang.String,java.lang.String> lang)
Base constructor for the Snooper.

Parameters:
info - Information handle on the daemon.
logger - Ledger instance for logging.
global - Global settings map.
lang - Language dependent map.
Method Detail

updateDetails

private java.util.Map<java.lang.String,java.lang.String> updateDetails(java.util.Map<java.lang.String,java.lang.String> state)
Extracts the information from the org.lyra.Host.Status class and extracts the currently playing song. Based on state and currently playing elements.

Returns:
Map containing current song details.

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