public class LoadManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_OF_ITEMS_PER_PAGE
Number of results displayed per page on the models list page.
|
| Constructor and Description |
|---|
LoadManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
getAllModelsFromDatabase()
Fetch and store locally the list of all models in the database.
|
java.util.List<XMLDBModel> |
getAllModelsFromDatabase(int pageNumber)
Get the list of models for the given page number.
|
int |
getNoOfPages()
Get the total number of pages required to display the
models list.
|
int |
getTotalNumberOfModels()
Get the total number of models in the database.
|
static Entity |
importModel(java.lang.String name,
boolean byReference,
NamedObj container)
Given a model name, return an Entity object.
|
static PtolemyEffigy |
loadModel(java.lang.String name,
Configuration configuration)
Given a model name, return a PtolemyEffigy objects.
|
static PtolemyEffigy |
loadModelUsingId(java.lang.String id,
Configuration configuration)
Given a model id, return a PtolemyEffigy objects.
|
public static int NO_OF_ITEMS_PER_PAGE
public static Entity importModel(java.lang.String name, boolean byReference, NamedObj container) throws DBConnectionException, DBExecutionException, java.lang.Exception, CircularDependencyException
name - The model name. An alphanumeric
string without special characters.
If no model with the given name is found, return null.byReference - Indication that the model should be included by reference.container - The NamedObj that will contain this imported model.
It is used here to obtain a unique name.DBConnectionException - Thrown by DBModelFetcher if a problem occurs with the
database connection.DBExecutionException - Thrown by DBModelFetcher if a problem while executing a
command.java.lang.Exception - Thrown if a problem occurs creating an effigy from the MoML.CircularDependencyException - Thrown if an import would result in a circular dependency.public static PtolemyEffigy loadModel(java.lang.String name, Configuration configuration) throws DBConnectionException, DBExecutionException, java.lang.Exception
name - The model name. An alphanumeric
string without special characters.
If no model with the given name is found, return null.configuration - The configuration used to create the effigy.DBConnectionException - Thrown by DBModelFetcher if a problem occurs with the
database connection.DBExecutionException - Thrown by DBModelFetcher if a problem while executing a
command.java.lang.Exception - Thrown if a problem occurs creating an effigy from the MoML.public static PtolemyEffigy loadModelUsingId(java.lang.String id, Configuration configuration) throws DBConnectionException, DBExecutionException, java.lang.Exception
id - The model id. An alphanumeric
string without special characters.
If no model with the given name is found, return null.configuration - The configuration used to create the effigy.DBConnectionException - Thrown by DBModelFetcher if a problem occurs with the
database connection.DBExecutionException - Thrown by DBModelFetcher if a problem while executing a
command.java.lang.Exception - Thrown if a problem occurs creating an effigy from the MoML.public java.util.List<XMLDBModel> getAllModelsFromDatabase(int pageNumber) throws DBConnectionException, DBExecutionException
pageNumber - Page number of the page whose models need to be fetched.DBConnectionException - If thrown while connecting to the database.DBExecutionException - If thrown while executing query in the
database.public void getAllModelsFromDatabase()
throws DBConnectionException,
DBExecutionException
DBConnectionException - If thrown while connecting to the
database.DBExecutionException - If thrown while executing the
query in the database.public int getTotalNumberOfModels()
throws DBConnectionException,
DBExecutionException
DBConnectionException - If thrown while connecting to the
database.DBExecutionException - If thrown while executing the
query in the database.public int getNoOfPages()
throws DBConnectionException,
DBExecutionException
DBConnectionException - If thrown while connecting to the
database.DBExecutionException - If thrown while executing the
query in the database.