package com.kofax.kmc.klo.logistics.webservice.calls; import com.kofax.kmc.klo.logistics.service.NetworkService; import com.kofax.kmc.klo.logistics.webservice.KofaxWebServiceResponseBase; import com.kofax.kmc.klo.logistics.webservice.UserLogoutResponse; import com.kofax.kmc.klo.logistics.webservice.WebServiceCallResult; import com.kofax.kmc.kut.utilities.CertificateValidatorListener; import com.kofax.kmc.kut.utilities.error.ErrorInfo; import com.kofax.mobile.sdk._internal.k; import java.net.SocketTimeoutException; import java.net.URL; import javax.net.ssl.SSLException; import o.gjJ; import o.gmO; /* loaded from: classes3.dex */ public class UserLogout extends KofaxWebServiceCallBase { public static String METHOD_NAME = "logout"; public static String NAMESPACE = "http://logout.wsc.des.kofax.com"; public static String SERVICE_NAME = "UserLogoutService"; public static String SOAP_ACTION = "urn:logout"; private static String TAG = "UserLogout"; private String requestUserName = new String(); private String requestPassword = new String(); private String requestDomain = new String(); @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public WebServiceCallResult init(URL url, CertificateValidatorListener certificateValidatorListener) { WebServiceCallResult init = super.init(url, certificateValidatorListener); k.c(TAG, "result = ".concat(String.valueOf(init))); if (!init.isSuccess()) { return init; } if (gjJ.b((CharSequence) this.requestUserName)) { init.setErrorMsg("No user defined"); } else { setRequestUserName(this.requestUserName); setRequestPassword(this.requestPassword); } init.setSuccess(gjJ.b((CharSequence) init.getErrorMsg())); k.c(TAG, "result = ".concat(String.valueOf(init))); return init; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public KofaxWebServiceResponseBase populateFromResponse(gmO gmo) { return UserLogoutResponse.populateFromResponse(gmo); } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public gmO packageRequest() { gmO gmo = new gmO(getNamespace(), getMethodName()); gmo.d("userName", getRequestUserName()); gmo.d("userPassword", getRequestPassword()); gmo.d("wscClientId2", NetworkService.getMacAddress()); return gmo; } public static WebServiceCallResult logoutUser(URL url, String str, String str2, String str3, CertificateValidatorListener certificateValidatorListener, int i) { UserLogout userLogout = new UserLogout(); userLogout.setRequestDomain(str); userLogout.setRequestUserName(str2); userLogout.setRequestPassword(str3); userLogout.setTimeout(i); WebServiceCallResult init = userLogout.init(url, certificateValidatorListener); if (init.isSuccess()) { init.setSuccess(false); try { UserLogoutResponse userLogoutResponse = (UserLogoutResponse) userLogout.execute(); if (!gjJ.b((CharSequence) userLogoutResponse.getErrorMessage())) { init.setErrorMsg(userLogoutResponse.getErrorMessage()); init.setSuccess(false); } else { init.setExtraData(userLogoutResponse); init.setSuccess(true); } } catch (SocketTimeoutException e) { k.e(TAG, "user logout Service SocketTimeoutException", (Throwable) e); init.setErrorMsg(e.getMessage()); init.setErrorInfo(ErrorInfo.KMC_LO_REQUEST_TIMEOUT); } catch (SSLException e2) { k.e(TAG, "Error in logout", (Throwable) e2); init.setErrorMsg(e2.getMessage()); init.setCertificateError(true); } catch (Exception e3) { k.e(userLogout.getClass().getName(), "Unable to log out user", (Throwable) e3); init.setErrorMsg("Unknown error"); } } String str4 = TAG; StringBuilder sb = new StringBuilder("result from user logout = "); sb.append(init.getErrorMsg()); sb.append(" "); sb.append(init.getExtraData()); k.c(str4, sb.toString()); return init; } public void setRequestUserName(String str) { this.requestUserName = str; } public void setRequestPassword(String str) { this.requestPassword = str; } public void setRequestDomain(String str) { this.requestDomain = str; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public String getSoapAction() { return SOAP_ACTION; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public String getServiceName() { return SERVICE_NAME; } public String getRequestUserName() { return this.requestUserName; } public String getRequestPassword() { return this.requestPassword; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public String getNamespace() { return NAMESPACE; } @Override // com.kofax.kmc.klo.logistics.webservice.calls.KofaxWebServiceCallBase public String getMethodName() { return METHOD_NAME; } }