if (PresenceStanza.isOfType(stanza)) {
return relayToAllSessions();
} else if (MessageStanza.isOfType(stanza)) {
MessageStanza messageStanza = (MessageStanza)xmppStanza;
MessageStanzaType messageStanzaType = messageStanza.getMessageType();
switch (messageStanzaType) {
case CHAT:
case NORMAL:
return serverRuntimeContext.getServerFeatures().isDeliveringMessageToHighestPriorityResourcesOnly() ?
relayToBestSessions(false) : relayToAllSessions(0);
case ERROR:
// silently ignore
return null;
case GROUPCHAT:
return new RelayResult(new ServiceNotAvailableException());
case HEADLINE:
return relayToAllSessions();
default:
throw new RuntimeException("unhandled message type " + messageStanzaType.value());
}
} else if (IQStanza.isOfType(stanza)) {
// TODO handle on behalf of the user/client
throw new RuntimeException("inbound IQ not yet handled");
}