gov.nasa.gsfc.hessi.jidl.prep.client.bridge
Class VxoPrepClient

java.lang.Object
  extended by gov.nasa.gsfc.hessi.jidl.prep.client.bridge.VxoPrepClient
All Implemented Interfaces:
com.idl.javaidl.JIDLOutputListener

public class VxoPrepClient
extends java.lang.Object
implements com.idl.javaidl.JIDLOutputListener

This class bridges between IDL and the WSDL auto-generated stub classed generated with the help of the Java Web Toolkit (Jaxws 2.1.4). The WSDL is loaded from the PrepServer directly http://wilco.gsfc.nasa.gov:8080/VxoPrepServer/vxoprep?wsdl This client can be used dependent or independent from IDL!

Since:
Revision 19
Author:
Laszlo Istvan Etesi

Field Summary
(package private) static org.apache.log4j.Logger logger
          Local Logger instance
private  VxoPrepServer server
          Web server stub
private  VxoPrep service
          Web service stub
 
Constructor Summary
VxoPrepClient()
          Default constructor
 
Method Summary
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, boolean value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, boolean[] value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, byte value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, byte[] value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, double value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, double[] value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, int value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, int[] value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, long value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, long[] value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, short value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, short[] value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, java.lang.String value)
          Necessary to add PrepParameter (name - value) pairs.
 void addParameter(PrepParameterSet paramSet, java.lang.String paramName, java.lang.String[] value)
          Necessary to add PrepParameter (name - value) pairs.
private  void addParameterGen(PrepParameterSet paramSet, java.lang.String paramName, java.lang.Object value)
          Necessary to add PrepParameter (name - value) pairs.
 PrepParameterSet createPrepParameterSet(java.lang.String instrument)
          This method creates an empty PrepParameterSet that can be filled with all necessary data.
 void IDLoutput(com.idl.javaidl.JIDLObjectI sender, java.lang.String message)
          The callback class for IDL to log its output to Java
 PrepResponse preprocess(PrepParameterSet parameters, java.lang.String file)
          This method initiates the preprocessing
static byte[] readByteArrayFromFile(java.lang.String filePath)
          Helper method to read binary data from the disk to a byte[]
 void writeDataToFile(byte[] data, java.lang.String filePath)
          Helper method to write out data to the disk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
Local Logger instance


service

private VxoPrep service
Web service stub


server

private VxoPrepServer server
Web server stub

Constructor Detail

VxoPrepClient

public VxoPrepClient()
Default constructor

Method Detail

preprocess

public PrepResponse preprocess(PrepParameterSet parameters,
                               java.lang.String file)
This method initiates the preprocessing

Parameters:
parameters - is the PrepParameterSet that contains all necessary PrepParameter.
file - the output file to which all data is written to.
Throws:
java.lang.IllegalArgumentException - if parameters is null

createPrepParameterSet

public PrepParameterSet createPrepParameterSet(java.lang.String instrument)
This method creates an empty PrepParameterSet that can be filled with all necessary data.

Parameters:
instrument - is the instrument type
Returns:
a preconfigured PrepParameterSet.

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         boolean value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         byte value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         short value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         int value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         long value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         double value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         java.lang.String value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         boolean[] value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         byte[] value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         short[] value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         int[] value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         long[] value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         double[] value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameter

public void addParameter(PrepParameterSet paramSet,
                         java.lang.String paramName,
                         java.lang.String[] value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

addParameterGen

private void addParameterGen(PrepParameterSet paramSet,
                             java.lang.String paramName,
                             java.lang.Object value)
Necessary to add PrepParameter (name - value) pairs. In order to work smoothly with IDL, there are multiple versions of this method tailored to the different primitive types.

Parameters:
paramSet - the PrepParameterSet to which the (name - value) pair is added to
paramName - is the parameter name (i.e. 'cosmic')
value - is the parameter value (i.e. 1)

writeDataToFile

public void writeDataToFile(byte[] data,
                            java.lang.String filePath)
Helper method to write out data to the disk

Parameters:
data - is the byte[] to be written to the disk
filePath - is the path to where the data are written to

readByteArrayFromFile

public static byte[] readByteArrayFromFile(java.lang.String filePath)
Helper method to read binary data from the disk to a byte[]

Parameters:
filePath - is the file to be read
Returns:
a byte[] containing the file's content

IDLoutput

public void IDLoutput(com.idl.javaidl.JIDLObjectI sender,
                      java.lang.String message)
The callback class for IDL to log its output to Java

Specified by:
IDLoutput in interface com.idl.javaidl.JIDLOutputListener
Parameters:
sender - is the logging object
message - is the message to be logged