Search in sources :

Example 1 with AS400Structure

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);
}
Also used : ErrorCodeParameter(com.ibm.as400.access.ErrorCodeParameter) ProgramParameter(com.ibm.as400.access.ProgramParameter) AS400Text(com.ibm.as400.access.AS400Text) AS400Structure(com.ibm.as400.access.AS400Structure) AS400Bin4(com.ibm.as400.access.AS400Bin4) ServiceProgramCall(com.ibm.as400.access.ServiceProgramCall) ProgramCall(com.ibm.as400.access.ProgramCall)

Aggregations

AS400Bin4 (com.ibm.as400.access.AS400Bin4)1 AS400Structure (com.ibm.as400.access.AS400Structure)1 AS400Text (com.ibm.as400.access.AS400Text)1 ErrorCodeParameter (com.ibm.as400.access.ErrorCodeParameter)1 ProgramCall (com.ibm.as400.access.ProgramCall)1 ProgramParameter (com.ibm.as400.access.ProgramParameter)1 ServiceProgramCall (com.ibm.as400.access.ServiceProgramCall)1