|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttigase.server.BasicComponent
tigase.server.AbstractMessageReceiver
tigase.server.sreceiver.StanzaReceiver
public class StanzaReceiver
This is a sibbling of StanzaSender
class and offers just
an opposite functionaity. It can receive XMPP packets to do something
with them. And what to do it depends on the destination address.
Destination address points to certain receiver task and this is up
to task to decide what to do with the stanza. Task address is just a
usuall Jabber ID: task-short-name@srec.tigase.org.
Like public chat rooms in MUC tasks can be preconfigured
in the StanzaReceiver
configuration or can be created on
demand using ad-hoc
commands and service-discovery
.
User can subscribe to some tasks and can add them to the roster just like
a normal contacts. This allows to use the functionality from all existing
clients without implementing any special protocols or extensions.
Possible tasks are:
Task creation parameters:
ad-hoc
commands should present available tasks types which can be created.
User can select a task to create. There may be some restrictions on
tasks creation like certain types can be created only by server
administrator or some tasks types can be created only once on single
server and so on.subscrive
presence is sent to these users and they can
accept the subscription or not.chat
, headline
or normal
.all
, subscribed
,
owner
, list
Created: Wed May 9 08:27:22 2007
Field Summary | |
---|---|
static String |
MY_DOMAIN_NAME_PROP_KEY
Field description |
static String |
MY_DOMAIN_NAME_PROP_VAL
Field description |
Fields inherited from class tigase.server.AbstractMessageReceiver |
---|
HOUR, INCOMING_FILTERS_PROP_KEY, INCOMING_FILTERS_PROP_VAL, MAX_QUEUE_SIZE_PROP_KEY, MAX_QUEUE_SIZE_PROP_VAL, maxQueueSize, MINUTE, OUTGOING_FILTERS_PROP_KEY, OUTGOING_FILTERS_PROP_VAL, SECOND |
Fields inherited from class tigase.server.BasicComponent |
---|
SCRIPTS_DIR_PROP_DEF, SCRIPTS_DIR_PROP_KEY, vHostManager |
Fields inherited from interface tigase.disco.XMPPService |
---|
CMD_FEATURES, DEF_FEATURES, INFO_XMLNS, ITEMS_XMLNS |
Constructor Summary | |
---|---|
StanzaReceiver()
Constructs ... |
Method Summary | |
---|---|
boolean |
addOutPacket(Packet packet)
Method description |
protected void |
addTaskInstance(ReceiverTaskIfc task)
Describe addTaskInstance method here. |
protected void |
addTaskInstance(String task_type,
String task_name,
Map<String,Object> task_params)
|
Map<String,Object> |
getDefaults(Map<String,Object> params)
Method description |
List<tigase.xml.Element> |
getDiscoFeatures(tigase.xmpp.JID from)
Method description |
tigase.xml.Element |
getDiscoInfo(String node,
tigase.xmpp.JID jid,
tigase.xmpp.JID from)
Describe getDiscoInfo method here. |
List<tigase.xml.Element> |
getDiscoItems(String node,
tigase.xmpp.JID jid,
tigase.xmpp.JID from)
Method description |
void |
getStatistics(StatisticsList list)
Method description |
ReceiverTaskIfc |
getTask(String jidOrName)
Method description |
protected Map<String,ReceiverTaskIfc> |
getTaskInstances()
|
protected Map<String,TaskType> |
getTaskTypes()
|
boolean |
isAdmin(tigase.xmpp.JID jid)
Method description |
protected boolean |
isAllowedCreate(tigase.xmpp.JID jid,
String task_type)
|
void |
processPacket(Packet packet)
Describe processPacket method here. |
protected void |
removeTaskInstance(ReceiverTaskIfc task)
|
protected void |
removeTaskSubscribers(ReceiverTaskIfc task,
tigase.xmpp.JID... subscr)
|
protected void |
saveTaskToRepository(ReceiverTaskIfc task)
|
void |
setProperties(Map<String,Object> props)
Describe setProperties method here. |
Methods inherited from class tigase.server.AbstractMessageReceiver |
---|
addOutPacketNB, addOutPackets, addOutPacketWithTimeout, addPacket, addPacketNB, addPackets, addRegexRouting, addTimerTask, addTimerTask, clearRegexRoutings, everyHour, everyMinute, everySecond, getMaxQueueSize, getRegexRoutings, hashCodeForPacket, isInRegexRoutings, newPacketId, processingThreads, processPacket, release, removeRegexRouting, setMaxQueueSize, setName, setParent, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface tigase.server.ServerComponent |
---|
getComponentId, getName, initializationCompleted, processPacket, release, setName |
Methods inherited from interface tigase.server.sreceiver.StanzaReceiverIfc |
---|
getDefHostName, getName |
Methods inherited from interface tigase.server.MessageReceiver |
---|
getDefHostName |
Field Detail |
---|
public static final String MY_DOMAIN_NAME_PROP_KEY
public static final String MY_DOMAIN_NAME_PROP_VAL
Constructor Detail |
---|
public StanzaReceiver()
Method Detail |
---|
public boolean addOutPacket(Packet packet)
addOutPacket
in interface StanzaReceiverIfc
addOutPacket
in class AbstractMessageReceiver
packet
-
public Map<String,Object> getDefaults(Map<String,Object> params)
getDefaults
in interface Configurable
getDefaults
in class AbstractMessageReceiver
params
-
public List<tigase.xml.Element> getDiscoFeatures(tigase.xmpp.JID from)
getDiscoFeatures
in interface XMPPService
getDiscoFeatures
in class BasicComponent
from
-
public tigase.xml.Element getDiscoInfo(String node, tigase.xmpp.JID jid, tigase.xmpp.JID from)
getDiscoInfo
method here.
getDiscoInfo
in interface XMPPService
getDiscoInfo
in class BasicComponent
node
- a String
valuejid
- a String
valuefrom
-
Element
valuepublic List<tigase.xml.Element> getDiscoItems(String node, tigase.xmpp.JID jid, tigase.xmpp.JID from)
getDiscoItems
in interface XMPPService
getDiscoItems
in class BasicComponent
node
- jid
- from
-
public void getStatistics(StatisticsList list)
getStatistics
in interface StatisticsContainer
getStatistics
in class AbstractMessageReceiver
list
- public ReceiverTaskIfc getTask(String jidOrName)
jidOrName
-
public boolean isAdmin(tigase.xmpp.JID jid)
isAdmin
in class BasicComponent
jid
-
public void processPacket(Packet packet)
processPacket
method here.
processPacket
in class AbstractMessageReceiver
packet
- a Packet
valuepublic void setProperties(Map<String,Object> props)
setProperties
method here.
setProperties
in interface Configurable
setProperties
in class AbstractMessageReceiver
props
- a Map
valueprotected void addTaskInstance(String task_type, String task_name, Map<String,Object> task_params) throws tigase.util.TigaseStringprepException
tigase.util.TigaseStringprepException
protected void addTaskInstance(ReceiverTaskIfc task)
addTaskInstance
method here.
task
- a ReceiverTaskIfc
valueprotected Map<String,ReceiverTaskIfc> getTaskInstances()
protected Map<String,TaskType> getTaskTypes()
protected boolean isAllowedCreate(tigase.xmpp.JID jid, String task_type)
protected void removeTaskInstance(ReceiverTaskIfc task)
protected void removeTaskSubscribers(ReceiverTaskIfc task, tigase.xmpp.JID... subscr)
protected void saveTaskToRepository(ReceiverTaskIfc task) throws TigaseDBException
TigaseDBException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |