dtservice
Class DataTranslationImpl

java.lang.Object
  extended by dtservice.DataTranslationImpl
All Implemented Interfaces:
DataTranslationIF, java.rmi.Remote

public class DataTranslationImpl
extends java.lang.Object
implements DataTranslationIF


Constructor Summary
DataTranslationImpl()
           
 
Method Summary
 java.lang.String isDeployed()
          Perform a check to see if the Data Translation Web Service is deployed.
 java.lang.String translateFile(javax.activation.DataHandler dh, java.lang.String filename, java.lang.String translationMode, java.lang.String emailTo)
          Translates a single file (local or remote) using the default mapping file (if applicable).
 java.lang.String[] translateFiles(javax.activation.DataHandler[] dh, java.lang.String[] filenames, java.lang.String[] translationModes, java.lang.String emailTo)
          Translates one or more local and/or remote files using the default mapping files (if applicable).
 java.lang.String[] translateFileswithMappings(javax.activation.DataHandler[] dh, java.lang.String[] filenames, java.lang.String[] translationModes, javax.activation.DataHandler[] mappingFileDHs, java.lang.String[] mappingFilenames, java.lang.String[] mappingFileModes, java.lang.String emailTo)
          Translates one or more local and/or remote files using the user-specified mapping files.
 java.lang.String translateFilewithMapping(javax.activation.DataHandler dh, java.lang.String filename, java.lang.String translationMode, javax.activation.DataHandler mappingFileDH, java.lang.String mappingFilename, java.lang.String mappingFileMode, java.lang.String emailTo)
          Translates a single file (local or remote) using the user-specified mapping file.
 java.lang.String translateRemoteFile(java.lang.String filename, java.lang.String translationMode, java.lang.String emailTo)
          Translates a file that resides on a remote machine using the default mapping file (if applicable).
 java.lang.String[] translateRemoteFiles(java.lang.String[] filenames, java.lang.String[] translationModes, java.lang.String emailTo)
          Translates one or more remote files using the default mapping file (if applicable).
 java.lang.String[] translateRemoteFileswithMappings(java.lang.String[] filenames, java.lang.String[] translationModes, java.lang.String[] mappingFilenames, java.lang.String[] mappingFileModes, java.lang.String emailTo)
          Translates one or more remote files using the user-specified mapping files that reside on remote machine(s).
 java.lang.String translateRemoteFilewithMapping(java.lang.String filename, java.lang.String translationMode, java.lang.String mappingFilename, java.lang.String emailTo)
          Translates a remote file using the user-specified mapping file that resides on a remote machine.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTranslationImpl

public DataTranslationImpl()
Method Detail

translateRemoteFile

public java.lang.String translateRemoteFile(java.lang.String filename,
                                            java.lang.String translationMode,
                                            java.lang.String emailTo)
Description copied from interface: DataTranslationIF
Translates a file that resides on a remote machine using the default mapping file (if applicable).

