思特奇智慧酒店云平台 v0.0.5版本的 MD5 值为:dedb172bb322639d79d7e0e26262fb5c

以下内容为反编译后的 ServiceAdministrationManager.java 源代码,内容仅作参考


package org.jivesoftware.smackx.admin;

import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
import org.jivesoftware.smack.Manager;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smackx.commands.AdHocCommandManager;
import org.jivesoftware.smackx.commands.RemoteCommand;
import org.jivesoftware.smackx.xdata.Form;
public class ServiceAdministrationManager extends Manager {
    public static final boolean $assertionsDisabled = false;
    public static final String COMMAND_NODE = "http://jabber.org/protocol/admin";
    public static final String COMMAND_NODE_HASHSIGN = "http://jabber.org/protocol/admin#";
    public static final Map<XMPPConnection, ServiceAdministrationManager> INSTANCES = new WeakHashMap();
    public final AdHocCommandManager adHocCommandManager;

    public ServiceAdministrationManager(XMPPConnection xMPPConnection) {
        super(xMPPConnection);
        this.adHocCommandManager = AdHocCommandManager.getAddHocCommandsManager(xMPPConnection);
    }

    public static synchronized ServiceAdministrationManager getInstanceFor(XMPPConnection xMPPConnection) {
        ServiceAdministrationManager serviceAdministrationManager;
        synchronized (ServiceAdministrationManager.class) {
            serviceAdministrationManager = INSTANCES.get(xMPPConnection);
            if (serviceAdministrationManager == null) {
                serviceAdministrationManager = new ServiceAdministrationManager(xMPPConnection);
                INSTANCES.put(xMPPConnection, serviceAdministrationManager);
            }
        }
        return serviceAdministrationManager;
    }

    public RemoteCommand addUser() {
        return addUser(connection().getXMPPServiceDomain());
    }

    public RemoteCommand deleteUser() {
        return deleteUser(connection().getXMPPServiceDomain());
    }

    public RemoteCommand addUser(xw3 xw3Var) {
        return this.adHocCommandManager.getRemoteCommand(xw3Var, "http://jabber.org/protocol/admin#add-user");
    }

    public RemoteCommand deleteUser(xw3 xw3Var) {
        return this.adHocCommandManager.getRemoteCommand(xw3Var, "http://jabber.org/protocol/admin#delete-user");
    }

    public void addUser(tw3 tw3Var, String str) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException {
        RemoteCommand addUser = addUser();
        addUser.execute();
        Form createAnswerForm = addUser.getForm().createAnswerForm();
        createAnswerForm.getField("accountjid").addValue(tw3Var.toString());
        createAnswerForm.getField("password").addValue(str);
        createAnswerForm.getField("password-verify").addValue(str);
        addUser.execute(createAnswerForm);
    }

    public void deleteUser(tw3 tw3Var) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException {
        deleteUser(Collections.singleton(tw3Var));
    }

    public void deleteUser(Set<tw3> set) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException {
        RemoteCommand deleteUser = deleteUser();
        deleteUser.execute();
        Form createAnswerForm = deleteUser.getForm().createAnswerForm();
        createAnswerForm.getField("accountjids").addValues(ix3.i(set));
        deleteUser.execute(createAnswerForm);
    }
}