思特奇智慧酒店云平台 v0.0.5版本的 MD5 值为:dedb172bb322639d79d7e0e26262fb5c
以下内容为反编译后的 AdHocCommand.java 源代码,内容仅作参考
package org.jivesoftware.smackx.commands;
import java.util.List;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.StanzaError;
import org.jivesoftware.smackx.commands.packet.AdHocCommandData;
import org.jivesoftware.smackx.xdata.Form;
public abstract class AdHocCommand {
public AdHocCommandData data = new AdHocCommandData();
public enum Action {
execute,
cancel,
prev,
next,
complete,
unknown
}
public enum SpecificErrorCondition {
badAction("bad-action"),
malformedAction("malformed-action"),
badLocale("bad-locale"),
badPayload("bad-payload"),
badSessionid("bad-sessionid"),
sessionExpired("session-expired");
public final String value;
SpecificErrorCondition(String str) {
this.value = str;
}
@Override
public String toString() {
return this.value;
}
}
public enum Status {
executing,
completed,
canceled
}
public static SpecificErrorCondition getSpecificErrorCondition(StanzaError stanzaError) {
SpecificErrorCondition[] values;
for (SpecificErrorCondition specificErrorCondition : SpecificErrorCondition.values()) {
if (stanzaError.getExtension(specificErrorCondition.toString(), "http://jabber.org/protocol/commands") != null) {
return specificErrorCondition;
}
}
return null;
}
public void addActionAvailable(Action action) {
this.data.addAction(action);
}
public void addNote(AdHocCommandNote adHocCommandNote) {
this.data.addNote(adHocCommandNote);
}
public abstract void cancel() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException;
public abstract void complete(Form form) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException;
public abstract void execute() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException;
public List<Action> getActions() {
return this.data.getActions();
}
public AdHocCommandData getData() {
return this.data;
}
public Action getExecuteAction() {
return this.data.getExecuteAction();
}
public Form getForm() {
if (this.data.getForm() == null) {
return null;
}
return new Form(this.data.getForm());
}
public String getName() {
return this.data.getName();
}
public String getNode() {
return this.data.getNode();
}
public List<AdHocCommandNote> getNotes() {
return this.data.getNotes();
}
public abstract xw3 getOwnerJID();
public String getRaw() {
return this.data.getChildElementXML().toString();
}
public Status getStatus() {
return this.data.getStatus();
}
public boolean isCompleted() {
return getStatus() == Status.completed;
}
public boolean isValidAction(Action action) {
return getActions().contains(action) || Action.cancel.equals(action);
}
public abstract void next(Form form) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException;
public abstract void prev() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException;
public void setData(AdHocCommandData adHocCommandData) {
this.data = adHocCommandData;
}
public void setExecuteAction(Action action) {
this.data.setExecuteAction(action);
}
public void setForm(Form form) {
this.data.setForm(form.getDataFormToSend());
}
public void setName(String str) {
this.data.setName(str);
}
public void setNode(String str) {
this.data.setNode(str);
}
}