public class DataConfigurationUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DATE_TIME_PATTERN |
protected static java.lang.String |
DEFAULT_TEXTURE_FORMAT |
Constructor and Description |
---|
DataConfigurationUtils() |
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String |
chooseImageFormat(java.lang.Object[] formats,
java.lang.String[] formatOrderPreference) |
static org.w3c.dom.Document |
convertToStandardDataConfigDocument(org.w3c.dom.Document doc)
Returns the specified data configuration document transformed to a standard Layer or ElevationModel configuration
document.
|
static org.w3c.dom.Element |
createLevelSetConfigElements(AVList params,
org.w3c.dom.Element context)
Appends LevelSet configuration parameters as elements to the specified context.
|
static java.util.concurrent.ScheduledExecutorService |
createResourceRetrievalService(java.lang.String threadName)
Convenience method to create a
ScheduledExecutorService which can be used by World
Wind components to schedule periodic resource checks. |
static org.w3c.dom.Element |
createWCSLayerConfigElements(AVList params,
org.w3c.dom.Element context)
Appends WCS layer parameters as elements to a specified context.
|
static org.w3c.dom.Element |
createWMSLayerConfigElements(AVList params,
org.w3c.dom.Element context)
Appends WMS layer parameters as elements to a specified context.
|
static java.net.URL |
findExistingDataConfigFile(FileStore fileStore,
java.lang.String fileName)
Returns the URL of an existing data configuration file under the specified file store, or null if no
configuration file exists.
|
static AVList |
getDataConfigCacheName(java.lang.String dataConfigCachePath,
AVList params)
Convenience method for computing a data configuration file's cache name in a FileStore, given the file's cache
path.
|
static java.lang.String |
getDataConfigDisplayName(org.w3c.dom.Element domElement)
Returns the specified data configuration document's display name as a string, or null if the document is not one
of the recognized types.
|
static java.lang.String |
getDataConfigFilename(AVList params,
java.lang.String suffix)
Returns a file store path name for the specified parameters list.
|
static java.lang.String |
getDataConfigType(org.w3c.dom.Element domElement)
Returns the specified data configuration document's type as a string, or null if the document is not one of the
recognized types.
|
protected static LatLon |
getDataDescriptorLatLon(org.w3c.dom.Element context,
java.lang.String path,
javax.xml.xpath.XPath xpath) |
protected static Sector |
getDataDescriptorSector(org.w3c.dom.Element context,
java.lang.String path,
javax.xml.xpath.XPath xpath) |
protected static java.lang.String |
getInactiveLevels(LevelSet levelSet) |
static AVList |
getLevelSetConfigParams(org.w3c.dom.Element domElement,
AVList params)
Parses LevelSet configuration parameters from the specified DOM document.
|
static AVList |
getLevelSetConfigParams(LevelSet levelSet,
AVList params)
Gathers LevelSet configuration parameters from a specified LevelSet reference.
|
protected static int |
getNumEmptyLevels(LevelSet levelSet) |
static java.net.URL |
getOGCGetCapabilitiesURL(AVList params)
Convenience method to get the OGC GetCapabilities URL from a specified parameter list.
|
static java.lang.String[] |
getOGCLayerNames(AVList params)
Convenience method to get the OGC
AVKey.LAYER_NAMES parameter from a specified parameter list. |
static AVList |
getWCSConfigParameters(WCS100Capabilities caps,
WCS100DescribeCoverage coverage,
AVList params) |
static AVList |
getWCSConfigParams(org.w3c.dom.Element domElement,
AVList params) |
static AVList |
getWMSLayerConfigParams(org.w3c.dom.Element domElement,
AVList params)
Parses WMS layer parameters from the XML configuration document starting at domElement.
|
static AVList |
getWMSLayerConfigParams(WMSCapabilities caps,
java.lang.String[] formatOrderPreference,
AVList params) |
static AVList |
getWWDotNetLayerSetConfigParams(org.w3c.dom.Element domElement,
AVList params)
Parses WorldWind .NET LayerSet configuration parameters from the specified document.
|
protected static LatLon |
getWWDotNetLayerSetLatLon(org.w3c.dom.Element context,
java.lang.String path,
javax.xml.xpath.XPath xpath) |
protected static Sector |
getWWDotNetLayerSetSector(org.w3c.dom.Element context,
java.lang.String path,
javax.xml.xpath.XPath xpath) |
static boolean |
hasDataConfigFile(FileStore fileStore,
java.lang.String fileName,
boolean removeIfExpired,
long expiryTime)
Returns true if a configuration file name exists in the store which has not expired.
|
static boolean |
isDataConfig(org.w3c.dom.Element domElement)
Returns true if the specified
Element is a data configuration document. |
static boolean |
isInstalledDataDescriptorConfigDocument(org.w3c.dom.Element domElement)
Returns true if a specified DOM document is a DataDescriptor configuration document, and false otherwise.
|
static boolean |
isWWDotNetLayerSetConfigDocument(org.w3c.dom.Element domElement)
Returns true if a specified document is a WorldWind .NET LayerSet configuration document, and false otherwise.
|
static boolean |
isWWDotNetLayerSetConfigEvent(javax.xml.stream.events.XMLEvent event)
Returns true if a specified XML event is the root of a WorldWind .NET LayerSet configuration document, and false
otherwise.
|
protected static java.lang.String |
makeTitle(WMSCapabilities caps,
java.lang.String layerNames,
java.lang.String styleNames) |
protected static void |
transformDataDescriptorCommonElements(org.w3c.dom.Element context,
org.w3c.dom.Element outElem,
javax.xml.xpath.XPath xpath) |
protected static void |
transformDataDescriptorDataSet(org.w3c.dom.Element context,
org.w3c.dom.Document outDoc,
javax.xml.xpath.XPath xpath) |
protected static void |
transformDataDescriptorElevationModelElements(org.w3c.dom.Element context,
org.w3c.dom.Element outElem,
javax.xml.xpath.XPath xpath) |
protected static void |
transformDataDescriptorLayerElements(org.w3c.dom.Element context,
org.w3c.dom.Element outElem,
javax.xml.xpath.XPath xpath) |
static org.w3c.dom.Document |
transformInstalledDataDescriptorConfigDocument(org.w3c.dom.Element domElement)
Transforms a DataDescriptor configuration document to a standard layer or elevation model configuration document,
depending on the contents of the
Element . |
protected static void |
transformWWDotNetLayerSet(org.w3c.dom.Element context,
org.w3c.dom.Document outDoc,
javax.xml.xpath.XPath xpath) |
static org.w3c.dom.Document |
transformWWDotNetLayerSetConfigDocument(org.w3c.dom.Element domElement)
Transforms a WorldWind .NET LayerSet configuration document to a standard layer configuration document.
|
protected static void |
transformWWDotNetQuadTileSet(org.w3c.dom.Element context,
org.w3c.dom.Element outElem,
javax.xml.xpath.XPath xpath) |
protected static final java.lang.String DATE_TIME_PATTERN
protected static final java.lang.String DEFAULT_TEXTURE_FORMAT
protected static java.lang.String chooseImageFormat(java.lang.Object[] formats, java.lang.String[] formatOrderPreference)
public static org.w3c.dom.Document convertToStandardDataConfigDocument(org.w3c.dom.Document doc)
doc
- the document to transform.java.lang.IllegalArgumentException
- if the document is null.public static org.w3c.dom.Element createLevelSetConfigElements(AVList params, org.w3c.dom.Element context)
Key | Name | Path |
AVKey.DATASET_NAME | DatasetName | String |
AVKey.DATA_CACHE_NAME | DataCacheName | String |
AVKey.SERVICE | Service/URL | String |
AVKey.EXPIRY_TIME | ExpiryTime | Long |
AVKey.EXPIRY_TIME | LastUpdate | Long |
AVKey.FORMAT_SUFFIX | FormatSuffix | String |
AVKey.NUM_LEVELS | NumLevels/@count | Integer |
AVKey.NUM_EMPTY_LEVELS | NumLevels/@numEmpty | Integer |
AVKey.INACTIVE_LEVELS | NumLevels/@inactive | String |
AVKey.SECTOR | Sector | Sector |
AVKey.SECTOR_RESOLUTION_LIMITS | SectorResolutionLimit | LevelSet.SectorResolution |
AVKey.TILE_ORIGIN | TileOrigin/LatLon | LatLon |
AVKey.TILE_WIDTH | TileSize/Dimension/@width | Integer |
AVKey.TILE_HEIGHT | TileSize/Dimension/@height | Integer |
AVKey.LEVEL_ZERO_TILE_DELTA | LastUpdate | LatLon |
AVKey.MAX_ABSENT_TILE_ATTEMPTS | MaxAbsentTileAttempts | Integer |
AVKey.MIN_ABSENT_TILE_CHECK_INTERVAL | MinAbsentTileCheckInterval | Integer |
params
- the key-value pairs which define the LevelSet configuration parameters.context
- the XML document root on which to append LevelSet configuration elements.java.lang.IllegalArgumentException
- if either the parameters or the context are null.public static java.util.concurrent.ScheduledExecutorService createResourceRetrievalService(java.lang.String threadName)
ScheduledExecutorService
which can be used by World
Wind components to schedule periodic resource checks. The returned ExecutorService is backed by a single daemon
thread with minimum priority.threadName
- the String name for the ExecutorService's thread, may be null
.public static org.w3c.dom.Element createWCSLayerConfigElements(AVList params, org.w3c.dom.Element context)
Parameter | Element Path | Type |
AVKey.WCS_VERSION | Service/@version | String |
AVKey.COVERAGE_IDENTIFIERS | Service/coverageIdentifiers | String |
AVKey.GET_COVERAGE_URL | Service/GetCoverageURL | String |
AVKey.GET_CAPABILITIES_URL | Service/GetCapabilitiesURL | String |
AVKey.SERVICE | AVKey#GET_COVERAGE_URL | String |
AVKey.DATASET_NAME | AVKey.COVERAGE_IDENTIFIERS | String |
params
- the key-value pairs which define the WMS layer configuration parameters.context
- the XML document root on which to append WMS layer configuration elements.java.lang.IllegalArgumentException
- if either the parameters or the context are null.public static org.w3c.dom.Element createWMSLayerConfigElements(AVList params, org.w3c.dom.Element context)
Parameter | Element Path | Type |
AVKey.WMS_VERSION | Service/@version | String |
AVKey.LAYER_NAMES | Service/LayerNames | String |
AVKey.STYLE_NAMES | Service/StyleNames | String |
AVKey.GET_MAP_URL | Service/GetMapURL | String |
AVKey.GET_CAPABILITIES_URL | Service/GetCapabilitiesURL | String |
AVKey.SERVICE | AVKey#GET_MAP_URL | String |
AVKey.DATASET_NAME | AVKey.LAYER_NAMES | String |
params
- the key-value pairs which define the WMS layer configuration parameters.context
- the XML document root on which to append WMS layer configuration elements.java.lang.IllegalArgumentException
- if either the parameters or the context are null.public static java.net.URL findExistingDataConfigFile(FileStore fileStore, java.lang.String fileName)
fileStore
- the file store in which to look.fileName
- the file name to look for. If a file with this name does not exist in the store, this looks at
the file's siblings for a match.java.lang.IllegalArgumentException
- if either the file store or file name are null.public static AVList getDataConfigCacheName(java.lang.String dataConfigCachePath, AVList params)
AVKey.DATA_CACHE_NAME
. If the parameter already exists, it's left unchanged.
A data configuration file's cache name is its parent directory in the cache. The cache name therefore points to
the directory containing both the configuration file and any cached data associated with it. Determining the
cache name at run time - instead of hard wiring it in the data configuration file - enables cache data to be
moved to an arbitrary location within the cache.dataConfigCachePath
- the data configuration file's cache path.params
- the output key-value pairs which receive the DATA_CACHE_NAME parameter. A null
reference is permitted.java.lang.IllegalArgumentException
- if the data config file's cache path is null or has length zero.public static java.lang.String getDataConfigDisplayName(org.w3c.dom.Element domElement)
Document Type | Path to Display Name |
---|---|
Layer Configuration | ./DisplayName |
Elevation Model Configuration | ./DisplayName |
Installed DataDescriptor | ./property[@name="dataSet"]/property[@name="gov.nasa.worldwind.avkey.DatasetNameKey"] |
WorldWind .NET LayerSet | ./QuadTileSet/Name |
Other | null |
domElement
- the data configuration document who's display name is returned.java.lang.IllegalArgumentException
- if the document is null.public static java.lang.String getDataConfigFilename(AVList params, java.lang.String suffix)
params
- the parameter list to extract a configuration filename from.suffix
- the file suffix to append on the path name, or null to append no suffix.java.lang.IllegalArgumentException
- if the parameter list is null.public static java.lang.String getDataConfigType(org.w3c.dom.Element domElement)
Document Type | Type String |
---|---|
Layer Configuration | "Layer" |
Elevation Model Configuration | "Elevation Model" |
Installed DataDescriptor | "Layer" or "ElevationModel" |
WorldWind .NET LayerSet | "Layer" |
Other | null |
domElement
- the data configuration document to determine a type for.java.lang.IllegalArgumentException
- if the document is null.protected static LatLon getDataDescriptorLatLon(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
protected static Sector getDataDescriptorSector(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
protected static java.lang.String getInactiveLevels(LevelSet levelSet)
public static AVList getLevelSetConfigParams(org.w3c.dom.Element domElement, AVList params)
Parameter | Element path | Type |
AVKey.DATASET_NAME | DatasetName | String |
AVKey.DATA_CACHE_NAME | DataCacheName | String |
AVKey.SERVICE | Service/URL | String |
AVKey.EXPIRY_TIME | ExpiryTime | Long |
AVKey.EXPIRY_TIME | LastUpdate | Long |
AVKey.FORMAT_SUFFIX | FormatSuffix | String |
AVKey.NUM_LEVELS | NumLevels/@count | Integer |
AVKey.NUM_EMPTY_LEVELS | NumLevels/@numEmpty | Integer |
AVKey.INACTIVE_LEVELS | NumLevels/@inactive | String |
AVKey.SECTOR | Sector | Sector |
AVKey.SECTOR_RESOLUTION_LIMITS | SectorResolutionLimit | LevelSet.SectorResolution |
AVKey.TILE_ORIGIN | TileOrigin/LatLon | LatLon |
AVKey.TILE_WIDTH | TileSize/Dimension/@width | Integer |
AVKey.TILE_HEIGHT | TileSize/Dimension/@height | Integer |
AVKey.LEVEL_ZERO_TILE_DELTA | LastUpdate | LatLon |
AVKey.MAX_ABSENT_TILE_ATTEMPTS | AbsentTiles/MaxAttempts | Integer |
AVKey.MIN_ABSENT_TILE_CHECK_INTERVAL | AbsentTiles/MinCheckInterval/Time | Integer milliseconds |
domElement
- the XML document root to parse for LevelSet configuration parameters.params
- the output key-value pairs which receive the LevelSet configuration parameters. A null
reference is permitted.java.lang.IllegalArgumentException
- if the document is null.public static AVList getLevelSetConfigParams(LevelSet levelSet, AVList params)
Parameter | Element Path | Type | |
AVKey.DATASET_NAME | First Level's dataset | String | |
AVKey.DATA_CACHE_NAME | First Level's cacheName | String | |
AVKey.SERVICE | First Level's service | String | |
AVKey.EXPIRY_TIME | First Level's expiryTime | Long | |
AVKey.FORMAT_SUFFIX | FirstLevel's formatSuffix | String | |
AVKey.NUM_LEVELS | numLevels | Integer | |
AVKey.NUM_EMPTY_LEVELS | 1 + index of first non-empty Level | Integer | |
AVKey.INACTIVE_LEVELS | Comma delimited string of Level numbers | String | |
AVKey.SECTOR | sector | Sector | |
AVKey.SECTOR_RESOLUTION_LIMITS | sectorLevelLimits | LevelSet.SectorResolution | |
AVKey.TILE_ORIGIN | tileOrigin | LatLon | |
AVKey.TILE_WIDTH | First Level's tileWidth | Integer | |
AVKey.TILE_HEIGHT | First Level's tileHeight | Integer | |
AVKey.LEVEL_ZERO_TILE_DELTA | levelZeroTileDelta | LatLon |
levelSet
- the LevelSet reference to gather configuration parameters from.params
- the output key-value pairs which receive the LevelSet configuration parameters. A null reference
is permitted.java.lang.IllegalArgumentException
- if the document is null.protected static int getNumEmptyLevels(LevelSet levelSet)
public static java.net.URL getOGCGetCapabilitiesURL(AVList params)
params
- parameter list to get the GetCapabilities parameters from.java.lang.IllegalArgumentException
- if the parameter list is null.public static java.lang.String[] getOGCLayerNames(AVList params)
AVKey.LAYER_NAMES
parameter from a specified parameter list. If the
parameter is available as a String, this returns all the OGC layer names found in that String. Otherwise this
returns null.params
- parameter list to get the layer names from.java.lang.IllegalArgumentException
- if the parameter list is null.public static AVList getWCSConfigParameters(WCS100Capabilities caps, WCS100DescribeCoverage coverage, AVList params)
public static AVList getWCSConfigParams(org.w3c.dom.Element domElement, AVList params)
public static AVList getWMSLayerConfigParams(org.w3c.dom.Element domElement, AVList params)
Parameter | Element Path | Type |
AVKey.WMS_VERSION | Service/@version | String |
AVKey.LAYER_NAMES | Service/LayerNames | String |
AVKey.STYLE_NAMES | Service/StyleNames | String |
AVKey.GET_MAP_URL | Service/GetMapURL | String |
AVKey.GET_CAPABILITIES_URL | Service/GetCapabilitiesURL | String |
AVKey.SERVICE | AVKey#GET_MAP_URL | String |
AVKey.DATASET_NAME | AVKey.LAYER_NAMES | String |
domElement
- the XML document root to parse for WMS layer parameters.params
- the output key-value pairs which receive the WMS layer parameters. A null reference is
permitted.java.lang.IllegalArgumentException
- if the document is null.public static AVList getWMSLayerConfigParams(WMSCapabilities caps, java.lang.String[] formatOrderPreference, AVList params)
public static AVList getWWDotNetLayerSetConfigParams(org.w3c.dom.Element domElement, AVList params)
Parameter | Element Path | Type | |
---|---|---|---|
AVKey.DISPLAY_NAME | QuadTileSet/Name | String | |
AVKey.DATASET_NAME | QuadTileSet/Name | String | |
AVKey.OPACITY | QuadTileSet/Opacity | Double | |
AVKey.SERVICE_NAME | "Offline" (string constant) | String | |
AVKey.FORMAT_SUFFIX | QuadTileSet/ImageAccessor/ImageFileExtension | String | |
AVKey.IMAGE_FORMAT | QuadTileSet/ImageAccessor/ImageFileExtension (converted to mime type) | String | |
AVKey.AVAILABLE_IMAGE_FORMATS | QuadTileSet/ImageAccessor/ImageFileExtension (converted to mime type) | String array | |
AVKey.NUM_LEVELS | QuadTileSet/ImageAccessor/NumberLevels | Integer | |
AVKey.NUM_EMPTY_LEVELS | 0 (integer constant) | Integer | |
AVKey.SECTOR | QuadTileSet/BoundingBox | Sector | |
AVKey.TILE_ORIGIN | (-90, -180) (geographic location constant) | LatLon | |
AVKey.LEVEL_ZERO_TILE_DELTA | QuadTileSet/ImageAccessor/LevelZeroTileSizeDegrees | LatLon | |
AVKey.TILE_WIDTH | QuadTileSet/ImageAccessor/TextureSizePixels | Integer | |
AVKey.TILE_HEIGHT | QuadTileSet/ImageAccessor/TextureSizePixels | Integer | |
AVKey.NETWORK_RETRIEVAL_ENABLED | false (boolean constant) | Boolean | |
AVKey.TEXTURE_FORMAT | "image/dds" | String | |
AVKey.USE_MIP_MAPS | true (boolean constant) | Boolean | |
AVKey.USE_TRANSPARENT_TEXTURES | true (boolean constant) | Boolean |
domElement
- the XML document root to parse for LayerSet configuration parameters.params
- the output key-value pairs which receive the LayerSet configuration parameters. A null
reference is permitted.java.lang.IllegalArgumentException
- if the document is null.protected static LatLon getWWDotNetLayerSetLatLon(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
protected static Sector getWWDotNetLayerSetSector(org.w3c.dom.Element context, java.lang.String path, javax.xml.xpath.XPath xpath)
public static boolean hasDataConfigFile(FileStore fileStore, java.lang.String fileName, boolean removeIfExpired, long expiryTime)
findExistingDataConfigFile(gov.nasa.worldwind.cache.FileStore,
String)
to determine the URL of any existing file names. If an existing file has expired, and removeIfExpired is
true, this removes the existing file.fileStore
- the file store in which to look.fileName
- the file name to look for. If a file with this name does not exist in the store, this
looks at the file's siblings for a match.removeIfExpired
- true to remove the existing file, if it exists and is expired; false otherwise.expiryTime
- the time in milliseconds, before which a file is considered to be expired.java.lang.IllegalArgumentException
- if either the file store or file name are null.public static boolean isDataConfig(org.w3c.dom.Element domElement)
Element
is a data configuration document. This recognizes the
following data configuration documents: domElement
- the document in question.java.lang.IllegalArgumentException
- if the document is null.public static boolean isInstalledDataDescriptorConfigDocument(org.w3c.dom.Element domElement)
domElement
- the DOM document in question.java.lang.IllegalArgumentException
- if document is null.public static boolean isWWDotNetLayerSetConfigDocument(org.w3c.dom.Element domElement)
domElement
- the document in question.java.lang.IllegalArgumentException
- if document is null.public static boolean isWWDotNetLayerSetConfigEvent(javax.xml.stream.events.XMLEvent event)
event
- the XML event in question.java.lang.IllegalArgumentException
- if the event is null.protected static java.lang.String makeTitle(WMSCapabilities caps, java.lang.String layerNames, java.lang.String styleNames)
protected static void transformDataDescriptorCommonElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)
protected static void transformDataDescriptorDataSet(org.w3c.dom.Element context, org.w3c.dom.Document outDoc, javax.xml.xpath.XPath xpath)
protected static void transformDataDescriptorElevationModelElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)
protected static void transformDataDescriptorLayerElements(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)
public static org.w3c.dom.Document transformInstalledDataDescriptorConfigDocument(org.w3c.dom.Element domElement)
Element
.domElement
- DataDescriptor document to transform.java.lang.IllegalArgumentException
- if the document is null.protected static void transformWWDotNetLayerSet(org.w3c.dom.Element context, org.w3c.dom.Document outDoc, javax.xml.xpath.XPath xpath)
public static org.w3c.dom.Document transformWWDotNetLayerSetConfigDocument(org.w3c.dom.Element domElement)
domElement
- LayerSet document to transform.java.lang.IllegalArgumentException
- if the document is null.protected static void transformWWDotNetQuadTileSet(org.w3c.dom.Element context, org.w3c.dom.Element outElem, javax.xml.xpath.XPath xpath)