|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.vfny.geoserver.global.GlobalLayerSupertype org.vfny.geoserver.global.Data
This class stores all the information that a catalog would (and CatalogConfig used to).
Constructor Summary | |
Data(DataDTO config,
java.io.File dir)
Data constructor. |
Method Summary | |
static java.lang.String |
get(java.util.Map map,
java.lang.String key)
get purpose. |
static boolean |
get(java.util.Map map,
java.lang.String key,
boolean defaultValue)
get purpose. |
static java.nio.charset.Charset |
get(java.util.Map map,
java.lang.String key,
java.nio.charset.Charset defaultCharSet)
get purpose. |
static java.lang.Class |
get(java.util.Map map,
java.lang.String key,
java.lang.Class defaultType)
get purpose. |
static java.io.File |
get(java.util.Map map,
java.lang.String key,
java.io.File defaultFile)
get purpose. |
static int |
get(java.util.Map map,
java.lang.String key,
int defaultValue)
get purpose. |
static java.util.logging.Level |
get(java.util.Map map,
java.lang.String key,
java.util.logging.Level defaultLevel)
get purpose. |
static java.util.List |
get(java.util.Map map,
java.lang.String key,
java.util.List defaultList)
get purpose. |
static java.util.Map |
get(java.util.Map map,
java.lang.String key,
java.util.Map defaultMap)
get purpose. |
static java.lang.String |
get(java.util.Map map,
java.lang.String key,
java.lang.String defaultValue)
get purpose. |
static java.net.URL |
get(java.util.Map map,
java.lang.String key,
java.net.URL defaultUrl)
get purpose. |
java.io.File |
getBaseDir()
Returns the baseDir for use with relative paths. |
DataStoreInfo |
getDataStoreInfo(java.lang.String id)
Locate a DataStoreInfo by its id attribute. |
java.util.Set |
getDataStores()
Access to the set of DataStores in use by GeoServer. |
NameSpaceInfo |
getDefaultNameSpace()
getDefaultNameSpace purpose. |
java.lang.String |
getDefaultPrefix()
Prefix of the defaultNamespace. |
org.geotools.data.FeatureSource |
getFeatureSource(java.lang.String prefix,
java.lang.String typeName)
Convience method for Accessing FeatureSource by prefix:typeName. |
FeatureTypeInfo |
getFeatureTypeInfo(java.lang.String typeName)
getFeatureTypeInfo purpose. |
FeatureTypeInfo |
getFeatureTypeInfo(java.lang.String namespacePrefix,
java.lang.String uri)
Gets a FeatureTypeInfo from a local type name (ie unprefixed), and a uri. |
java.util.Map |
getFeatureTypeInfos()
Retrieve map of FeatureTypeInfo by prefix:typeName. |
NameSpaceInfo |
getNameSpace(java.lang.String prefix)
getNameSpace purpose. |
org.geotools.data.NamespaceMetaData |
getNamespaceMetaData(java.lang.String prefix)
Implement getNamespace. |
NameSpaceInfo[] |
getNameSpaces()
getNameSpaces purpose. |
java.util.Set |
getPrefixes()
Set of available Namespace prefixes. |
org.geotools.styling.Style |
getStyle(java.lang.String id)
|
java.util.Map |
getStyles()
getStyles purpose. |
org.geotools.styling.Style |
loadStyle(java.io.File fileName)
Load GeoTools2 Style from a fileName |
org.geotools.styling.Style |
loadStyle(java.lang.String fileName,
java.lang.String base)
|
boolean |
lockExists(java.lang.String lockID)
Implement lockExists. |
void |
lockRefresh(java.lang.String lockID)
Refresh lock by authorization |
boolean |
lockRefresh(java.lang.String lockID,
org.geotools.data.Transaction t)
Implement lockRefresh. |
void |
lockRelease(java.lang.String lockID)
Release lock by authorization |
boolean |
lockRelease(java.lang.String lockID,
org.geotools.data.Transaction t)
Implement lockRelease. |
protected java.lang.String |
notNull(java.lang.String s)
checks s for nullity and if so, returns an empty String,
else just returns s |
void |
registerDataStore(org.geotools.data.DataStore dataStore)
Register a DataStore with this Catalog. |
java.util.Map |
statusDataStores()
Dynamically tries to connect to every DataStore! |
java.util.Map |
statusNamespaces()
Dynamically tries to connect to every Namespace! |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Data(DataDTO config, java.io.File dir) throws ConfigurationException
Creates a Data object from the data provided.
config
- DataDTO initial data.
ConfigurationException
Method Detail |
public java.util.Map statusDataStores()
Returns a map of Exception by dataStoreId:typeName. If by some marvel the we could connect to a FeatureSource we will record Boolean.TRUE.
public java.util.Map statusNamespaces()
Returns a map of Exception by prefix:typeName. If by some marvel the we could connect to a FeatureSource we will record Boolean.TRUE.
public DataStoreInfo getDataStoreInfo(java.lang.String id)
id
- the DataStoreInfo id looked for
id
or
null if there no existspublic NameSpaceInfo[] getNameSpaces()
List of all relevant namespaces
public NameSpaceInfo getNameSpace(java.lang.String prefix)
The NameSpaceInfo from the specified prefix
prefix
-
public NameSpaceInfo getDefaultNameSpace()
Returns the default NameSpaceInfo for this Data object.
public java.util.Map getStyles()
A reference to the map of styles
public org.geotools.styling.Style getStyle(java.lang.String id)
public FeatureTypeInfo getFeatureTypeInfo(java.lang.String typeName) throws java.util.NoSuchElementException
returns the FeatureTypeInfo for the specified unique name
typeName
- String The FeatureTypeInfo Name
java.util.NoSuchElementException
public FeatureTypeInfo getFeatureTypeInfo(java.lang.String namespacePrefix, java.lang.String uri)
This method is slow, use getFeatureType(String typeName), where possible. For not he only user should be TransactionFeatureHandler.
TODO: Jody here - David is this still correct?
namespacePrefix
- Name NameSpaceInfo nameuri
- NameSpaceInfo uri
public java.util.Map getFeatureTypeInfos()
Returns all the featuretype information objects
public org.geotools.styling.Style loadStyle(java.lang.String fileName, java.lang.String base) throws java.io.IOException
java.io.IOException
public org.geotools.styling.Style loadStyle(java.io.File fileName) throws java.io.IOException
fileName
- DOCUMENT ME!
java.io.IOException
- DOCUMENT ME!public void lockRelease(java.lang.String lockID)
lockID
- public void lockRefresh(java.lang.String lockID)
Should use your own transaction?
lockID
- public boolean lockRefresh(java.lang.String lockID, org.geotools.data.Transaction t) throws java.io.IOException
lockRefresh
in interface org.geotools.data.Catalog
lockID
- t
-
java.io.IOException
org.geotools.data.Data#lockRefresh(java.lang.String,
org.geotools.data.Transaction)
public boolean lockRelease(java.lang.String lockID, org.geotools.data.Transaction t) throws java.io.IOException
lockRelease
in interface org.geotools.data.Catalog
lockID
- t
-
java.io.IOException
org.geotools.data.Data#lockRelease(java.lang.String,
org.geotools.data.Transaction)
public boolean lockExists(java.lang.String lockID)
lockExists
in interface org.geotools.data.Catalog
lockID
-
org.geotools.data.Data#lockExists(java.lang.String)
public java.util.Set getPrefixes()
getPrefixes
in interface org.geotools.data.Catalog
Catalog.getPrefixes()
public java.lang.String getDefaultPrefix()
getDefaultPrefix
in interface org.geotools.data.Catalog
Catalog.getDefaultPrefix()
public org.geotools.data.NamespaceMetaData getNamespaceMetaData(java.lang.String prefix)
Description ...
getNamespaceMetaData
in interface org.geotools.data.Catalog
prefix
-
org.geotools.data.Catalog#getNamespace(java.lang.String)
public void registerDataStore(org.geotools.data.DataStore dataStore) throws java.io.IOException
This is part of the public CatalogAPI, the fact that we don't want to support it here may be gounds for it's removal.
GeoSever and the global package would really like to have complete control over the DataStores in use by the application. It recognize that this may not always be possible. As GeoServer is extend with additional Modules (such as config) that wish to locate and talk to DataStores independently of GeoServer the best we can do is ask them to register with the this Catalog in global.
This reveals what may be a deisgn flaw in GeoTools2 DataStore. We have know way of knowing if the dataStore has already been placed into our care as DataStores are not good at identifying themselves. To complicate matters most keep a static connectionPool around in their Factory - it could be that the Factories are supposed to be smart enough to prevent duplication.
registerDataStore
in interface org.geotools.data.Catalog
dataStore
-
java.io.IOException
Catalog.registerDataStore(org.geotools.data.DataStore)
public java.util.Set getDataStores()
The provided Set may not be modified :-)
getDataStores
in interface org.geotools.data.Catalog
org.geotools.data.Catalog#getDataStores(java.lang.String)
public org.geotools.data.FeatureSource getFeatureSource(java.lang.String prefix, java.lang.String typeName) throws java.io.IOException
This method is part of the public Catalog API. It allows the Validation framework to be writen using only public Geotools2 interfaces.
getFeatureSource
in interface org.geotools.data.Catalog
prefix
- Namespace prefix in which the FeatureType availabletypeName
- typeNamed used to identify FeatureType
java.io.IOException
- DOCUMENT ME!Catalog.getFeatureSource(java.lang.String,
java.lang.String)
public java.io.File getBaseDir()
protected java.lang.String notNull(java.lang.String s)
s
for nullity and if so, returns an empty String,
else just returns s
s
- String
public static java.lang.String get(java.util.Map map, java.lang.String key)
Gets a String from a map of Strings
map
- Map the map to extract the string fromkey
- String the key for the map.
Map
public static java.io.File get(java.util.Map map, java.lang.String key, java.io.File defaultFile)
Gets a File from a map given the specified key. If the file is not found the default file is returned.
map
- Map the map to extract the file fromkey
- String the key to extract the value fordefaultFile
- The default value should the key not exist.
public static java.lang.String get(java.util.Map map, java.lang.String key, java.lang.String defaultValue)
Gets a String from a map of Strings, and returns the default if the string does not exist.
map
- Map the map to extract the string fromkey
- String the key for the map.defaultValue
- The default value should the key not exist.
Map
public static java.util.List get(java.util.Map map, java.lang.String key, java.util.List defaultList)
Gets a List from a map given the specified key. If the list is not found the default list is returned.
map
- Map the map to extract the file fromkey
- String the key to extract the value fordefaultList
- The default value should the key not exist.
public static java.util.Map get(java.util.Map map, java.lang.String key, java.util.Map defaultMap)
Gets a Map from a map given the specified key. If the map is not found the default map is returned.
map
- Map the map to extract the file fromkey
- String the key to extract the value fordefaultMap
- The default value should the key not exist.
public static int get(java.util.Map map, java.lang.String key, int defaultValue)
Gets a int from a map given the specified key. If the int is not found the default int is returned.
map
- Map the map to extract the file fromkey
- String the key to extract the value fordefaultValue
- The default value should the key not exist.
public static boolean get(java.util.Map map, java.lang.String key, boolean defaultValue)
Gets a boolean from a map given the specified key. If the boolean is not found the default boolean is returned.
map
- Map the map to extract the file fromkey
- String the key to extract the value fordefaultValue
- The default value should the key not exist.
public static java.nio.charset.Charset get(java.util.Map map, java.lang.String key, java.nio.charset.Charset defaultCharSet)
Gets a Charset from a map given the specified key. If the Charset is not found the default Charset is returned.
map
- Map the map to extract the file fromkey
- String the key to extract the value fordefaultCharSet
- The default value should the key not exist.
public static java.util.logging.Level get(java.util.Map map, java.lang.String key, java.util.logging.Level defaultLevel)
Gets a Level from a map given the specified key. If the Level is not found the default Level is returned.
map
- Map the map to extract the file fromkey
- String the key to extract the value fordefaultLevel
- The default value should the key not exist.
public static java.net.URL get(java.util.Map map, java.lang.String key, java.net.URL defaultUrl)
Gets a URL from a map given the specified key. If the URL is not found the default URL is returned.
map
- Map the map to extract the file fromkey
- String the key to extract the value fordefaultUrl
- The default value should the key not exist.
public static java.lang.Class get(java.util.Map map, java.lang.String key, java.lang.Class defaultType)
Gets a Class from a map given the specified key. If the Class is not found the default Class is returned.
map
- Map the map to extract the file fromkey
- String the key to extract the value fordefaultType
- The default value should the key not exist.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |