|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopendap.dap.ServerVersion
public class ServerVersion
Aprses and holds the Server Version information returned by a DAP server.
This information is used to determine the version of the DAP protocol used to
by the DAP server to encode the data.
Currently the Server Version can come from
more than one source. An DAP server responding to to a client request
over HTTP must include either an XDAP
header or an
XDODS-Server
header.
>
The XDAP
header content is defined as the protocol version
of the transmission and must be of the form:
MV.mv[.mmv]
Where:
MV = Major Version Number
mv = Minor Version Number
mmv = An optional sub-minor version number.
For example an 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.
The 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 FormField Summary | |
---|---|
static java.lang.String |
DAP2_PROTOCOL_VERSION
|
static int |
XDAP
|
static int |
XDODS_SERVER
|
Constructor Summary | |
---|---|
ServerVersion(org.apache.commons.httpclient.methods.GetMethod method)
Determines Server (Protocol) Version based on the headers associated with the passed org.apache.commons.httpclient.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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int XDODS_SERVER
public static final int XDAP
public static final java.lang.String DAP2_PROTOCOL_VERSION
Constructor Detail |
---|
public ServerVersion(org.apache.commons.httpclient.methods.GetMethod 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 headers
DAP2Exception
- 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.Method Detail |
---|
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |