public class DDMSVersion
extends Object
This class is the extension point for supporting new DDMS versions in the future. DDMSVersion maintains a thread-local
currentVersion variable which can be set at runtime. All DDMS component constructors which build components from
scratch can then call DDMSVersion.getCurrentVersion()
to access various details such as schema
locations and namespace URIs. If no currentVersion has been set, a default will be used, which maps to
buri.ddmsence.ddms.defaultVersion
in the properties file. This defaults to 5.0 right now.
The ddmsence.properties file has a property, ddms.supportedVersions
which can be a comma-separated list
of version
numbers. Each of these token values then has a set of properties which identify the namespace and schema locations
for each DDMS version:
<versionNumber>.ddms.xmlNamespace
: i.e. "urn:us:mil:ces:metadata:ddms:5"<versionNumber>.ddms.xsdLocation
: i.e. "/schemas/5.0/DDMS/ddms.xsd"<versionNumber>.gml.xmlNamespace
: i.e. "http://www.opengis.net/gml/3.2"<versionNumber>.gml.xsdLocation
: i.e. "/schemas/5.0/DDMS/gml.xsd"<versionNumber>.ism.cveLocation
: i.e. "/schemas/5.0/ISM/CVE/"<versionNumber>.ism.xmlNamespace
: i.e. "urn:us:gov:ic:ism"<versionNumber>.ntk.xmlNamespace
: i.e. "urn:us:gov:ic:ntk"<versionNumber>.ntk.xsdLocation
: i.e. "/schemas/5.0/NTK/IC-NTK.xsd"<versionNumber>.tspi.xmlNamespace
: i.e. "http://metadata.ces.mil/mdr/ns/GSIP/tspi/2.0"<versionNumber>.tspi.xsdLocation
: i.e. "/schemas/5.0/tspi/2.0.0/tspi.xsd"<versionNumber>.virt.xmlNamespace
: i.e. "urn:us:gov:ic:virt"<versionNumber>.xlink.xmlNamespace
: i.e. "http://www.w3.org/1999/xlink"
The format of an xsdLocation should generally follow
/schemas/<versionNumber>/schemaLocationInDataDirectory
.
Version-specific Notes:
Because DDMS 3.0.1 is syntactically identical to DDMS 3.0, requests for version 3.0.1 will simply alias to DDMS 3.0. DDMS 3.0.1 is not set up as a separate batch of schemas and namespaces, since none of the technical artifacts changed (3.0.1 was a documentation release).
Because DDMS 4.1 uses the same XML namespace as DDMS 4.0, resolving the XML namespace to a version will always return 4.1 (because it is newer). 4.0.1 is now an alias for 4.1, and warnings will appear when using new 4.1 components.
Modifier and Type | Method and Description |
---|---|
static void |
clearCurrentVersion()
Clears the current version.
|
static DDMSVersion |
getCurrentVersion()
Accessor for the current version.
|
String |
getGmlNamespace()
Accessor for the gml namespace
|
String |
getGmlSchema()
Accessor for the gml schema location
|
String |
getIsmCveLocation()
Accessor for the ISM CVE location
|
String |
getIsmNamespace()
Accessor for the ISM namespace
|
String |
getNamespace()
Accessor for the DDMS namespace
|
String |
getNtkNamespace()
Accessor for the NTK namespace
|
String |
getNtkSchema()
Accessor for the NTK schema location
|
String |
getSchema()
Accessor for the DDMS schema location
|
static List<String> |
getSupportedVersions()
Returns a list of supported DDMS versions
|
String |
getTspiNamespace()
Accessor for the tspi namespace
|
String |
getTspiSchema()
Accessor for the tspi schema location
|
String |
getVersion()
Accessor for the version number
|
static DDMSVersion |
getVersionFor(String version)
Returns the DDMSVersion instance mapped to a particular version number.
|
static DDMSVersion |
getVersionForNamespace(String namespace)
Returns the DDMSVersion instance mapped to a particular XML namespace.
|
String |
getVirtNamespace()
Accessor for the virt namespace
|
String |
getXlinkNamespace()
Accessor for the xlink namespace
|
boolean |
isAtLeast(String version)
Convenience method to check if a DDMS version number is equal to or higher that some
test number.
|
static boolean |
isSupportedDDMSNamespace(String xmlNamespace)
Checks if an XML namespace is included in the list of supported XML namespaces for DDMS
|
static DDMSVersion |
setCurrentVersion(String version)
Sets the currentVersion which will be used for by DDMS component constructors to determine the namespace and
schema to use.
|
String |
toString() |
public boolean isAtLeast(String version)
version
- the version number to checkpublic static List<String> getSupportedVersions()
public static boolean isSupportedDDMSNamespace(String xmlNamespace)
xmlNamespace
- the namespace to testpublic static DDMSVersion getVersionFor(String version)
version
- a version numberUnsupportedVersionException
- if the version number is not supportedpublic static DDMSVersion getVersionForNamespace(String namespace)
namespace
- the XML namespaceUnsupportedVersionException
- if the version number is not supportedpublic static DDMSVersion setCurrentVersion(String version)
version
- the new version, which must be supported by DDMSenceUnsupportedVersionException
- if the version is not supportedpublic static DDMSVersion getCurrentVersion()
public static void clearCurrentVersion()
public String toString()
toString
in class Object
Object.toString()
public String getVersion()
public String getNamespace()
public String getSchema()
public String getGmlNamespace()
public String getGmlSchema()
public String getIsmCveLocation()
public String getIsmNamespace()
public String getNtkNamespace()
public String getNtkSchema()
public String getTspiNamespace()
public String getTspiSchema()
public String getVirtNamespace()
public String getXlinkNamespace()
Copyright 2010 - 2019 by Brian Uri!
Generated on 09/15/2016 12:36 PM
https://ddmsence.urizone.net/