OPeNDAP Hyrax Back End Server (BES) Updated for version 3.8.3
|
StandAloneClient is an object that handles the connection to, sending requests to, and receiving response from a specified OpenDAP server running either on this machine or another machine. More...
#include <StandAloneClient.h>
Public Member Functions | |
virtual void | dump (ostream &strm) const |
dumps information about this object | |
void | executeClientCommand (const string &cmd) |
Executes a client side command. | |
void | executeCommands (const string &cmd_list, int repeat) |
Send the command(s) specified to the BES server after wrapping in request document. | |
void | executeCommands (ifstream &inputFile, int repeat) |
Sends the xml request document from the specified file to the server. | |
void | interact () |
An interactive BES client that takes BES requests on the command line. | |
void | setOutput (ostream *strm, bool created) |
Set the output stream for responses from the BES server. | |
StandAloneClient () | |
~StandAloneClient () |
StandAloneClient is an object that handles the connection to, sending requests to, and receiving response from a specified OpenDAP server running either on this machine or another machine.
Requests to the OpenDAP server can be taken in different ways by the StandAloneClient object.
Response from the requests can sent to any File or OutputStream as specified by using the setOutput methods. If no output is specified using the setOutput methods thent he output is ignored.
Thread safety of this object has not yet been determined.
Definition at line 73 of file StandAloneClient.h.
StandAloneClient::StandAloneClient | ( | ) | [inline] |
Definition at line 85 of file StandAloneClient.h.
StandAloneClient::~StandAloneClient | ( | ) |
Definition at line 87 of file StandAloneClient.cc.
void StandAloneClient::dump | ( | ostream & | strm | ) | const [virtual] |
dumps information about this object
Displays the pointer value of this instance
strm | C++ i/o stream to dump the information to |
Implements BESObj.
Definition at line 522 of file StandAloneClient.cc.
References BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().
void StandAloneClient::executeClientCommand | ( | const string & | cmd | ) |
Executes a client side command.
Client side commands include client suppress; client output to screen; client output to <filename>; client load <filename>;
cmd | The BES client side command to execute |
Definition at line 139 of file StandAloneClient.cc.
References executeCommands(), and setOutput().
void StandAloneClient::executeCommands | ( | ifstream & | istrm, |
int | repeat | ||
) |
Sends the xml request document from the specified file to the server.
The requests do not have to be one per line but can span multiple lines and there can be more than one command per line.
The response is written to the output stream if one is specified, otherwise the output is ignored.
istrm | The file holding the xml request document |
repeat | Number of times to repeat the series of commands from the file. |
BESError | Thrown if there is a problem opening the file to read, reading the request document from the file, sending the request document to the server or a problem receiving any of the responses from the server. |
Definition at line 354 of file StandAloneClient.cc.
void StandAloneClient::executeCommands | ( | const string & | cmd_list, |
int | repeat | ||
) |
Send the command(s) specified to the BES server after wrapping in request document.
This takes a command or set of commands from the command line, wraps it in the proper request document, and sends it to the server.
The response is written to the output stream if one is specified, otherwise the output is ignored.
cmd_list | The BES commands to send to the BES server |
repeat | Number of times to repeat the command |
BESError | Thrown if there is a problem sending any of the request to the server or a problem receiving any of the responses from the server. |
Definition at line 311 of file StandAloneClient.cc.
References CmdTranslation::set_show(), and CmdTranslation::translate().
Referenced by executeClientCommand(), and StandAloneApp::run().
void StandAloneClient::interact | ( | ) |
An interactive BES client that takes BES requests on the command line.
There can be more than one command per line, but commands cannot span multiple lines. The user will be prompted to enter a new BES request.
OpenDAPClient:
The response is written to the output stream if one is specified, otherwise the output is ignored.
BESError | 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. |
Definition at line 390 of file StandAloneClient.cc.
References CmdTranslation::set_show(), and CmdTranslation::translate().
Referenced by StandAloneApp::run().
void StandAloneClient::setOutput | ( | ostream * | strm, |
bool | created | ||
) |
Set the output stream for responses from the BES server.
Specify where the response output from your BES request will be sent. Set to null if you wish to ignore the response from the BES server.
strm | an OutputStream specifying where to send responses from the BES server. If null then the output will not be output but will be thrown away. |
created | true of the passed stream was created and can be deleted either by being replaced ro in the destructor |
BESError | catches any problems with opening or writing to the output stream and creates a BESError |
Definition at line 115 of file StandAloneClient.cc.
Referenced by executeClientCommand(), and StandAloneApp::run().