setAdvancedCapabilities
Allows the user of the application to specify callback objects that are involved in communication with the server:
public void setAdvancedCapabilities(ITPOLSDataSender sender,
ITPOLSDataReceiver receiver)
public void setAdvancedCapabilities(ITPOLSDataSender sender,
ITPOLSDataReceiver receiver,
ITPOLSExchangeData exchange_data)
The callback classes have to implement the appropriate interfaces:
public interface ITPOLSDataReceiver {
/**
* Method called when the ITP/OnLine Server server executes a SendFile command.
* This method should return either null to indicate that it does not want to receive the
* data or an OutputStream object to which the data will be written.
* @param DataItem The Dest parameter as passed in
* the SendFile Src(...) Dest(...) command.
*/
public OutputStream ITPOLSReceiveData(String DataItem);
/**
* Method called when receipt of the data has been finished.
* When this method is called all data has been written to the
* OutputStream returned by ITPOLSReceiveData. It is typically
* used to close the OutputStream object.
* @param DataItem The Dest parameter as passed in
* the SendFile Src(...) Dest(...) command.
* @param out The OutputStream object as returned by ITPOLSReceiveData.
*/
public void ITPOLSReceiveDataFinished(String DataItem, OutputStream out);
}
public interface ITPOLSDataSender {
/**
* Method called when the ITP/OnLine Server server executes a ReceiveFile command.
* This method should return either null to indicate that it does not want to send the
* data or an ITPOLSInputStream object from which the data will be read.
* <p>
* The InputStream object that is returned must be wrapped in
* an ITPOLSInputStream object, because ITP/OnLine Server requires the size of the data
* to be available before actually sending the data.
*
* @param DataItem The Src parameter as passed in the ReceiveFile Src(...) command.
*/
public ITPOLSInputStream ITPOLSSendData(String DataItem);
/**
* Method call when sending the data has been finished.
* When this method is called all data has been sent to the ITP/OnLine Server server.
* It is typically used to close the InputStream object.
*
* @param DataItem The Src parameter as passed in the ReceiveFile Src(...) command.
* @param in The ITPOLSInputStream object as returned by ITPOLSSendData.
*/
public void ITPOLSSendDataFinished(String DataItem, ITPOLSInputStream in);
}
public interface ITPOLSExchangeData
{
/**
* Method called when the ITP/OnLine Server server executes a exchange_data(key, value)
* function.
* This method should return a (optionally empty) string to the server.
*
* @param Key The Key parameter as passed in the exchange_data function.
* @param Value The Data parameter as passed in the exchange_data function.
*/
public String ITPOLSExchangeData(String Key, String Value);}
submit
The submit functions takes the service name as the first function parameter, followed by a boolean flag that indicates whether job submission is synchronous.
Optional parameters are
RQST_IN_ASCII or RQST_IN_UNICODE (which is the default).public boolean submit (
String service,
boolean sync)
throws Exception
public boolean submit (
String service,
boolean sync,
String user)
throws Exception
public boolean submit (
String service,
boolean sync,
int ByteCoding)
throws Exception
public boolean submit (
String service,
boolean synchronous,
String user,
int byteCoding)
throws Exception
Parameters are set before submit is called.
// Clear the parameter list, for subsequent addParamter() calls
public void clearParameters()
// Sets all parameters at once
public void setParameters(String[] parameters)
// Adds a single parameter to the parameter list
public void addParameter(String parameter)