Specified by:
translateRemoteFile in interface DataTranslationIF
Parameters:
filename - the name of the remote file to be translated (e.g ftp://nssdc.gsfc.nasa.gov/mydata.cdf)

translationMode - the data translation mode that should be one of the following:

  • CDF-FITS
  • CDF-NETCDF
  • CDF-CDFML
  • CDF-TEXT
  • CDF-SKT
  • CDFML-CDF
  • FITS-CDF (Generic Mapping)
  • FITS-CDF (ISTP Mapping)
  • FITS-CDF (SOHO General Mapping)
  • FITS-CDF (SOHO EIT Mapping)
  • FITS-CDF (SOHO LASCO Mapping)
  • FITS-TEXT
  • FITS-ARRAY
  • NETCDF-CDF
  • NETCDF-TEXT
  • HDF4-CDF
  • HDF5-CDF
  • HDF5-TEXT

where CDFML is a CDF Markup Language that is a XML representation of CDF. The FITS-ARRAY translation mode dumps the contents of a FITS image to a file.

emailTo - the email address to be notified upon completion of the data translation. The eamil will contain the name of the translated file(s) along with URLs. This parameter is optional. If you don't want to be notified, set the value of this parameter to "null" or an empty string "".

Returns:
The URL of the translated output file. If an error occurred during data translation, an error message is returned that starts with "** Error".


translateRemoteFilewithMapping

public java.lang.String translateRemoteFilewithMapping(java.lang.String filename,
                                                       java.lang.String translationMode,
                                                       java.lang.String mappingFilename,
                                                       java.lang.String emailTo)
Description copied from interface: DataTranslationIF
Translates a remote file using the user-specified mapping file that resides on a remote machine.

Specified by:
translateRemoteFilewithMapping in interface DataTranslationIF
Parameters:
filename - the name of the remote file to be translated (e.g ftp://nssdc.gsfc.nasa.gov/mydata.cdf)

translationMode - the data translation mode that should be one of the following:

  • CDF-FITS
  • CDF-NETCDF
  • CDF-CDFML
  • CDF-TEXT
  • CDF-SKT
  • CDFML-CDF
  • FITS-CDF (Generic Mapping)
  • FITS-CDF (ISTP Mapping)
  • FITS-CDF (SOHO General Mapping)
  • FITS-CDF (SOHO EIT Mapping)
  • FITS-CDF (SOHO LASCO Mapping)
  • FITS-TEXT
  • FITS-ARRAY
  • NETCDF-CDF
  • NETCDF-TEXT
  • HDF4-CDF
  • HDF5-CDF
  • HDF5-TEXT

where CDFML is a CDF Markup Language that is a XML representation of CDF. The FITS-ARRAY translation mode dumps the contents of a FITS image to a file.

mappingFilename - the name of the remote mapping file name

emailTo - the email address to be notified upon completion of the data translation. The eamil will contain the name of the translated file(s) along with URLs. This parameter is optional. If you don't want to be notified, set the value of this parameter to "null" or an empty string "".

Returns:
The URL of the translated output file. If an error occurred during data translation, an error message is returned that starts with "** Error".


translateFile

public java.lang.String translateFile(javax.activation.DataHandler dh,
                                      java.lang.String filename,
                                      java.lang.String translationMode,
                                      java.lang.String emailTo)
Description copied from interface: DataTranslationIF
Translates a single file (local or remote) using the default mapping file (if applicable). Since the input file must be encapsulated in the Java DataHandler object, this method/service is only available to Java. For a non-Java client, please use the translateRemoteFile method.

Specified by:
translateFile in interface DataTranslationIF
Parameters:
dh - the DataHandler object that contains the input file

  • local file - use the 'file::' protocol (e.g. file:///Users/cdf/example.cdf)
  • remote file - use the 'ftp' or 'http' protocol (e.g. ftp://nssdc.gsfc.nasa.gov/example.cdf)

filename - the name of the file to be translated

translationMode - the data translation mode that should be one of the following:

  • CDF-FITS
  • CDF-NETCDF
  • CDF-CDFML
  • CDF-TEXT
  • CDF-SKT
  • CDFML-CDF
  • FITS-CDF (Generic Mapping)
  • FITS-CDF (ISTP Mapping)
  • FITS-CDF (SOHO General Mapping)
  • FITS-CDF (SOHO EIT Mapping)
  • FITS-CDF (SOHO LASCO Mapping)
  • FITS-TEXT
  • FITS-ARRAY
  • NETCDF-CDF
  • NETCDF-TEXT
  • HDF4-CDF
  • HDF5-CDF
  • HDF5-TEXT

where CDFML is a CDF Markup Language that is a XML representation of CDF. The FITS-ARRAY translation mode dumps the contents of a FITS image to a file.

emailTo - the email address to be notified upon completion of the data translation. The eamil will contain the name of the translated file(s) along with URLs. This parameter is optional. If you don't want to be notified, set the value of this parameter to "null" or an empty string "".

Returns:
The URL of the translated output file. If an error occurred during data translation, an error message is returned that starts with "** Error".


translateFilewithMapping

public java.lang.String translateFilewithMapping(javax.activation.DataHandler dh,
                                                 java.lang.String filename,
                                                 java.lang.String translationMode,
                                                 javax.activation.DataHandler mappingFileDH,
                                                 java.lang.String mappingFilename,
                                                 java.lang.String mappingFileMode,
                                                 java.lang.String emailTo)
Description copied from interface: DataTranslationIF
Translates a single file (local or remote) using the user-specified mapping file. Since both the input file and mapping file must be encapsulated in the Java DataHandler objects, this method/service is only * available to Java. For a non-Java client, please use the translateRemoteFilewithMapping method.

Specified by:
translateFilewithMapping in interface DataTranslationIF
Parameters:
dh - the DataHandler object that contains the input file

  • local file - use the 'file::' protocol (e.g. file:///Users/cdf/example.cdf)
  • remote file - use the 'ftp' or 'http' protocol (e.g. ftp://nssdc.gsfc.nasa.gov/example.cdf)

filename - the name of the file to be translated

translationMode - the data translation mode that should be one of the following:

  • CDF-FITS
  • CDF-NETCDF
  • CDF-CDFML
  • CDF-TEXT
  • CDF-SKT
  • CDFML-CDF
  • FITS-CDF (Generic Mapping)
  • FITS-CDF (ISTP Mapping)
  • FITS-CDF (SOHO General Mapping)
  • FITS-CDF (SOHO EIT Mapping)
  • FITS-CDF (SOHO LASCO Mapping)
  • FITS-TEXT
  • FITS-ARRAY
  • NETCDF-CDF
  • NETCDF-TEXT
  • HDF4-CDF
  • HDF5-CDF
  • HDF5-TEXT

where CDFML is a CDF Markup Language that is a XML representation of CDF. The FITS-ARRAY translation mode dumps the contents of a FITS image to a file.

mappingFileDH - the DataHandler object that contains the user specified mapping file

mappingFilename - the mapping file name

mappingFileMode - the mapping file mode to be applied to the input file (fileName) that should be one of the following:

  • CDF-FITS
  • CDF-NETCDF
  • FITS-CDF (Generic Mapping)
  • FITS-CDF (ISTP Mapping)
  • FITS-CDF (SOHO General Mapping)
  • FITS-CDF (SOHO EIT Mapping)
  • FITS-CDF (SOHO LASCO Mapping)
  • NETCDF-CDF
  • HDF4-CDF

If the value of this parameter is not the same as translationMode, the user-specified mapping file is ignored and the default mapping is used.

emailTo - the email address to be notified upon completion of the data translation. The eamil will contain the name of the translated file(s) along with URLs. This parameter is optional. If you don't want to be notified, set the value of this parameter to "null" or an empty string "".

Returns:
The URL of the translated output file. If an error occurred during data translation, an error message is returned that starts with "** Error".


translateRemoteFiles

public java.lang.String[] translateRemoteFiles(java.lang.String[] filenames,
                                               java.lang.String[] translationModes,
                                               java.lang.String emailTo)
Description copied from interface: DataTranslationIF
Translates one or more remote files using the default mapping file (if applicable).

Specified by:
translateRemoteFiles in interface DataTranslationIF
Parameters:
filenames - a string array that contains the full pathname of the input files (e.g. ftp://nssdc.gsfc.nasa.gov/mydata.cdf) to be translated

translationModes - an array of the data translation mode. The following are the valid translation modes:

  • CDF-FITS
  • CDF-NETCDF
  • CDF-CDFML
  • CDF-TEXT
  • CDF-SKT
  • CDFML-CDF
  • FITS-CDF (Generic Mapping)
  • FITS-CDF (ISTP Mapping)
  • FITS-CDF (SOHO General Mapping)
  • FITS-CDF (SOHO EIT Mapping)
  • FITS-CDF (SOHO LASCO Mapping)
  • FITS-TEXT
  • FITS-ARRAY
  • NETCDF-CDF
  • NETCDF-TEXT
  • HDF4-CDF
  • HDF5-CDF
  • HDF5-TEXT

where CDFML is a CDF Markup Language that is a XML representation of CDF. The FITS-ARRAY translation mode dumps the contents of a FITS image to a file.

emailTo - the email address to be notified upon completion of the data translation. The eamil will contain the name of the translated file(s) along with URLs. This parameter is optional. If you don't want to be notified, set the value of this parameter to "null" or an empty string "".

Returns:
The URL of the translated output file. If an error occurred during data translation, an error message is returned that starts with "** Error".


translateRemoteFileswithMappings

public java.lang.String[] translateRemoteFileswithMappings(java.lang.String[] filenames,
                                                           java.lang.String[] translationModes,
                                                           java.lang.String[] mappingFilenames,
                                                           java.lang.String[] mappingFileModes,
                                                           java.lang.String emailTo)
Description copied from interface: DataTranslationIF
Translates one or more remote files using the user-specified mapping files that reside on remote machine(s).

Specified by:
translateRemoteFileswithMappings in interface DataTranslationIF
Parameters:
filenames - a string array that contains the full pathname of the input files (e.g. ftp://nssdc.gsfc.nasa.gov/mydata.cdf) to be translated

translationModes - an array of the data translation mode. The following are the valid translation modes:

  • CDF-FITS
  • CDF-NETCDF
  • CDF-CDFML
  • CDF-TEXT
  • CDF-SKT
  • CDFML-CDF
  • FITS-CDF (Generic Mapping)
  • FITS-CDF (ISTP Mapping)
  • FITS-CDF (SOHO General Mapping)
  • FITS-CDF (SOHO EIT Mapping)
  • FITS-CDF (SOHO LASCO Mapping)
  • FITS-TEXT
  • FITS-ARRAY
  • NETCDF-CDF
  • NETCDF-TEXT
  • HDF4-CDF
  • HDF5-CDF
  • HDF5-TEXT

where CDFML is a CDF Markup Language that is a XML representation of CDF. The FITS-ARRAY translation mode dumps the contents of a FITS image to a file.

mappingFilenames - the name of the remote mapping files

mappingFileModes - an array of the mapping file modes to be applied to 'fileNames'. The following are the valid mapping file modes:

  • CDF-FITS
  • CDF-NETCDF
  • FITS-CDF (Generic Mapping)
  • FITS-CDF (ISTP Mapping)
  • FITS-CDF (SOHO General Mapping)
  • FITS-CDF (SOHO EIT Mapping)
  • FITS-CDF (SOHO LASCO Mapping)
  • NETCDF-CDF
  • HDF4-CDF

The number of mapping file modes should match the number of mapping files provided in mappingFileNames, but it doesn't have to match the number of input files (specified in fileNames) as one or more files can share the same mapping file.

emailTo - the email address to be notified upon completion of the data translation. The eamil will contain the name of the translated file(s) along with URLs. This parameter is optional. If you don't want to be notified, set the value of this parameter to "null" or an empty string "".

Returns:
The URL of the translated output files. If an error occurred during data translation, an error message is returned that starts with "** Error".


translateFiles

public java.lang.String[] translateFiles(javax.activation.DataHandler[] dh,
                                         java.lang.String[] filenames,
                                         java.lang.String[] translationModes,
                                         java.lang.String emailTo)
Description copied from interface: DataTranslationIF
Translates one or more local and/or remote files using the default mapping files (if applicable). Since the input files must be encapsulated in the Java DataHandler objects, this method/service is only available to Java. For a non-Java client, please use the translateRemoteFiles method.

Specified by:
translateFiles in interface DataTranslationIF
Parameters:
dh - an array of the DataHandler object that contains the input files

  • local file - use the 'file::' protocol (e.g. file:///Users/cdf/example.cdf)
  • remote file - use the 'ftp' or 'http' protocol (e.g. ftp://nssdc.gsfc.nasa.gov/example.cdf)

filenames - a string array that contains the name of the input files

  • local file - use the 'file::' protocol (e.g. file:///Users/cdf/example.cdf)
  • remote file - use the 'ftp' or 'http' protocol (e.g. ftp://nssdc.gsfc.nasa.gov/example.cdf)

translationModes - an array of the data translation mode. The value of each element should be one of the following:

  • CDF-FITS
  • CDF-NETCDF
  • CDF-CDFML
  • CDF-TEXT
  • CDF-SKT
  • CDFML-CDF
  • FITS-CDF (Generic Mapping)
  • FITS-CDF (ISTP Mapping)
  • FITS-CDF (SOHO General Mapping)
  • FITS-CDF (SOHO EIT Mapping)
  • FITS-CDF (SOHO LASCO Mapping)
  • FITS-TEXT
  • FITS-ARRAY
  • NETCDF-CDF
  • NETCDF-TEXT
  • HDF4-CDF
  • HDF5-CDF
  • HDF5-TEXT

where CDFML is a CDF Markup Language that is a XML representation of CDF. The FITS-ARRAY translation mode dumps the contents of a FITS image to a file.

emailTo - the email address to be notified upon completion of the data translation. The eamil will contain the name of the translated file(s) along with URLs. This parameter is optional. If you don't want to be notified, set the value of this parameter to "null" or an empty string "".

Returns:
The URL of the translated output file. If an error occurred during data translation, an error message is returned that starts with "** Error".


translateFileswithMappings

public java.lang.String[] translateFileswithMappings(javax.activation.DataHandler[] dh,
                                                     java.lang.String[] filenames,
                                                     java.lang.String[] translationModes,
                                                     javax.activation.DataHandler[] mappingFileDHs,
                                                     java.lang.String[] mappingFilenames,
                                                     java.lang.String[] mappingFileModes,
                                                     java.lang.String emailTo)
Description copied from interface: DataTranslationIF
Translates one or more local and/or remote files using the user-specified mapping files. Since both the input files and mapping files must be encapsulated in the Java DataHandler objects, this method/service is only available to Java. For a non-Java client, please use the translateRemoteFileswithMappings method.

Specified by:
translateFileswithMappings in interface DataTranslationIF
Parameters:
dh - an array of the DataHandler object that contains the input files

  • local file - use the 'file::' protocol (e.g. file:///Users/cdf/example.cdf)
  • remote file - use the 'ftp' or 'http' protocol (e.g. ftp://nssdc.gsfc.nasa.gov/example.cdf)

filenames - a string array that contains the name of the input files

translationModes - an array of the data translation mode. The value of each element should be one of the following:

  • CDF-FITS
  • CDF-NETCDF
  • CDF-CDFML
  • CDF-TEXT
  • CDF-SKT
  • CDFML-CDF
  • FITS-CDF (Generic Mapping)
  • FITS-CDF (ISTP Mapping)
  • FITS-CDF (SOHO General Mapping)
  • FITS-CDF (SOHO EIT Mapping)
  • FITS-CDF (SOHO LASCO Mapping)
  • FITS-TEXT
  • FITS-ARRAY
  • NETCDF-CDF
  • NETCDF-TEXT
  • HDF4-CDF
  • HDF5-CDF
  • HDF5-TEXT

where CDFML is a CDF Markup Language that is a XML representation of CDF. The FITS-ARRAY translation mode dumps the contents of a FITS image to a file.

mappingFileDHs - an array of the DataHandler object that contains the user specified mapping files

mappingFilenames - an array of the the mapping file names

mappingFileModes - an array of the mapping file modes to be applied to 'fileNames'. The mapping file mode should be one of the following:

  • CDF-FITS
  • CDF-NETCDF
  • FITS-CDF (Generic Mapping)
  • FITS-CDF (ISTP Mapping)
  • FITS-CDF (SOHO General Mapping)
  • FITS-CDF (SOHO EIT Mapping)
  • FITS-CDF (SOHO LASCO Mapping)
  • NETCDF-CDF
  • HDF4-CDF

The number of mapping file modes should match the number of mapping files provided in mappingFileNames, but it doesn't have to match the number of input files (specified in fileNames) as one or more files can share the same mapping file.

emailTo - the email address to be notified upon completion of the data translation. The eamil will contain the name of the translated file(s) along with URLs. This parameter is optional. If you don't want to be notified, set the value of this parameter to "null" or an empty string "".

Returns:
The URL of the translated output files. If an error occurred during data translation, an error message is returned that starts with "** Error".


isDeployed

public java.lang.String isDeployed()
Description copied from interface: DataTranslationIF
Perform a check to see if the Data Translation Web Service is deployed.

Specified by:
isDeployed in interface DataTranslationIF
Returns:
A string of "yes" is returned if the services are deployed. Otherwise, nothing is expected from the call.