dtservice
Interface DataTranslationIF

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
DataTranslationImpl

public interface DataTranslationIF
extends java.rmi.Remote

This interface defines the Data Translation Web Service (DTWS) APIs that can be called by Java or non-Java clients. The APIs are implemented using the Sun's Java Web Services Development Pack (JWSDP), and they use the RPC-encoded WSDL binding style. The Web Service Description Language (WSDL) for the DTWS services can be found at http://translators.gsfc.nasa.gov/dt/dtservice?WSDL.

If you would like to call any of the DTWS services in your application, you'll need a stub that acts as a proxy for the remote DTWS Web services. Many programming languages nowadays understand WSDL and can use this file to invoke the DTWS service. For example, the WSDL can be imported into Microsoft's .NET or it can be directly used by Perl SOAP::Lite. If you are developing a client in Java, there are many tools that can generate the client stub from a WSDL file. For example, the 'wscompile' tool included in the Sun's JWDSP can be used to generate the client stub you need. We have generated a static stub that you can use in your Java client application, and it is available at http://translators.gsfc.nasa.gov/pub/dtws/dtServiceStub.jar.

There also is a of sample Java program in this diectory (http://translators.gsfc.nasa.gov/pub/dtws) that shows how the DTWS services can be called for translating local and remote files.

The endpoint address for the DTWS services is http://translators.gsfc.nasa.gov/dt/dtservice, and a client must establish a connection before it can make a request for a particular service call. For example, the following code creates a stub and connect to the DTWS service that resides at http://translators.gsfc.nasa.gov/dt/dtservice.

      String dtServiceEndPoint = "http://translators.gsfc.nasa.gov/dt/dtservice";
      try { 
          javax.xml.rpc.Stub stub = (javax.xml.rpc.Stub)(new DataTranslationService_Impl().getDataTranslationIFPort()); 
      } catch (Exception ex) {
          ..... 
      } 
      stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY, 
                        dtServiceEndPoint);
      dt = (DataTranslationIF) stub; 
      String outputURL;
      outputURL = dt.translateRemoteFile(inputFileName, translationMode, "");
 

For user's convenience, the Space Physics Data Facility (SPDF) located at Goddard Space Flight Center has developed a Web-based client through which one can translate one or more local and/or remote files. The client is available at http://translators.gsfc.nasa.gov.

Note: The Java virtual machine on the server may not be able to handle large files due to memeory constraints, and it is hily recommeded that users download individual trnaslator(s) of choice from http://cdf.gsfc.nasa.gov/html/dtws.html#download and run the program locally.


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 email)
          Translates a single file (local or remote) using the default mapping file (if applicable).
 java.lang.String[] translateFiles(javax.activation.DataHandler[] dhArray, java.lang.String[] fileNames, java.lang.String[] translationModes, java.lang.String email)
          Translates one or more local and/or remote files using the default mapping files (if applicable).
 java.lang.String[] translateFileswithMappings(javax.activation.DataHandler[] dhArray, java.lang.String[] fileNames, java.lang.String[] translationModes, javax.activation.DataHandler[] mappingFileDHs, java.lang.String[] mappingFileNames, java.lang.String[] mappingFileModes, java.lang.String email)
          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 email)
          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 email)
          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 email)
          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 email)
          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 email)
          Translates a remote file using the user-specified mapping file that resides on a remote machine.
 

Method Detail

translateRemoteFile

java.lang.String translateRemoteFile(java.lang.String fileName,
                                     java.lang.String translationMode,
                                     java.lang.String email)
                                     throws java.rmi.RemoteException
Translates a file that resides on a remote machine using the default mapping file (if applicable).

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.

email - 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".

Throws:
java.rmi.RemoteException - if a problem occurred accessing this remote procedure call.

translateRemoteFilewithMapping

java.lang.String translateRemoteFilewithMapping(java.lang.String fileName,
                                                java.lang.String translationMode,
                                                java.lang.String mappingFileName,
                                                java.lang.String email)
                                                throws java.rmi.RemoteException
Translates a remote file using the user-specified mapping file that resides on a remote machine.

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

email - 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".

Throws:
java.rmi.RemoteException - if a problem occurred accessing this remote procedure call.

translateFile

java.lang.String translateFile(javax.activation.DataHandler dh,
                               java.lang.String fileName,
                               java.lang.String translationMode,
                               java.lang.String email)
                               throws java.rmi.RemoteException
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.

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.

email - 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".

Throws:
java.rmi.RemoteException - if a problem occurred accessing this remote procedure call.

translateFilewithMapping

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 email)
                                          throws java.rmi.RemoteException
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.

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.

email - 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".

Throws:
java.rmi.RemoteException - if a problem occurred accessing this remote procedure call.

translateRemoteFiles

java.lang.String[] translateRemoteFiles(java.lang.String[] fileNames,
                                        java.lang.String[] translationModes,
                                        java.lang.String email)
                                        throws java.rmi.RemoteException
Translates one or more remote files using the default mapping file (if applicable).

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.

email - 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".

Throws:
java.rmi.RemoteException - if a problem occurred accessing this remote procedure call.

translateRemoteFileswithMappings

java.lang.String[] translateRemoteFileswithMappings(java.lang.String[] fileNames,
                                                    java.lang.String[] translationModes,
                                                    java.lang.String[] mappingFileNames,
                                                    java.lang.String[] mappingFileModes,
                                                    java.lang.String email)
                                                    throws java.rmi.RemoteException
Translates one or more remote files using the user-specified mapping files that reside on remote machine(s).

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.

email - 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".

Throws:
java.rmi.RemoteException - if a problem occurred accessing this remote procedure call.

translateFiles

java.lang.String[] translateFiles(javax.activation.DataHandler[] dhArray,
                                  java.lang.String[] fileNames,
                                  java.lang.String[] translationModes,
                                  java.lang.String email)
                                  throws java.rmi.RemoteException
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.

Parameters:
dhArray - 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.

email - 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".

Throws:
java.rmi.RemoteException - if a problem occurred accessing this remote procedure call.

translateFileswithMappings

java.lang.String[] translateFileswithMappings(javax.activation.DataHandler[] dhArray,
                                              java.lang.String[] fileNames,
                                              java.lang.String[] translationModes,
                                              javax.activation.DataHandler[] mappingFileDHs,
                                              java.lang.String[] mappingFileNames,
                                              java.lang.String[] mappingFileModes,
                                              java.lang.String email)
                                              throws java.rmi.RemoteException
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.

Parameters:
dhArray - 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.

email - 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".

Throws:
java.rmi.RemoteException - if a problem occurred accessing this remote procedure call.

isDeployed

java.lang.String isDeployed()
                            throws java.rmi.RemoteException
Perform a check to see if the Data Translation Web Service is deployed.

Returns:
A string of "yes" is returned if the services are deployed. Otherwise, nothing is expected from the call.
Throws:
java.rmi.RemoteException - if a problem occurred accessing this remote procedure call.