ITPDSDataSender interface
ITPDSDataSender is a public interface.
The ITPDSDataSender interface provides for sending binary data to the KCM Core server. This is typically the XML stream used as data input for a KCM process.
This interface is used to send data when it is requested by Src(...) Dest(...) of the ReceiveFile command.
import com.aia_itp.itpdsapi.*;
import java.io.*;
class MyClass implements ITPDSDataSender
{
....
public ITPDSInputStream ITPDSSendData(String DataItem)
{
try
{
// We're going to 'read' the file corresponding to 'DataItem'...
java.io.File f = new java.io.File(DataItem + ".xml");
InputStream stream = new BufferedInputStream(new FileInputStream(f));
return new ITPDSInputStream(stream, (int)f.length());
}
catch(Exception e)
{
return null;
}
}
public void ITPDSSendDataFinished(String DataItem, ITPDSInputStream out)
{
try
{
out.getInputStream().close();
}
catch(Exception e)
{
}
}
....
}