Search in sources :

Example 6 with ErrorCodeParameter

use of com.ibm.as400.access.ErrorCodeParameter in project DCM-tools by ThePrez.

the class DcmApiCaller method callQycdUpdateCertUsage.

public void callQycdUpdateCertUsage(final AppLogger _logger, final String _appId, final String _certStoreName, final String _certId) throws PropertyVetoException, AS400SecurityException, ErrorCompletingRequestException, IOException, InterruptedException, ObjectDoesNotExistException {
    final ServiceProgramCall program = new ServiceProgramCall(m_conn);
    final String programName = "/QSYS.LIB/QICSS.LIB/QYCDCUSG.SRVPGM";
    final ProgramParameter[] parameterList = new ProgramParameter[8];
    // 1 Application ID Output Char(*)
    parameterList[0] = new ProgramParameter(new AS400Text(_appId.length()).toBytes(_appId));
    // 2 Length of application ID Input Binary(4)
    parameterList[1] = new ProgramParameter(new AS400Bin4().toBytes(_appId.length()));
    // 3 Certificate store name Input Char(*)
    parameterList[2] = new ProgramParameter(new AS400Text(_certStoreName.length()).toBytes(_certStoreName));
    // 4 Length of certificate store name Input Binary(4)
    parameterList[3] = new ProgramParameter(new AS400Bin4().toBytes(_certStoreName.length()));
    // 5 Certificate ID type Input Char(*)
    parameterList[4] = new ProgramParameter(new AS400Text(1).toBytes("1"));
    // 6 Certificate ID Input Char(*)
    parameterList[5] = new ProgramParameter(new AS400Text(_certId.length()).toBytes(_certId));
    // 7 Length of certificate ID Input Binary(4)
    parameterList[6] = new ProgramParameter(new AS400Bin4().toBytes(_certId.length()));
    // 8 Error code I/O Char(*)
    final ErrorCodeParameter ec = new ErrorCodeParameter(true, true);
    parameterList[7] = ec;
    program.setProgram(programName, parameterList);
    program.setProcedureName("QycdUpdateCertUsage");
    // Run the program.
    runProgram(_logger, program, ec);
}
Also used : ErrorCodeParameter(com.ibm.as400.access.ErrorCodeParameter) ServiceProgramCall(com.ibm.as400.access.ServiceProgramCall) ProgramParameter(com.ibm.as400.access.ProgramParameter) AS400Text(com.ibm.as400.access.AS400Text) AS400Bin4(com.ibm.as400.access.AS400Bin4)

Aggregations

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