Show / Hide Table of Contents

Class DatabaseManager

The DatabaseManager that is used for deleting, adding, and removing VISAB files.

Inheritance
java.lang.Object
DatabaseManager
Implements
org.visab.eventbus.IPublisher<org.visab.eventbus.event.VISABFileSavedEvent>
Inherited Members
java.lang.Object.clone()
java.lang.Object.equals(java.lang.Object)
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.hashCode()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.toString()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)
Namespace:
Assembly: .dll
Syntax
public class DatabaseManager implements IPublisher<VISABFileSavedEvent>

Constructors

DatabaseManager()

Declaration
public DatabaseManager()

Fields

DATABASE_PATH

Declaration
public static final String DATABASE_PATH
Field Value
Type Description
java.lang.String

DATA_PATH_SUFFIX

Declaration
public static final String DATA_PATH_SUFFIX
Field Value
Type Description
java.lang.String

Methods

deleteFile(String fileName, String game)

Deletes a VISAB file from the database.

Declaration
public boolean deleteFile(String fileName, String game)
Parameters
Type Name Description
java.lang.String fileName

The name of the file

java.lang.String game

The game of the file

Returns
Type Description
boolean

True if successful

getRepository()

The repository that is internally used for the I/O operations.

Declaration
public DatabaseRepository getRepository()
Returns
Type Description
DatabaseRepository

getSavedFiles()

A list of file information for files that were recently saved via SessionListeners or FileExplorer view.

Declaration
public List<SavedFileInformation> getSavedFiles()
Returns
Type Description
java.util.List<SavedFileInformation>

getSessionFileName(UUID sessionId)

Gets the name of a file that was saved under the given sessionId.

Declaration
public String getSessionFileName(UUID sessionId)
Parameters
Type Name Description
java.util.UUID sessionId

The sessionId to get the file for

Returns
Type Description
java.lang.String

The saved files name if one was saved, "" else

loadFile(String absolutePath)

Loads a VISAB file from the given path.

Declaration
public IVISABFile loadFile(String absolutePath)
Parameters
Type Name Description
java.lang.String absolutePath

The path to the file

Returns
Type Description
IVISABFile

The file if successfully loaded, null else

loadFile(String fileName, String game)

Loads a VISAB file from the database.

Declaration
public IVISABFile loadFile(String fileName, String game)
Parameters
Type Name Description
java.lang.String fileName

The name of the file

java.lang.String game

The game of the file

Returns
Type Description
IVISABFile

The file if successfully loaded, null else

loadSessionFile(UUID sessionId)

Loads a file that was saved by a session listener during the current runtime.

Declaration
public IVISABFile loadSessionFile(UUID sessionId)
Parameters
Type Name Description
java.util.UUID sessionId

The sessionId of the session for which the file was saved

Returns
Type Description
IVISABFile

The saved file if there was one, null else

publish(VISABFileSavedEvent event)

Declaration
public void publish(VISABFileSavedEvent event)
Parameters
Type Name Description
VISABFileSavedEvent event

saveFile(IVISABFile file, String fileName)

Saves a VISAB file. When calling from SessionListeners, use the overload containing the sessionId as 3rd parameter instead.

Declaration
public boolean saveFile(IVISABFile file, String fileName)
Parameters
Type Name Description
IVISABFile file

The file to save

java.lang.String fileName

The name of the file

Returns
Type Description
boolean

True if successful

saveFile(IVISABFile file, String fileName, UUID sessionId)

Saves a VISAB file. This method should be called by SessionListeners, so that newly saved files can be accessed by sessionId.

Declaration
public boolean saveFile(IVISABFile file, String fileName, UUID sessionId)
Parameters
Type Name Description
IVISABFile file

The file to save

java.lang.String fileName

The name of the file

java.util.UUID sessionId

The Id of the session

Returns
Type Description
boolean

True if successful

Implements

org.visab.eventbus.IPublisher<org.visab.eventbus.event.VISABFileSavedEvent>
In This Article
Back to top Generated by DocFX