package org.nl.acs.opc;

import cn.hutool.core.util.StrUtil;
import org.openscada.opc.lib.da.Server;

/**
 * @author 20220102CG\noblelift
 */
public class OpcServerUtl {

    public static synchronized Server getServerWithOutException(String host, String clsid, String user, String password,
                                                                String domain) {
        if (!StrUtil.isEmpty(host) && !StrUtil.isEmpty(clsid) && !StrUtil.isEmpty(user)) {
            if (domain == null) {
                domain = "";
            }
            return OpcUtl.getServer(host, clsid, user, password, domain);
//            return OpcUtl.getAutoServer(host, clsid, user, password, domain);
        } else {
            return null;
        }
    }

}
