|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.DefaultRepository
public class DefaultRepository
Default Repository implementation allows GeoTools to manage your DataStores.
To use this implementation you can "registery" new DataStores:
Field Summary | |
---|---|
protected java.util.Map<org.opengis.feature.type.Name,DataAccess<?,?>> |
repository
Holds the DataStores so we can clean up when closed |
Constructor Summary | |
---|---|
DefaultRepository()
|
Method Summary | |
---|---|
DataAccess<?,?> |
access(org.opengis.feature.type.Name name)
Search for the DataAccess (may be a DataStore) by name. |
DataAccess<?,?> |
access(java.lang.String name)
|
DataStore |
dataStore(org.opengis.feature.type.Name name)
Search for the DataStore by name. |
DataStore |
datastore(java.lang.String id)
|
DataStore |
dataStore(java.lang.String name)
|
java.util.List<DataStore> |
getDataStores()
List of available DataStore instances; these are considered to be live/connected datastores under the management of the application and should not be closed or otherwise harmed by client code. |
java.util.Set<org.opengis.feature.type.Name> |
getNames()
|
void |
load(java.io.File propertiesFile)
Load a quick repository from a properties file. |
boolean |
lockExists(java.lang.String lockID)
Check if a lock exists in any of the DataStores. |
boolean |
lockRefresh(java.lang.String lockID,
Transaction transaction)
Implement lockRefresh. |
boolean |
lockRelease(java.lang.String lockID,
Transaction transaction)
Implement lockRelease. |
void |
register(org.opengis.feature.type.Name name,
DataAccess<?,?> dataStore)
|
void |
register(java.lang.String name,
DataAccess<?,?> dataStore)
Register a new DataStore with this registery |
FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
source(java.lang.String dataStoreId,
java.lang.String typeName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<org.opengis.feature.type.Name,DataAccess<?,?>> repository
Constructor Detail |
---|
public DefaultRepository()
Method Detail |
---|
public DataAccess<?,?> access(java.lang.String name)
public DataAccess<?,?> access(org.opengis.feature.type.Name name)
Repository
access
in interface Repository
name
- The Name (namespace and name) to search for
public DataStore dataStore(java.lang.String name)
public DataStore dataStore(org.opengis.feature.type.Name name)
Repository
dataStore
in interface Repository
public void load(java.io.File propertiesFile) throws java.lang.Exception
This is useful for test cases; the format is:
nameA=param=value,param2=value2,...
nameB=param=value,param2=value2,...
java.io.IOException
java.io.FileNotFoundException
java.lang.Exception
public boolean lockExists(java.lang.String lockID)
lockID
- public boolean lockRefresh(java.lang.String lockID, Transaction transaction) throws java.io.IOException
Currently it is an error if the lockID is not found. Because if we can't find it we cannot refresh it.
Since locks are time sensitive it is impossible to check if a lockExists and then be sure it will still exist when you try to refresh it. Nothing we do can protect client code from this fact, they will need to do with the IOException when (not if) this situation occurs.
lockID
- Authorizataion of lock to refreshtransaction
- Transaction used to authorize refresh
java.io.IOException
- If opperation encounters problems, or lock not found
java.lang.IllegalArgumentException
- if lockID is null
org.geotools.data.Catalog#lockRefresh(java.lang.String, org.geotools.data.Transaction)
public boolean lockRelease(java.lang.String lockID, Transaction transaction) throws java.io.IOException
Currently it is not and error if the lockID is not found, it may have expired. Since locks are time sensitive it is impossible to check if a lockExists and then be sure it will still exist when you try to release it.
lockID
- Authorizataion of lock to refreshtransaction
- Transaction used to authorize refresh
java.io.IOException
- If opperation encounters problems
java.lang.IllegalArgumentException
- if lockID is null
org.geotools.data.Catalog#lockRefresh(java.lang.String, org.geotools.data.Transaction)
public void register(java.lang.String name, DataAccess<?,?> dataStore) throws java.io.IOException
Description ...
String
- namespace Namespace todataStore
-
java.io.IOException
org.geotools.data.Catalog#registerDataStore(org.geotools.data.DataStore)
public void register(org.opengis.feature.type.Name name, DataAccess<?,?> dataStore) throws java.io.IOException
java.io.IOException
public DataStore datastore(java.lang.String id)
public FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> source(java.lang.String dataStoreId, java.lang.String typeName) throws java.io.IOException
java.io.IOException
public java.util.Set<org.opengis.feature.type.Name> getNames()
public java.util.List<DataStore> getDataStores()
Repository
getDataStores
in interface Repository
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |