private IEventResponse constructEventResponse(Object[] params) { CertificateLogger.debug("[ImportCertificateAction][constructEventResponse] Event Successful "); BasicEventResponse response = null; HashMap map = new HashMap(); map.put(IX500Name.ISSUERNAMES_ENTITY_NAME, _viewCertList.get(0)); map.put(IX500Name.SUBJECT_ENTITY_NAME, _viewCertList.get(1)); // TWX 26072006 to include cert's serialNum, startDate, endDate map.put(ICertificate.SERIAL_NUM_FIELD, _viewCertList.get(2)); map.put(ICertificate.START_DATE_FIELD, _viewCertList.get(3)); map.put(ICertificate.END_DATE_FIELD, _viewCertList.get(4)); response = new BasicEventResponse(IErrorCode.NO_ERROR, params, map); CertificateLogger.log("Values are :" + map); return response; }
private IEventResponse constructEventResponse(Object[] params, IEvent event, TypedException ex) { CertificateLogger.warn("[ImportCertificateAction][perform] Event Error ", ex); BasicEventResponse response = null; short errorCode = IErrorCode.FIND_ENTITY_BY_KEY_ERROR; if (ex instanceof InvalidFileTypeException) errorCode = IErrorCode.INVALID_FILETYPE_ERROR; if (ex instanceof InvalidPasswordOrFileTypeException) errorCode = IErrorCode.INVALID_PASSWORD_OR_FILETYPE_ERROR; response = new BasicEventResponse( errorCode, params, ex.getType(), ex.getLocalizedMessage(), ex.getStackTraceString()); return response; }