public class OPeNDAPClient
extends java.lang.Object
Constructor and Description |
---|
OPeNDAPClient()
Creates a OpenDAPClient to handle OpenDAP requests.
|
Modifier and Type | Method and Description |
---|---|
boolean |
executeCommand(java.lang.String cmd,
java.io.OutputStream target,
java.io.OutputStream error)
Sends a single OpeNDAP request ending in a semicolon (;) to the
OpeNDAP server.
|
boolean |
executeCommands(java.io.File inputFile,
java.io.OutputStream target,
java.io.OutputStream error)
Sends the requests listed in the specified file to the OpenDAP server,
each command ending with a semicolon.
|
boolean |
executeCommands(java.lang.String cmd_list,
java.io.OutputStream target,
java.io.OutputStream error)
Execute each of the commands in the cmd_list, separated by a * semicolon.
|
int |
getChunkedReadBufferSize() |
int |
getCommandCount() |
java.lang.String |
getID() |
void |
interact(java.io.OutputStream out,
java.io.OutputStream err)
An interactive OpenDAP client that takes OpenDAP requests on the command
line.
|
boolean |
isClosed() |
boolean |
isConnected() |
boolean |
isRunning() |
void |
killClient() |
static void |
main(java.lang.String[] args) |
boolean |
sendRequest(org.jdom.Document request,
java.io.OutputStream target,
java.io.OutputStream error)
Sends a single XML request document.
|
void |
setID(java.lang.String ID) |
java.lang.String |
showConnectionProperties() |
void |
shutdownClient()
Closes the connection to the Back End Server and closes the output stream.
|
void |
shutdownClient(boolean beNice)
Closes the connection to the Back End Server and closes the output stream.
|
void |
startClient(java.lang.String hostStr,
int portVal,
int timeOut)
Connect the OpenDAP client to the OpenDAP server.
|
public OPeNDAPClient()
public java.lang.String getID()
public void setID(java.lang.String ID)
public int getCommandCount()
public boolean isRunning()
public boolean isClosed()
public boolean isConnected()
public java.lang.String showConnectionProperties()
public void startClient(java.lang.String hostStr, int portVal, int timeOut) throws PPTException
hostStr
- The name of the host machine where the server is
running.portVal
- The port on which the server on the host hostStr is
listening for requests.timeOut
- The number of milliseconds for the client to wait for the BES
to reply before timing out.PPTException
- Thrown if unable to connect to the specified host
machine given the specified port.String
,
PPTException
public void shutdownClient() throws PPTException
PPTException
- Thrown if unable to close the connection or close
the output stream.
machine given the specified port.OutputStream
,
PPTException
public void shutdownClient(boolean beNice) throws PPTException
PPTException
- Thrown if unable to close the connection or close
the output stream.
machine given the specified port.OutputStream
,
PPTException
public int getChunkedReadBufferSize()
public void killClient()
public boolean executeCommand(java.lang.String cmd, java.io.OutputStream target, java.io.OutputStream error) throws PPTException
cmd
- The OpenDAP request, ending in a semicolon, that is sent to
the OpenDAP server to handle.target
- The target OutputStream for the results of the command.error
- The error OutputStream for errors returned by the server.PPTException
- Thrown if there is a problem sending the request
to the server or a problem receiving the response
from the server.String
,
PPTException
public boolean sendRequest(org.jdom.Document request, java.io.OutputStream target, java.io.OutputStream error) throws PPTException
request
- The XML request that is sent to
the BES to handle.target
- The target OutputStream for the results of the command.error
- The error OutputStream for errors returned by the server.PPTException
- Thrown if there is a problem sending the request
to the server or a problem receiving the response
from the server.String
,
PPTException
public boolean executeCommands(java.lang.String cmd_list, java.io.OutputStream target, java.io.OutputStream error) throws PPTException
cmd_list
- The list of OpenDAP requests, separated by semicolons
and ending in a semicolon, that will be sent to the
OpenDAP server to handle, one at a time.target
- The target OutputStream for the results of the command.error
- The error OutputStream for errors returned by the server.PPTException
- Thrown if there is a problem sending any of the
request to the server or a problem receiving any
of the response
s from the server.String
,
PPTException
public boolean executeCommands(java.io.File inputFile, java.io.OutputStream target, java.io.OutputStream error) throws PPTException
inputFile
- The file holding the list of OpenDAP requests, each
ending with a semicolon, that will be sent to the
OpenDAP server to handle.target
- The target OutputStream for the results of the command.error
- The error OutputStream for errors returned by the server.PPTException
- Thrown if there is a problem opening the file to
read, reading the requests from the file, sending
any of the requests to the server or a problem
receiving any of the responses from the server.File
,
PPTException
public void interact(java.io.OutputStream out, java.io.OutputStream err) throws PPTException
out
- The target OutputStream for the results of the command.err
- The error OutputStream for errors returned by the server.PPTException
- Thrown if there is a problem sending any of the
requests to the server or a problem receiving any
of the responses from the server.PPTException
public static void main(java.lang.String[] args)
args
- Command line arguments as defined by createCmdLineOptions()