org.geotools.data
Class FeatureSourceRepository

java.lang.Object
  extended byorg.geotools.data.FeatureSourceRepository
All Implemented Interfaces:
Repository

public class FeatureSourceRepository
extends java.lang.Object
implements Repository

Another Quick hack of a DataRepository as a bridge to the Opperations api. This time we are storing by FeatureType, not DataStores will be harned in the configuration of this class.

Author:
Jody Garnett

Field Summary
protected  java.util.SortedMap featuresources
          Map of FeatuerSource by dataStoreId:typeName
 
Constructor Summary
FeatureSourceRepository()
           
 
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 FeatureTypes by dataStoreId:typeName
 java.util.Set getPrefixes()
          Retrieve prefix set.
 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, FeatureSource featureSource)
          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

featuresources

protected java.util.SortedMap featuresources
Map of FeatuerSource by dataStoreId:typeName

Constructor Detail

FeatureSourceRepository

public FeatureSourceRepository()
Method Detail

getFeatureSources

public java.util.SortedMap getFeatureSources()
All FeatureTypes by dataStoreId:typeName

Specified by:
getFeatureSources in interface Repository

getPrefixes

public java.util.Set getPrefixes()
                          throws java.io.IOException
Retrieve prefix set.

Specified by:
getPrefixes in interface Repository
Returns:
Set of namespace prefixes
Throws:
java.io.IOException
See Also:
org.geotools.data.Catalog#getPrefixes()

types

public java.util.SortedMap types()
All FeatureTypes by dataStoreId:typeName


lockExists

public boolean lockExists(java.lang.String lockID)
Implement lockExists.

Specified by:
lockExists in interface Repository
Parameters:
lockID -
Returns:
true if lock was found
See Also:
org.geotools.data.Catalog#lockExists(java.lang.String)

lockRefresh

public boolean lockRefresh(java.lang.String lockID,
                           Transaction transaction)
                    throws java.io.IOException
Implement lockRefresh.

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.

Specified by:
lockRefresh in interface Repository
Parameters:
lockID - Authorizataion of lock to refresh
transaction - Transaction used to authorize refresh
Returns:
true if lock was found and refreshed
Throws:
java.io.IOException - If opperation encounters problems, or lock not found
java.lang.IllegalArgumentException - if lockID is null
See Also:
org.geotools.data.Catalog#lockRefresh(java.lang.String, org.geotools.data.Transaction)

lockRelease

public boolean lockRelease(java.lang.String lockID,
                           Transaction transaction)
                    throws java.io.IOException
Implement lockRelease.

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.

Specified by:
lockRelease in interface Repository
Parameters:
lockID - Authorizataion of lock to refresh
transaction - Transaction used to authorize refresh
Returns:
true if lock was found and released
Throws:
java.io.IOException - If opperation encounters problems
java.lang.IllegalArgumentException - if lockID is null
See Also:
org.geotools.data.Catalog#lockRefresh(java.lang.String, org.geotools.data.Transaction)

register

public void register(java.lang.String id,
                     FeatureSource featureSource)
              throws java.io.IOException
Implement registerDataStore.

Description ...

Throws:
java.io.IOException
See Also:
org.geotools.data.Catalog#registerDataStore(org.geotools.data.DataStore)

datastore

public DataStore datastore(java.lang.String id)
Implement getDataStores.

Description ...

Returns:
See Also:
org.geotools.data.Catalog#getDataStores(java.lang.String)

getDataStores

public java.util.Map getDataStores()
Access to the set of registered DataStores.

The provided Set may not be modified :-)

Specified by:
getDataStores in interface Repository
Returns:
See Also:
org.geotools.data.Catalog#getDataStores(java.lang.String)

source

public FeatureSource source(java.lang.String dataStoreId,
                            java.lang.String typeName)
                     throws java.io.IOException
Description copied from interface: Repository
FeatureSoruce access.

Specified by:
source in interface Repository
Parameters:
dataStoreId -
typeName -
Returns:
Throws:
java.io.IOException


Copyright © GeoTools. All Rights Reserved.