net.sourceforge.neurosdbm.db
Class AdvDatabase

java.lang.Object
  extended bynet.sourceforge.neurosdbm.db.Database
      extended bynet.sourceforge.neurosdbm.db.AdvDatabase

public class AdvDatabase
extends Database

This is the main database class for the "advanced" database. This will eventually replace Database.java.


Nested Class Summary
 
Nested classes inherited from class net.sourceforge.neurosdbm.db.Database
Database.SyncStats
 
Field Summary
private  AdvAudioDB audioDB
           
 
Fields inherited from class net.sourceforge.neurosdbm.db.Database
DB_AA_ALL, DB_AA_ARTISTS, DB_ALBUMS, DB_ARTISTS, DB_AUDIO, DB_FAILEDHISI, DB_GENRES, DB_HISI, DB_IDEDHISI, DB_PCAUDIO, DB_PLAYLISTS, DB_RECORDINGS, DB_TRACKS, DB_UNIDEDHISI, deleteQueue, device, modifyQueue, music, needForPlaylist, path, playlistQueue, syncQueue
 
Constructor Summary
AdvDatabase(java.lang.String _path, boolean createNew, int _device)
           
AdvDatabase(java.lang.String _path, int _device)
          Creates a database given a path and a device.
 
Method Summary
 void createEmptyDatabase()
           
 MDBGroup getMDBGroup(MDBGroupID id)
          Return a MDBGroup given a MDBGroupID.
 java.util.Set getMDBGroups()
          Return a set of MDBGroupIDs that represent all the MDBs in this database.
private  void loadExistingDatabase()
          This function loads an existing database from disk.
 void sort()
           
 void write(boolean disableAutoBackup)
          This function writes the current in memory database to the Neuros device.
 
Methods inherited from class net.sourceforge.neurosdbm.db.Database
addFilesToPlaylist, addToPlaylist, addToPlaylist, addToPlaylist, autoBackup, backup, backupError, computeMDBPointers, createPlaylist, createPlaylist, deleteDatabase, deleteFromPlaylist, deleteQueueContains, fixDBDir, getDevice, getNewTrackFromSyncQueue, getNumberDeleted, getNumberModified, getNumberQueued, getPath, hasModifiedPlaylists, markTracksForDeletion, modifyQueueContains, modifyTrack, query, query, query, queryTracksForAlbum, queryTracksForArtist, queryTracksForGenre, queryTracksForPlaylist, queryTracksForRecordings, queueMP3TrackAdd, queueMP3TrackAdd, queueTrackAdd, queueTracksRecurseDirectories, queueWAVTrackAdd, queueWAVTrackAdd, queueWMATrackAdd, queueWMATrackAdd, rearrangePlaylist, rebuild, rebuild, refreshDatabase, refreshDatabase, removePlaylist, renamePlaylist, restore, sort, synchronize, syncQueueContains, testTrackAdd1, testTrackAdd2, testTrackAddRandom, toString, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

audioDB

private AdvAudioDB audioDB
Constructor Detail

AdvDatabase

public AdvDatabase(java.lang.String _path,
                   boolean createNew,
                   int _device)
            throws java.io.IOException,
                   java.io.FileNotFoundException

AdvDatabase

public AdvDatabase(java.lang.String _path,
                   int _device)
            throws java.io.FileNotFoundException,
                   java.io.IOException,
                   DatabaseCorruptException,
                   DatabaseDoesNotExistException
Creates a database given a path and a device. This assumes that the database is already created. Called on normal startup.

Method Detail

loadExistingDatabase

private void loadExistingDatabase()
                           throws java.io.IOException,
                                  DatabaseDoesNotExistException
This function loads an existing database from disk. First it sees if a correct path was specified. Throws some exceptions if things don't look correct. Assuming everything is OK, then an AdvAudioDB object is created. Eventually we need to add HiSi DB's and PC Audio DB.

Throws:
java.io.IOException
DatabaseDoesNotExistException

createEmptyDatabase

public void createEmptyDatabase()
                         throws java.io.FileNotFoundException,
                                java.io.IOException,
                                DatabaseCorruptException
Overrides:
createEmptyDatabase in class Database
Throws:
java.io.FileNotFoundException
java.io.IOException
DatabaseCorruptException

write

public void write(boolean disableAutoBackup)
           throws java.io.IOException,
                  DatabaseInternalCorruptionException
This function writes the current in memory database to the Neuros device. An autobackup will occur depending on the argument and if the option is set.

Overrides:
write in class Database
Parameters:
disableAutoBackup - true if you don't want to write a autobackup
Throws:
java.io.IOException
DatabaseInternalCorruptionException

getMDBGroups

public java.util.Set getMDBGroups()
Return a set of MDBGroupIDs that represent all the MDBs in this database.


getMDBGroup

public MDBGroup getMDBGroup(MDBGroupID id)
Return a MDBGroup given a MDBGroupID.


sort

public void sort()
Overrides:
sort in class Database


Copyright © 2004 NeurosDBM Dev Team All Rights Reserved.