|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.geotools.data.DefaultRepository
Quick hack of a DataRepository allows me to bridge the existing DataStore API with these experiments for a Opperations api. I have used the old DefaultCatalaog as a starting point. This also serves as a reminder that we need CrossDataStore functionality - at least for Locks. And possibly for "Query".
| Field Summary | |
protected java.util.SortedMap |
datastores
Map of DataStore by dataStoreId |
| Constructor Summary | |
DefaultRepository()
|
|
| Method Summary | |
DataStore |
datastore(java.lang.String id)
Implement getDataStores. |
java.util.Map |
getDataStores()
Access to the set of registered DataStores. |
java.util.SortedMap |
getFeatureSources()
All FeatureSources by typeRef ( aka dataStoreId:typeName) |
java.util.Set |
getPrefixes()
Retrieve prefix set. |
void |
load(java.io.File propertiesFile)
Load a quick datastore definition from a properties file. |
boolean |
lockExists(java.lang.String lockID)
Implement lockExists. |
boolean |
lockRefresh(java.lang.String lockID,
Transaction transaction)
Implement lockRefresh. |
boolean |
lockRelease(java.lang.String lockID,
Transaction transaction)
Implement lockRelease. |
void |
register(java.lang.String id,
DataStore dataStore)
Implement registerDataStore. |
FeatureSource |
source(java.lang.String dataStoreId,
java.lang.String typeName)
FeatureSoruce access. |
java.util.SortedMap |
types()
All FeatureTypes by dataStoreId:typeName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.SortedMap datastores
| Constructor Detail |
public DefaultRepository()
| Method Detail |
public void load(java.io.File propertiesFile)
throws java.lang.Exception
This is useful for test cases.
java.io.IOException
java.io.FileNotFoundException
java.lang.Exceptionpublic java.util.SortedMap getFeatureSources()
Repository
getFeatureSources in interface Repository
public java.util.Set getPrefixes()
throws java.io.IOException
getPrefixes in interface Repositoryjava.io.IOExceptionorg.geotools.data.Catalog#getPrefixes()
public java.util.SortedMap types()
throws java.io.IOException
java.io.IOExceptionpublic boolean lockExists(java.lang.String lockID)
lockExists in interface RepositorylockID -
org.geotools.data.Catalog#lockExists(java.lang.String)
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.
lockRefresh in interface RepositorylockID - 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 nullorg.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.
lockRelease in interface RepositorylockID - Authorizataion of lock to refreshtransaction - Transaction used to authorize refresh
java.io.IOException - If opperation encounters problems
java.lang.IllegalArgumentException - if lockID is nullorg.geotools.data.Catalog#lockRefresh(java.lang.String, org.geotools.data.Transaction)
public void register(java.lang.String id,
DataStore dataStore)
throws java.io.IOException
Description ...
dataStore -
java.io.IOExceptionorg.geotools.data.Catalog#registerDataStore(org.geotools.data.DataStore)public DataStore datastore(java.lang.String id)
Description ...
org.geotools.data.Catalog#getDataStores(java.lang.String)public java.util.Map getDataStores()
The provided Set may not be modified :-)
getDataStores in interface Repositoryorg.geotools.data.Catalog#getDataStores(java.lang.String)
public FeatureSource source(java.lang.String dataStoreId,
java.lang.String typeName)
throws java.io.IOException
Repository
source in interface RepositorydataStoreId - typeName -
java.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||