public class ServerVersion
extends java.lang.Object
implements java.io.Serializable
XDAP
header or an
XDODS-Server
header. XDAP
header content is defined as the protocol version
of the transmission and must be of the form: XDAP
header value of 3.2 indicates a major version of 3
minor version of 2. An XDAP
header value of 2.6.3 indicates a major
version number of 2, a minor version number of 6, and a subminor version
of 3.XDODS-Server
header is a legacy mechanism which
identifies the version of the server software generating the response.
This is somewhat loosely coupled to the protocol version and was the
legacy mechanism for identifying the protocol version. It should be
considered deprecated. Thus, clients seeking to read data from OPeNDAP
servers should first check the server response for the existence of an
XDAP
header, if one is not found then the client should
check for an XDODS-Server
header. If the repsonse is missing
both headers then an exception should be thrown as the server response is
invalid.ClientIO
,
DDS
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
DAP2_PROTOCOL_VERSION |
static int |
XDAP |
static int |
XDODS_SERVER |
Constructor and Description |
---|
ServerVersion(HTTPMethod method)
Determines Server (Protocol) Version based on the headers associated
with the passed org.apache.http.methods.GetMethod.
|
ServerVersion(int major,
int minor)
Construct a new ServerVersion, setting major and minor version explicitly.
|
ServerVersion(java.lang.String ver,
int headerType)
Construct a new ServerVersion, setting major and minor version based
on the full version string.
|
ServerVersion(java.net.URLConnection connection)
Determines Server (Protocol) Version based on the headers associated
with the passed java.net.URLConnection.
|
Modifier and Type | Method and Description |
---|---|
int |
getMajor()
Returns the major version number.
|
int |
getMinor()
Returns the minor version number.
|
int |
getSubMinor()
Returns the sub-minor version number, if it exists.
|
java.lang.String |
getVersionString()
Returns the full version string.
|
java.lang.String |
toString()
Returns the full version string.
|
public static final int XDODS_SERVER
public static final int XDAP
public static final java.lang.String DAP2_PROTOCOL_VERSION
public ServerVersion(HTTPMethod method) throws DAP2Exception
method
- The GetMethod containing the DAP2 headers.DAP2Exception
- When bad things happen (like the headers are
missing or incorrectly constructed.public ServerVersion(java.net.URLConnection connection) throws DAP2Exception
connection
- The URLCOnnection containing the DAP2 headersDAP2Exception
- When bad things happen (like the headers are
missing or incorrectly constructed.public ServerVersion(java.lang.String ver, int headerType) throws DAP2Exception
XDAP
header or an
XDODS-Server
header. XDAP
header content is defined as the protocol version
of the transmission and must be of the form: XDAP
header value of 3.2 indicates a major version of 3
minor version of 2. An XDAP
header value of 2.6.3 indicates a major
version number of 2, a minor version number of 6, and a subminor version
of 3.XDODS-Server
header is a legacy mechanism which
identifies the version of the server software generating the response.
This is somewhat loosely coupled to the protocol version and was the
legacy mechanism for identifying the protocol version. It should be
considered deprecated. Thus, clients seeking to read data from OPeNDAP
servers should first check the server response for the existence of an
XDAP
header, if one is not found then the client should
check for an XDODS-Server
header. If the repsonse is missing
both headers then an exception should be thrown as the server response is
invalid.ver
- the full version string.headerType
- The type of header that the version was read from.
May be set to ServerVersion.XDODS_SERVER
or
ServerVersion.XDAP
DAP2Exception
- When the things go wrong.public ServerVersion(int major, int minor)
major
- the major version number.minor
- the minor version number.public final int getMajor()
public final int getMinor()
public final int getSubMinor()
public final java.lang.String toString()
toString
in class java.lang.Object
public final java.lang.String getVersionString()