lrgs.ldds.CmdReturnConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opendcs Show documentation
Show all versions of opendcs Show documentation
A collection of software for aggregatting and processing environmental data such as from NOAA GOES satellites.
The newest version!
/*
* $Id$
*/
package lrgs.ldds;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import ilex.util.EnvExpander;
import ilex.util.Logger;
import ilex.util.TextUtil;
import lrgs.common.ArchiveException;
import lrgs.common.LrgsErrorCode;
import lrgs.lrgsmain.LrgsConfig;
import lrgs.networkdcp.NetworkDcpRecv;
/**
This command returns a configuration file back to the client.
The request message contains a 64-byte field denoting the configuration
file to be returned:
- lrgs - return main configuration file (usually lrgs.conf)
- ddsrecv - return DDS Recv Config file (usually ddsrecv.conf)
- drgs - return DRGS Recv Config file (usually drgsconf.xml)
- networkDcp - return Network DCP Config file (network-dcp.conf)
- netlist-list - return a list of files from the netlist dir
- netlist:name - return the named network list from the netlist dir
The file-names may vary from system to system because the main config file
can be specified on the command line argument, and the others can be
specified in the main config file.
The response message (sent back to the client) contains the same 64-byte
field followed by the variable length file contents.
If an error occurs, the 64-byte field will contain a question mark
followed by two comma-separated integer fields corresponding to
'derrno' and 'errno'.
*/
public class CmdReturnConfig extends CmdAdminCmd
{
private String cfgType;
/** @return "CmdReturnConfig"; */
public String cmdType()
{
return "CmdReturnConfig";
}
/**
Constructor.
@param ctb (config type bytes) which configuration file to return.
*/
public CmdReturnConfig(byte[] ctb)
{
int len = 0;
for(; len