public class AddeURL
extends java.lang.Object
implements java.lang.Cloneable
URLs must all have the following format:
adde://host/request?keyword_1=value_1&keyword_2=value_2
where request can be one of the following:
datasetinfo - request for data set information (LWPR)
griddirectory - request for grid directory information (GDIR)
griddata - request for grid data (GGET)
imagedata - request for data in AreaFile format (AGET)
imagedirectory - request for image directory information (ADIR)
pointdata - request for point data (MDKS)
textdata - request to read a text file (TXTG)
wxtext - request to read a weather text file (WTXG)
obtext - request to read a observation text file (OBTG)
There can be any valid combination of the following supported keywords:
-------for any request
group=<groupname> ADDE group name
user=<user_id> ADDE user identification
proj=<proj #> a valid ADDE project number
trace=<0/1> setting to 1 tells server to write debug
trace file
version= ADDE version number, currently 1 except for
griddata requests
debug= set to true to watch the printlns stream by
compress= set to "gzip" if you want to use the GZIP
compression or "compress" if you want to use
transfers in Unix compress format (You need to
have the VisAD package if you want to support
this.) default = none.
port= Socket port to connect on. Overridden by
a port specified in the host
(e.g., adde.ucar.edu:500)
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ADDE_PROTOCOL
The protocol
|
static java.lang.String |
ALL
Value for ALL
|
static int |
COMPRESS
Flag for "compress" compression.
|
static java.lang.String |
DEFAULT_VALUE
Default value for key/value pairs (X)
|
static int |
GZIP
Flag for GZip compression.
|
static java.lang.String |
KEY_COMPRESS
Keyword for compress
|
static java.lang.String |
KEY_DEBUG
Keyword for debug
|
static java.lang.String |
KEY_PORT
Keyword for port
|
static java.lang.String |
KEY_PROJ
Keyword for project
|
static java.lang.String |
KEY_TRACE
Keyword for trace
|
static java.lang.String |
KEY_USER
Keyword for user
|
static java.lang.String |
KEY_VERSION
Keyword for version
|
static java.lang.String |
NO
Value for no
|
static int |
NO_COMPRESS
Flag for "no compress" compression.
|
static java.lang.String |
REQ_ADIR
ADIR request type
|
static java.lang.String |
REQ_AGET
AGET request type
|
static java.lang.String |
REQ_DATASETINFO
Data set info request type
|
static java.lang.String |
REQ_GDIR
GDIR request type
|
static java.lang.String |
REQ_GGET
GGET request type
|
static java.lang.String |
REQ_GRIDDATA
Grid data request type
|
static java.lang.String |
REQ_GRIDDIR
Grid directory request type
|
static java.lang.String |
REQ_IMAGEDATA
Image data request type
|
static java.lang.String |
REQ_IMAGEDIR
Image directory request type
|
static java.lang.String |
REQ_LWPR
LWPR request type
|
static java.lang.String |
REQ_MDKS
MDKS request type
|
static java.lang.String |
REQ_OBTEXT
obs text request type
|
static java.lang.String |
REQ_OBTG
OBTG request type
|
static java.lang.String |
REQ_POINTDATA
Point data request type
|
static java.lang.String |
REQ_TEXT
Text request type
|
static java.lang.String |
REQ_TXTG
TXTG request type
|
static java.lang.String |
REQ_WTXG
WTXG request type
|
static java.lang.String |
REQ_WXTEXT
weather text request type
|
static int |
TRACE_OFF
flag for trace off
|
static int |
TRACE_ON
flag for trace on
|
static java.lang.String |
YES
Value for yes
|
| Constructor and Description |
|---|
AddeURL()
Create an ADDE URL
|
AddeURL(java.lang.String host,
java.lang.String requestType)
Create an ADDE URL from the given spec
|
AddeURL(java.lang.String host,
java.lang.String requestType,
java.lang.String extraKeys)
Create an ADDE URL from the given spec
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendKeyValue(java.lang.StringBuffer buf,
java.lang.String name,
java.lang.String value)
A utility method to make a name=value part of the adde request string
|
java.lang.Object |
clone()
Clones this instance.
|
boolean |
equals(java.lang.Object o)
Compare two AddeURLs
|
int |
getCompression()
Get the compression type for this ADDE URL
|
boolean |
getDebug()
Get the debug value for this ADDE URL
|
java.lang.String |
getExtraKeys()
Get the extraKeys string for this ADDE URL
|
java.lang.String |
getHost()
Get the host for this ADDE URL
|
int |
getPort()
Get the port for this ADDE URL
|
int |
getProject()
Get the project for this ADDE URL
|
java.lang.String |
getRequestType()
Get the request type for this ADDE URL
|
int |
getTrace()
Get the trace value used for this ADDE URL
|
java.lang.String |
getURLString()
Create the ADDE URL as a String
|
java.lang.String |
getUser()
Get the project for this ADDE URL
|
java.lang.String |
getValue(java.lang.String query,
java.lang.String key)
Get the value for a particular key.
|
java.lang.String |
getVersion()
Get the version for this ADDE URL
|
int |
hashCode()
Get the hashcode for this
|
protected java.lang.String |
makeQuery()
Make the query portion of the URL (e.g., key1=value1&key2=value2..)
|
protected void |
parseQuery(java.lang.String query)
Parse the query string and set the values accordingly, subclasses
should extend to parse their particular keywords
|
void |
setCompression(int compress)
Set the compression type used for this ADDE URL
|
void |
setCompressionFromString(java.lang.String type)
Set the compression type from a string
|
void |
setDebug(boolean debug)
Set the debug value this ADDE URL
|
void |
setExtraKeys(java.lang.String extraKeys)
Set the extraKeys string for this ADDE URL
|
void |
setHost(java.lang.String host)
Set the host for this ADDE URL
|
void |
setPort(int port)
Set the port used for this ADDE URL
|
void |
setProject(int project)
Set the project for this ADDE URL
|
void |
setRequestType(java.lang.String requestType)
Set the request type for this ADDE URL
|
void |
setTrace(int trace)
Set the trace value used for this ADDE URL
|
void |
setUser(java.lang.String user)
Set the user for this ADDE URL
|
void |
setVersion(java.lang.String version)
Set the version this ADDE URL
|
public static final java.lang.String ADDE_PROTOCOL
public static final java.lang.String REQ_AGET
public static final java.lang.String REQ_ADIR
public static final java.lang.String REQ_LWPR
public static final java.lang.String REQ_GDIR
public static final java.lang.String REQ_GGET
public static final java.lang.String REQ_MDKS
public static final java.lang.String REQ_TXTG
public static final java.lang.String REQ_WTXG
public static final java.lang.String REQ_OBTG
public static final java.lang.String REQ_IMAGEDATA
public static final java.lang.String REQ_IMAGEDIR
public static final java.lang.String REQ_DATASETINFO
public static final java.lang.String REQ_TEXT
public static final java.lang.String REQ_WXTEXT
public static final java.lang.String REQ_OBTEXT
public static final java.lang.String REQ_GRIDDATA
public static final java.lang.String REQ_GRIDDIR
public static final java.lang.String REQ_POINTDATA
public static final java.lang.String DEFAULT_VALUE
public static final java.lang.String YES
public static final java.lang.String NO
public static final java.lang.String ALL
public static final java.lang.String KEY_TRACE
public static final java.lang.String KEY_DEBUG
public static final java.lang.String KEY_PORT
public static final java.lang.String KEY_PROJ
public static final java.lang.String KEY_USER
public static final java.lang.String KEY_COMPRESS
public static final java.lang.String KEY_VERSION
public static final int COMPRESS
public static final int NO_COMPRESS
public static final int GZIP
public static final int TRACE_ON
public static final int TRACE_OFF
public AddeURL()
public AddeURL(java.lang.String host,
java.lang.String requestType)
host - host to send torequestType - type of request (REQ_*)public AddeURL(java.lang.String host,
java.lang.String requestType,
java.lang.String extraKeys)
host - host to send torequestType - type of request (REQ_*)extraKeys - extra key/value argumentspublic java.lang.String getURLString()
protected java.lang.String makeQuery()
protected void parseQuery(java.lang.String query)
query - query stringpublic java.lang.String getValue(java.lang.String query,
java.lang.String key)
query - the query stringkey - the key to searchprotected void appendKeyValue(java.lang.StringBuffer buf,
java.lang.String name,
java.lang.String value)
buf - The buffer to append toname - The property namevalue - The valuepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - Object in questionpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String getHost()
public void setHost(java.lang.String host)
host - the hostpublic java.lang.String getRequestType()
public void setRequestType(java.lang.String requestType)
requestType - the request Typepublic java.lang.String getExtraKeys()
public void setExtraKeys(java.lang.String extraKeys)
extraKeys - the extraKeyspublic java.lang.String getUser()
public void setUser(java.lang.String user)
user - the userpublic int getProject()
public void setProject(int project)
project - the projectpublic java.lang.String getVersion()
public void setVersion(java.lang.String version)
version - the versionpublic boolean getDebug()
public void setDebug(boolean debug)
debug - the debug value (true or false);public int getPort()
public void setPort(int port)
port - the portpublic int getCompression()
public void setCompression(int compress)
compress - the compression type (GZIP, NO_COMPRESS, COMPRESS)public int getTrace()
public void setTrace(int trace)
trace - the trace value (TRACE_ON, TRACE_OFF)public void setCompressionFromString(java.lang.String type)
type - the string typepublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
This implementation never throws CloneNotSupportException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException - if cloning isn't supported.