// Path: src/main/java/com/tsystems/readyapi/plugin/websocket/Utils.java
// public static String bytesToHexString(byte[] buf) {
//     final String decimals = "0123456789ABCDEF";
//     if (buf == null)
//         return null;
//     char[] r = new char[buf.length * 2];
//     for (int i = 0; i < buf.length; ++i) {
//         r[i * 2] = decimals.charAt((buf[i] & 0xf0) >> 4);
//         r[i * 2 + 1] = decimals.charAt(buf[i] & 0x0f);
//     }
//     return new String(r);
// }
// 
// Path: src/main/java/com/tsystems/readyapi/plugin/websocket/Utils.java
// public static byte[] hexStringToBytes(String str) {
//     if (str == null)
//         return null;
//     if (str.length() % 2 != 0)
//         throw new IllegalArgumentException();
//     byte[] result = new byte[str.length() / 2];
//     try {
//         for (int i = 0; i < result.length; ++i)
//             result[i] = (byte) Short.parseShort(str.substring(i * 2, i * 2 + 2), 16);
//     } catch (NumberFormatException e) {
//         throw new IllegalArgumentException(e);
//     }
//     return result;
// }


import static com.tsystems.readyapi.plugin.websocket.Utils.bytesToHexString;
import static com.tsystems.readyapi.plugin.websocket.Utils.hexStringToBytes;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Objects;
import org.apache.commons.ssl.OpenSSL;
import org.apache.log4j.Logger;
import org.apache.xmlbeans.XmlObject;
import com.eviware.soapui.model.propertyexpansion.PropertyExpansionContext;
import com.eviware.soapui.support.PropertyChangeNotifier;
import com.eviware.soapui.support.xml.XmlObjectConfigurationReader;
    }

    public ConnectionParams getParams() {
        return new ConnectionParams(getServerUri(), getLogin(), getPassword(), getSubprotocols());
    }

    public String getPassword() {
        return password;
    }

    public String getServerUri() {
        return originalServerUri;
    }

    public String getSubprotocols() {
        return subprotocols;
    }

    public boolean hasCredentials() {
        return login != null && !"".equals(login);
    }

    public void load(XmlObject xml) {
        XmlObjectConfigurationReader reader = new XmlObjectConfigurationReader(xml);
        name = reader.readString(NAME_SETTING_NAME, null);
        originalServerUri = reader.readString(SERVER_URI_SETTING_NAME, null);
        login = reader.readString(LOGIN_SETTING_NAME, null);
        password = null;
        String encodedPasswordString = reader.readString(ENCR_PASSWORD_SETTING_NAME, null);
        if (encodedPasswordString != null && encodedPasswordString.length() != 0) {
// Path: src/main/java/com/tsystems/readyapi/plugin/websocket/Utils.java
// public static String bytesToHexString(byte[] buf) {
//     final String decimals = "0123456789ABCDEF";
//     if (buf == null)
//         return null;
//     char[] r = new char[buf.length * 2];
//     for (int i = 0; i < buf.length; ++i) {
//         r[i * 2] = decimals.charAt((buf[i] & 0xf0) >> 4);
//         r[i * 2 + 1] = decimals.charAt(buf[i] & 0x0f);
//     }
//     return new String(r);
// }
// 
// Path: src/main/java/com/tsystems/readyapi/plugin/websocket/Utils.java
// public static byte[] hexStringToBytes(String str) {
//     if (str == null)
//         return null;
//     if (str.length() % 2 != 0)
//         throw new IllegalArgumentException();
//     byte[] result = new byte[str.length() / 2];
//     try {
//         for (int i = 0; i < result.length; ++i)
//             result[i] = (byte) Short.parseShort(str.substring(i * 2, i * 2 + 2), 16);
//     } catch (NumberFormatException e) {
//         throw new IllegalArgumentException(e);
//     }
//     return result;
// }


// Path: src/main/java/com/tsystems/readyapi/plugin/websocket/Connection.java
import static com.tsystems.readyapi.plugin.websocket.Utils.bytesToHexString;
import static com.tsystems.readyapi.plugin.websocket.Utils.hexStringToBytes;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Objects;
import org.apache.commons.ssl.OpenSSL;
import org.apache.log4j.Logger;
import org.apache.xmlbeans.XmlObject;
import com.eviware.soapui.model.propertyexpansion.PropertyExpansionContext;
import com.eviware.soapui.support.PropertyChangeNotifier;
import com.eviware.soapui.support.xml.XmlObjectConfigurationReader;

    }

    public ConnectionParams getParams() {
        return new ConnectionParams(getServerUri(), getLogin(), getPassword(), getSubprotocols());
    }

    public String getPassword() {
        return password;
    }

    public String getServerUri() {
        return originalServerUri;
    }

    public String getSubprotocols() {
        return subprotocols;
    }

    public boolean hasCredentials() {
        return login != null && !"".equals(login);
    }

    public void load(XmlObject xml) {
        XmlObjectConfigurationReader reader = new XmlObjectConfigurationReader(xml);
        name = reader.readString(NAME_SETTING_NAME, null);
        originalServerUri = reader.readString(SERVER_URI_SETTING_NAME, null);
        login = reader.readString(LOGIN_SETTING_NAME, null);
        password = null;
        String encodedPasswordString = reader.readString(ENCR_PASSWORD_SETTING_NAME, null);
        if (encodedPasswordString != null && encodedPasswordString.length() != 0) {
            byte[] encodedPassword = hexStringToBytes(encodedPasswordString);