use of com.ibm.as400.access.AS400Structure in project DCM-tools by ThePrez.
the class DcmApiCaller method callQycdRenewCertificate_RNWC0300.
public void callQycdRenewCertificate_RNWC0300(final AppLogger _logger, final String _file) throws PropertyVetoException, AS400SecurityException, ErrorCompletingRequestException, IOException, InterruptedException, ObjectDoesNotExistException {
final ProgramCall program = new ProgramCall(m_conn);
// Initialize the name of the program to run.
final String programName = "/QSYS.LIB/QYCDRNWC.PGM";
final String apiFormat = "RNWC0300";
final AS400Structure arg0 = new AS400Structure(new AS400DataType[] { // 0 0 Binary (4) Offset to certificate path and file name
new AS400Bin4(), // 4 4 Binary (4) Length of certificate path and file name
new AS400Bin4(), // Char (*) Certificate path and file name
new AS400Text(// TODO
_file.length()) });
// Set up the parms
final ProgramParameter[] parameterList = new ProgramParameter[14];
// 1 Certificate request data Input Char(*)
parameterList[0] = new ProgramParameter(arg0.toBytes(new Object[] { 8, _file.length(), _file }));
// 2 Length of certificate request data Input Binary(4)
parameterList[1] = new ProgramParameter(new AS400Bin4().toBytes(arg0.getByteLength()));
// 3 Format name Input Char(8)
parameterList[2] = new ProgramParameter(new AS400Text(8).toBytes(apiFormat));
// 4 Error Code I/O Char(*)
final ErrorCodeParameter ec = new ErrorCodeParameter(true, true);
parameterList[3] = ec;
program.setProgram(programName, parameterList);
// Run the program.
runProgram(_logger, program, ec);
}
Aggregations