@Bean(name="commands", active=true) public class AdHocCommandModule extends AbstractModule implements Initializable
Modifier and Type | Class and Description |
---|---|
static interface |
AdHocCommandModule.ScriptCommandProcessor |
Modifier and Type | Field and Description |
---|---|
protected static String[] |
COMMAND_PATH |
protected AdHocCommandManager |
commandsManager |
protected static Criteria |
CRIT |
static String |
ID |
protected AdHocCommandModule.ScriptCommandProcessor |
scriptProcessor |
static String |
XMLNS |
eventBus, log, writer
EMPTY_FEATURES
Constructor and Description |
---|
AdHocCommandModule() |
Modifier and Type | Method and Description |
---|---|
void |
addCommandListItemsElements(String node,
JID stanzaTo,
JID stanzaFrom,
Consumer<Element> collector) |
List<Element> |
getCommandListItems(JID senderJid,
JID toJid) |
AdHocCommandManager |
getCommandsManager() |
String[] |
getFeatures()
Returns XMPP features offered by module.
|
Criteria |
getModuleCriteria()
Returns critera used by Component to select module to handle incoming stanza.
|
List<Element> |
getScriptItems(String node,
JID stanzaTo,
JID stanzaFrom) |
AdHocCommandModule.ScriptCommandProcessor |
getScriptProcessor() |
void |
initialize()
Method will be called, when bean will be created, configured and ready to use.
|
void |
process(Packet packet)
Process incoming stanza.
|
protected void |
processScriptAdHoc(Packet packet) |
void |
register(AdHocCommand command) |
void |
setCommandsManager(AdHocCommandManager commandsManager) |
void |
setScriptProcessor(AdHocCommandModule.ScriptCommandProcessor scriptProcessor) |
fireEvent, getEventBus, getWriter, setEventBus, setWriter, write, write
public static final String ID
public static final String XMLNS
protected static final String[] COMMAND_PATH
protected static final Criteria CRIT
@Inject(nullAllowed=false) protected AdHocCommandManager commandsManager
@Inject(nullAllowed=false) protected AdHocCommandModule.ScriptCommandProcessor scriptProcessor
public AdHocCommandManager getCommandsManager()
public void setCommandsManager(AdHocCommandManager commandsManager)
public String[] getFeatures()
Module
getFeatures
in interface Module
null
.public Criteria getModuleCriteria()
Module
getModuleCriteria
in interface Module
public void addCommandListItemsElements(String node, JID stanzaTo, JID stanzaFrom, Consumer<Element> collector)
public AdHocCommandModule.ScriptCommandProcessor getScriptProcessor()
public void setScriptProcessor(AdHocCommandModule.ScriptCommandProcessor scriptProcessor)
public void initialize()
Initializable
initialize
in interface Initializable
public void process(Packet packet) throws ComponentException
Module
process
in interface Module
packet
- received stanza
.ComponentException
- if stanza can't be processed correctly. ComponentException is converted to error
stanza and returned to stanza sender.public void register(AdHocCommand command)
protected void processScriptAdHoc(Packet packet)
Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.