pl.edu.agh.cast.data.persistence
Class PersistenceProviderLocator

java.lang.Object
  extended by pl.edu.agh.cast.data.persistence.PersistenceProviderLocator

public final class PersistenceProviderLocator
extends Object

Locator of TransparentPersistenceProvider instance.

Author:
AGH CAST Team

Constructor Summary
PersistenceProviderLocator()
           
 
Method Summary
static IPersistenceProvider createPersistenceProvider(String providerId, String filePath)
          Attempts to create an instance of persistence provider with given ID using the specified persistence file.
static String getPersistenceFilePath(String providerId)
          Returns the path to persistence file for provider with given ID.
static TransparentPersistenceProvider getProvider()
          Returns the instance of persistence provider.
static String selectPersistenceProvider()
          Selects a persistence provider to be used in a new project.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceProviderLocator

public PersistenceProviderLocator()
Method Detail

getProvider

public static TransparentPersistenceProvider getProvider()
Returns the instance of persistence provider.

Returns:
the instance of persistence provider

createPersistenceProvider

public static IPersistenceProvider createPersistenceProvider(String providerId,
                                                             String filePath)
                                                      throws PersistenceException
Attempts to create an instance of persistence provider with given ID using the specified persistence file.

Parameters:
providerId - the ID of the persistence provider
filePath - the path to persistence file
Returns:
a new instance of persistence provider
Throws:
PersistenceException - if provider with given ID could not be created

selectPersistenceProvider

public static String selectPersistenceProvider()
Selects a persistence provider to be used in a new project.

Returns:
the ID of selected persistence provider

getPersistenceFilePath

public static String getPersistenceFilePath(String providerId)
Returns the path to persistence file for provider with given ID.

Parameters:
providerId - the ID of the persistence provider
Returns:
the path to the persistence file (relative to the project directory)


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.