public class DefaultDatabaseWorkspaceManager extends AbstractSymbolTable implements DatabaseWorkspaceManager
DatabaseWorkspaceManager.DatabaseWorkspaceListener
functionAlias, functions, symbolTables, vars
CONFIG_CAN_ANONYMOUS_USER_WRITE_IN_THE_TABLES, CONFIG_NAME_STORESREPOSITORYID, CONFIG_NAME_STORESREPOSITORYLABEL, FIELD_CONFIGURATION_NAME, FIELD_CONFIGURATION_VALUE, FIELD_REPOSITORY_EXTRA, FIELD_REPOSITORY_FLAGS, FIELD_REPOSITORY_NAME, FIELD_REPOSITORY_PARAMETERS, FIELD_RESOURCES_NAME, FIELD_RESOURCES_RESOURCE, TABLE_CONFIGURATION, TABLE_CONFIGURATION_NAME, TABLE_REPOSITORY, TABLE_REPOSITORY_NAME, TABLE_RESOURCES, TABLE_RESOURCES_NAME
Constructor and Description |
---|
DefaultDatabaseWorkspaceManager(DataServerExplorerParameters serverParameters) |
Modifier and Type | Method and Description |
---|---|
boolean |
canAnonymousUserWriteInTheTables() |
void |
connect() |
boolean |
contains(DataStoreParameters parameters) |
void |
create(java.lang.String id,
java.lang.String description)
Create and initialize the tables associated with a gvSIG workspace.
|
void |
createTable(int tableid)
Create the configuration table indicated in the workspace.
|
void |
createTableRepository(java.lang.String tableName) |
void |
createTableResources(java.lang.String tableName) |
void |
disconnect() |
void |
drop() |
void |
dropTable(int tableid)
Remove the indicated configuration table from the workspace.
|
boolean |
exists(java.lang.String name) |
boolean |
existsTable(int tableid)
Check if the indicated configuration table exists in the workspace.
|
void |
fix() |
java.lang.String |
get(java.lang.String name)
Gets the value of a configuration variable associated with
this work space.
|
ResourcesStorage |
getAlternativeResourcesStorage(java.lang.String tableName)
If the workspace has an alternate resource storage defined, return it.
|
java.io.File |
getBaseFolder() |
java.lang.String |
getId()
Returns the identifier of this workspace.
|
java.lang.String |
getLabel()
Returns the label of this workspace.
|
java.lang.String |
getLabelOrId() |
ResourcesStorage |
getResourcesStorage() |
DataServerExplorer |
getServerExplorer() |
DataServerExplorerParameters |
getServerExplorerParameters() |
StoresRepository |
getStoresRepository()
Gets the repository of data stores associated with this workspace.
|
FeatureStore |
getTable(int tableid)
Gets the data store associated with the indicated configuration table.
|
DataTransaction |
getTransaction() |
DatabaseWorkspaceManager |
getValue() |
java.io.File |
getWorkspaceFile() |
boolean |
hasAlternativeResourcesStorage() |
boolean |
isConnected() |
boolean |
isValid()
Returns true if the connection associated with this object refers
to a valid workspace.
|
boolean |
isValidStoresRepository()
Returns true if the connection associated with this object refers
to a valid workspace with a stores-repository.
|
java.util.Collection<java.lang.String> |
localvariables() |
boolean |
set(java.lang.String name,
java.lang.String value)
Assigns the indicated value to the configuration variable.
|
void |
setAlternativeResourcesStorage(java.lang.String resourcesPath) |
void |
setBaseFolder(java.io.File baseFolder) |
void |
setTransaction(DataTransaction transaction) |
java.lang.String |
toString() |
java.lang.Object |
value(java.lang.String name) |
boolean |
writeStoresRepositoryEntry(java.lang.String name,
DataStoreParameters parameters)
Add a new data store to the workspace.
|
boolean |
writeStoresRepositoryEntry(java.lang.String name,
DataStoreParameters parameters,
Bitmask flags) |
addFunction, addFunctions, addSymbolTable, clone, containsSymbolTable, fixSymbolTables, fixSymbolTables, function, functions, getFunctionAlias, getFunctions, getName, getSymbolTables, getVars, isSQLCompatible, iterator, localfunctions, removeFunction, removeSymbolTable, removeVar, setVar, variables
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isInternalTable
label
addSymbolTable, clone, containsSymbolTable, function, functions, getName, isSQLCompatible, localfunctions, removeSymbolTable, variables
cloneQuietly, cloneQuietly
public DefaultDatabaseWorkspaceManager(DataServerExplorerParameters serverParameters)
public java.lang.String toString()
toString
in interface LabeledValue<DatabaseWorkspaceManager>
toString
in class AbstractSymbolTable
public java.lang.String getId()
DatabaseWorkspaceManager
getId
in interface DatabaseWorkspaceManager
public java.lang.String getLabel()
DatabaseWorkspaceManager
getLabel
in interface DatabaseWorkspaceManager
getLabel
in interface LabeledValue<DatabaseWorkspaceManager>
public DatabaseWorkspaceManager getValue()
getValue
in interface LabeledValue<DatabaseWorkspaceManager>
public boolean existsTable(int tableid)
DatabaseWorkspaceManager
existsTable
in interface DatabaseWorkspaceManager
public void createTable(int tableid)
DatabaseWorkspaceManager
createTable
in interface DatabaseWorkspaceManager
tableid
- identifier of the configuration table to create.public void dropTable(int tableid)
DatabaseWorkspaceManager
dropTable
in interface DatabaseWorkspaceManager
tableid
- identifier of the configuration table to remove.public FeatureStore getTable(int tableid)
DatabaseWorkspaceManager
getTable
in interface DatabaseWorkspaceManager
tableid
- identifier of the configuration table to get.public DataServerExplorer getServerExplorer()
getServerExplorer
in interface DatabaseWorkspaceManager
public DataServerExplorerParameters getServerExplorerParameters()
getServerExplorerParameters
in interface DatabaseWorkspaceManager
public void createTableResources(java.lang.String tableName) throws java.lang.RuntimeException
createTableResources
in interface DatabaseWorkspaceManager
java.lang.RuntimeException
public void createTableRepository(java.lang.String tableName) throws java.lang.RuntimeException
createTableRepository
in interface DatabaseWorkspaceManager
java.lang.RuntimeException
public java.lang.String get(java.lang.String name)
DatabaseWorkspaceManager
get
in interface DatabaseWorkspaceManager
get
in interface GetItemByKey<java.lang.String,java.lang.Object>
get
in class AbstractSymbolTable
name
- of the variable to consultpublic boolean set(java.lang.String name, java.lang.String value)
DatabaseWorkspaceManager
set
in interface DatabaseWorkspaceManager
name
- of the variable.value
- value to set.public StoresRepository getStoresRepository()
DatabaseWorkspaceManager
getStoresRepository
in interface DatabaseWorkspaceManager
public boolean contains(DataStoreParameters parameters)
public boolean canAnonymousUserWriteInTheTables()
canAnonymousUserWriteInTheTables
in interface DatabaseWorkspaceManager
public java.io.File getBaseFolder()
getBaseFolder
in interface DatabaseWorkspaceManager
public void setBaseFolder(java.io.File baseFolder)
setBaseFolder
in interface DatabaseWorkspaceManager
public java.io.File getWorkspaceFile()
public boolean writeStoresRepositoryEntry(java.lang.String name, DataStoreParameters parameters)
DatabaseWorkspaceManager
writeStoresRepositoryEntry
in interface DatabaseWorkspaceManager
name
- of the data store.parameters
- to open the data store.public boolean writeStoresRepositoryEntry(java.lang.String name, DataStoreParameters parameters, Bitmask flags)
writeStoresRepositoryEntry
in interface DatabaseWorkspaceManager
public boolean isValid()
DatabaseWorkspaceManager
isValid
in interface DatabaseWorkspaceManager
public boolean isValidStoresRepository()
DatabaseWorkspaceManager
isValidStoresRepository
in interface DatabaseWorkspaceManager
public ResourcesStorage getAlternativeResourcesStorage(java.lang.String tableName)
DatabaseWorkspaceManager
getAlternativeResourcesStorage
in interface DatabaseWorkspaceManager
public boolean hasAlternativeResourcesStorage()
hasAlternativeResourcesStorage
in interface DatabaseWorkspaceManager
public void setAlternativeResourcesStorage(java.lang.String resourcesPath)
setAlternativeResourcesStorage
in interface DatabaseWorkspaceManager
public void drop()
drop
in interface DatabaseWorkspaceManager
public void create(java.lang.String id, java.lang.String description)
DatabaseWorkspaceManager
create
in interface DatabaseWorkspaceManager
id
- of the workspacedescription
- of the workspacepublic boolean exists(java.lang.String name)
exists
in interface SymbolTable
exists
in class AbstractSymbolTable
public java.lang.Object value(java.lang.String name)
value
in interface SymbolTable
value
in class AbstractSymbolTable
public java.util.Collection<java.lang.String> localvariables()
localvariables
in interface SymbolTable
localvariables
in class AbstractSymbolTable
public ResourcesStorage getResourcesStorage()
getResourcesStorage
in interface DatabaseWorkspaceManager
public void fix()
public void connect()
connect
in interface DatabaseWorkspaceManager
public void disconnect()
disconnect
in interface DatabaseWorkspaceManager
public boolean isConnected()
isConnected
in interface DatabaseWorkspaceManager
public java.lang.String getLabelOrId()
getLabelOrId
in interface DatabaseWorkspaceManager
public void setTransaction(DataTransaction transaction)
setTransaction
in interface SupportTransactions
public DataTransaction getTransaction()
getTransaction
in interface SupportTransactions