|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.qtunes.scanner.Scanner
public class Scanner
The Scanner scans the disk looking for new files, and attempts
to load them by calling TrackReader.read(java.io.File). If it
succeeds it adds the tracks to the database.
| Constructor Summary | |
|---|---|
Scanner()
|
|
| Method Summary | |
|---|---|
ServiceContext |
getContext()
Return the ServiceContext that was passed into Service.startService(org.qtunes.core.ServiceContext) |
long |
getLastScan()
Return the timestamp of the last scan in milliseconds |
java.io.File |
getRoot()
Return a list of paths this Scanner will traverse |
java.util.Map<java.lang.String,java.lang.Object> |
reportState()
Return a Map describing the state of this Service, for serialization back to any client that needs to know (eg webplayer) - so values should be serializable objects, eg Lists, Maps or simple objects. |
void |
rescan()
Rescan for any tracks changed since the last scan |
void |
rescan(long lastscan)
Rescan for any tracks changed since the specified timestamp |
void |
run()
The main scanning thread |
void |
startService(ServiceContext context)
Start the Service |
void |
stopService(ServiceContext context)
Stop the Service |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Scanner()
| Method Detail |
|---|
public void startService(ServiceContext context)
Service
startService in interface Servicecontext - the ServiceContext for this Servicepublic void stopService(ServiceContext context)
Service
stopService in interface Servicecontext - the ServiceContext for this Service (same as was passed into start)public ServiceContext getContext()
ServiceService.startService(org.qtunes.core.ServiceContext)
getContext in interface Servicepublic void rescan()
public void rescan(long lastscan)
lastscan - the timestamp in millisecondspublic java.io.File getRoot()
public long getLastScan()
public void run()
run in interface java.lang.Runnablepublic java.util.Map<java.lang.String,java.lang.Object> reportState()
Service
reportState in interface Service
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||