edu.wisc.ssec.mcidas.adde
Class AddeURL
- java.lang.Object
-
- edu.wisc.ssec.mcidas.adde.AddeURL
-
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- AddeDatasetURL
public class AddeURL extends java.lang.Object implements java.lang.CloneableA class for holding information about an ADDE URL.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)
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringADDE_PROTOCOLThe protocolstatic java.lang.StringALLValue for ALLstatic intCOMPRESSFlag for "compress" compression.static java.lang.StringDEFAULT_VALUEDefault value for key/value pairs (X)static intGZIPFlag for GZip compression.static java.lang.StringKEY_COMPRESSKeyword for compressstatic java.lang.StringKEY_DEBUGKeyword for debugstatic java.lang.StringKEY_PORTKeyword for portstatic java.lang.StringKEY_PROJKeyword for projectstatic java.lang.StringKEY_TRACEKeyword for tracestatic java.lang.StringKEY_USERKeyword for userstatic java.lang.StringKEY_VERSIONKeyword for versionstatic java.lang.StringNOValue for nostatic intNO_COMPRESSFlag for "no compress" compression.static java.lang.StringREQ_ADIRADIR request typestatic java.lang.StringREQ_AGETAGET request typestatic java.lang.StringREQ_DATASETINFOData set info request typestatic java.lang.StringREQ_GDIRGDIR request typestatic java.lang.StringREQ_GGETGGET request typestatic java.lang.StringREQ_GRIDDATAGrid data request typestatic java.lang.StringREQ_GRIDDIRGrid directory request typestatic java.lang.StringREQ_IMAGEDATAImage data request typestatic java.lang.StringREQ_IMAGEDIRImage directory request typestatic java.lang.StringREQ_LWPRLWPR request typestatic java.lang.StringREQ_MDKSMDKS request typestatic java.lang.StringREQ_OBTEXTobs text request typestatic java.lang.StringREQ_OBTGOBTG request typestatic java.lang.StringREQ_POINTDATAPoint data request typestatic java.lang.StringREQ_TEXTText request typestatic java.lang.StringREQ_TXTGTXTG request typestatic java.lang.StringREQ_WTXGWTXG request typestatic java.lang.StringREQ_WXTEXTweather text request typestatic intTRACE_OFFflag for trace offstatic intTRACE_ONflag for trace onstatic java.lang.StringYESValue for yes
-
Constructor Summary
Constructors Constructor and Description AddeURL()Create an ADDE URLAddeURL(java.lang.String host, java.lang.String requestType)Create an ADDE URL from the given specAddeURL(java.lang.String host, java.lang.String requestType, java.lang.String extraKeys)Create an ADDE URL from the given spec
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectclone()Clones this instance.booleanequals(java.lang.Object o)Compare two AddeURLsintgetCompression()Get the compression type for this ADDE URLbooleangetDebug()Get the debug value for this ADDE URLjava.lang.StringgetExtraKeys()Get the extraKeys string for this ADDE URLjava.lang.StringgetHost()Get the host for this ADDE URLintgetPort()Get the port for this ADDE URLintgetProject()Get the project for this ADDE URLjava.lang.StringgetRequestType()Get the request type for this ADDE URLintgetTrace()Get the trace value used for this ADDE URLjava.lang.StringgetURLString()Create the ADDE URL as a Stringjava.lang.StringgetUser()Get the project for this ADDE URLjava.lang.StringgetValue(java.lang.String query, java.lang.String key)Get the value for a particular key.java.lang.StringgetVersion()Get the version for this ADDE URLinthashCode()Get the hashcode for thisvoidsetCompression(int compress)Set the compression type used for this ADDE URLvoidsetCompressionFromString(java.lang.String type)Set the compression type from a stringvoidsetDebug(boolean debug)Set the debug value this ADDE URLvoidsetExtraKeys(java.lang.String extraKeys)Set the extraKeys string for this ADDE URLvoidsetHost(java.lang.String host)Set the host for this ADDE URLvoidsetPort(int port)Set the port used for this ADDE URLvoidsetProject(int project)Set the project for this ADDE URLvoidsetRequestType(java.lang.String requestType)Set the request type for this ADDE URLvoidsetTrace(int trace)Set the trace value used for this ADDE URLvoidsetUser(java.lang.String user)Set the user for this ADDE URLvoidsetVersion(java.lang.String version)Set the version this ADDE URL
-
-
-
Field Detail
-
ADDE_PROTOCOL
public static final java.lang.String ADDE_PROTOCOL
The protocol- See Also:
- Constant Field Values
-
REQ_AGET
public static final java.lang.String REQ_AGET
AGET request type- See Also:
- Constant Field Values
-
REQ_ADIR
public static final java.lang.String REQ_ADIR
ADIR request type- See Also:
- Constant Field Values
-
REQ_LWPR
public static final java.lang.String REQ_LWPR
LWPR request type- See Also:
- Constant Field Values
-
REQ_GDIR
public static final java.lang.String REQ_GDIR
GDIR request type- See Also:
- Constant Field Values
-
REQ_GGET
public static final java.lang.String REQ_GGET
GGET request type- See Also:
- Constant Field Values
-
REQ_MDKS
public static final java.lang.String REQ_MDKS
MDKS request type- See Also:
- Constant Field Values
-
REQ_TXTG
public static final java.lang.String REQ_TXTG
TXTG request type- See Also:
- Constant Field Values
-
REQ_WTXG
public static final java.lang.String REQ_WTXG
WTXG request type- See Also:
- Constant Field Values
-
REQ_OBTG
public static final java.lang.String REQ_OBTG
OBTG request type- See Also:
- Constant Field Values
-
REQ_IMAGEDATA
public static final java.lang.String REQ_IMAGEDATA
Image data request type- See Also:
- Constant Field Values
-
REQ_IMAGEDIR
public static final java.lang.String REQ_IMAGEDIR
Image directory request type- See Also:
- Constant Field Values
-
REQ_DATASETINFO
public static final java.lang.String REQ_DATASETINFO
Data set info request type- See Also:
- Constant Field Values
-
REQ_TEXT
public static final java.lang.String REQ_TEXT
Text request type- See Also:
- Constant Field Values
-
REQ_WXTEXT
public static final java.lang.String REQ_WXTEXT
weather text request type- See Also:
- Constant Field Values
-
REQ_OBTEXT
public static final java.lang.String REQ_OBTEXT
obs text request type- See Also:
- Constant Field Values
-
REQ_GRIDDATA
public static final java.lang.String REQ_GRIDDATA
Grid data request type- See Also:
- Constant Field Values
-
REQ_GRIDDIR
public static final java.lang.String REQ_GRIDDIR
Grid directory request type- See Also:
- Constant Field Values
-
REQ_POINTDATA
public static final java.lang.String REQ_POINTDATA
Point data request type- See Also:
- Constant Field Values
-
DEFAULT_VALUE
public static final java.lang.String DEFAULT_VALUE
Default value for key/value pairs (X)- See Also:
- Constant Field Values
-
YES
public static final java.lang.String YES
Value for yes- See Also:
- Constant Field Values
-
NO
public static final java.lang.String NO
Value for no- See Also:
- Constant Field Values
-
ALL
public static final java.lang.String ALL
Value for ALL- See Also:
- Constant Field Values
-
KEY_TRACE
public static final java.lang.String KEY_TRACE
Keyword for trace- See Also:
- Constant Field Values
-
KEY_DEBUG
public static final java.lang.String KEY_DEBUG
Keyword for debug- See Also:
- Constant Field Values
-
KEY_PORT
public static final java.lang.String KEY_PORT
Keyword for port- See Also:
- Constant Field Values
-
KEY_PROJ
public static final java.lang.String KEY_PROJ
Keyword for project- See Also:
- Constant Field Values
-
KEY_USER
public static final java.lang.String KEY_USER
Keyword for user- See Also:
- Constant Field Values
-
KEY_COMPRESS
public static final java.lang.String KEY_COMPRESS
Keyword for compress- See Also:
- Constant Field Values
-
KEY_VERSION
public static final java.lang.String KEY_VERSION
Keyword for version- See Also:
- Constant Field Values
-
COMPRESS
public static final int COMPRESS
Flag for "compress" compression.- See Also:
- Constant Field Values
-
NO_COMPRESS
public static final int NO_COMPRESS
Flag for "no compress" compression.- See Also:
- Constant Field Values
-
GZIP
public static final int GZIP
Flag for GZip compression.- See Also:
- Constant Field Values
-
TRACE_ON
public static final int TRACE_ON
flag for trace on- See Also:
- Constant Field Values
-
TRACE_OFF
public static final int TRACE_OFF
flag for trace off- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AddeURL
public AddeURL()
Create an ADDE URL
-
AddeURL
public AddeURL(java.lang.String host, java.lang.String requestType)Create an ADDE URL from the given spec- Parameters:
host- host to send torequestType- type of request (REQ_*)
-
AddeURL
public AddeURL(java.lang.String host, java.lang.String requestType, java.lang.String extraKeys)Create an ADDE URL from the given spec- Parameters:
host- host to send torequestType- type of request (REQ_*)extraKeys- extra key/value arguments
-
-
Method Detail
-
getURLString
public java.lang.String getURLString()
Create the ADDE URL as a String- Returns:
- an Adde URL
-
getValue
public java.lang.String getValue(java.lang.String query, java.lang.String key)Get the value for a particular key.- Parameters:
query- the query stringkey- the key to search- Returns:
- the value or null if it doesn't exist
-
equals
public boolean equals(java.lang.Object o)
Compare two AddeURLs- Overrides:
equalsin classjava.lang.Object- Parameters:
o- Object in question- Returns:
- true if they are the same object or if all
-
hashCode
public int hashCode()
Get the hashcode for this- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashcode
-
getHost
public java.lang.String getHost()
Get the host for this ADDE URL- Returns:
- the host
-
setHost
public void setHost(java.lang.String host)
Set the host for this ADDE URL- Parameters:
host- the host
-
getRequestType
public java.lang.String getRequestType()
Get the request type for this ADDE URL- Returns:
- the host
-
setRequestType
public void setRequestType(java.lang.String requestType)
Set the request type for this ADDE URL- Parameters:
requestType- the request Type
-
getExtraKeys
public java.lang.String getExtraKeys()
Get the extraKeys string for this ADDE URL- Returns:
- the extraKeys string
-
setExtraKeys
public void setExtraKeys(java.lang.String extraKeys)
Set the extraKeys string for this ADDE URL- Parameters:
extraKeys- the extraKeys
-
getUser
public java.lang.String getUser()
Get the project for this ADDE URL- Returns:
- the project
-
setUser
public void setUser(java.lang.String user)
Set the user for this ADDE URL- Parameters:
user- the user
-
getProject
public int getProject()
Get the project for this ADDE URL- Returns:
- the project
-
setProject
public void setProject(int project)
Set the project for this ADDE URL- Parameters:
project- the project
-
getVersion
public java.lang.String getVersion()
Get the version for this ADDE URL- Returns:
- the version
-
setVersion
public void setVersion(java.lang.String version)
Set the version this ADDE URL- Parameters:
version- the version
-
getDebug
public boolean getDebug()
Get the debug value for this ADDE URL- Returns:
- the debug value (true or false)
-
setDebug
public void setDebug(boolean debug)
Set the debug value this ADDE URL- Parameters:
debug- the debug value (true or false);
-
getPort
public int getPort()
Get the port for this ADDE URL- Returns:
- the port
-
setPort
public void setPort(int port)
Set the port used for this ADDE URL- Parameters:
port- the port
-
getCompression
public int getCompression()
Get the compression type for this ADDE URL- Returns:
- the compression type
-
setCompression
public void setCompression(int compress)
Set the compression type used for this ADDE URL- Parameters:
compress- the compression type (GZIP, NO_COMPRESS, COMPRESS)
-
getTrace
public int getTrace()
Get the trace value used for this ADDE URL- Returns:
- the trace value (TRACE_ON, TRACE_OFF)
-
setTrace
public void setTrace(int trace)
Set the trace value used for this ADDE URL- Parameters:
trace- the trace value (TRACE_ON, TRACE_OFF)
-
setCompressionFromString
public void setCompressionFromString(java.lang.String type)
Set the compression type from a string- Parameters:
type- the string type
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionClones this instance.This implementation never throws CloneNotSupportException
- Overrides:
clonein classjava.lang.Object- Returns:
- A clone of this instance.
- Throws:
java.lang.CloneNotSupportedException- if cloning isn't supported.
-
-
DMelt 3.0 © DataMelt by jWork.ORG