/** * Helper method to send packets. * * @param packet * The packet to send. */ protected void send(Packet packet) { try { compMan.sendPacket(this, packet); } catch (ComponentException e) { log.warn("(serving component '" + getName() + "') Could not send packet!", e); } }
/** * Sends a packet to the component manager in the XMPP server. * * @param packet * packet to send. */ public void sendPacket(Packet packet) { try { getComponentManager().sendPacket(this, packet); } catch (Exception e) { logger.error(GtmsLog.exceptionToString(e)); } }
public void send(Packet packet) { try { logger.debug(packet.toXML()); ComponentManagerFactory.getComponentManager().sendPacket(component, packet); } catch (ComponentException e) { logger.error(GtmsLog.exceptionToString(e)); } }
/** * Handles status requests sent to the packet handler. Reports back with the * status, description and dump of any problem as a Gtx message. * * @param status * the status to packetize. * @param to * the jid requesting plugin status. */ public void send(GtmsStatus status, JID to) { try { ComponentManagerFactory.getComponentManager().sendPacket(component, getPacket(status, componentJID, to)); } catch (ComponentException e) { logger.error(GtmsLog.exceptionToString(e)); } }
/** * Handles status requests sent to the packet handler. Reports back with the * status, description and dump of any problem as a Gtx IQ to the * IQ.getFrom(). * * @param status * the status to packetize. * @param iq * the original IQ requesting plugin status. */ public void send(GtmsStatus status, IQ iq) { try { ComponentManagerFactory.getComponentManager().sendPacket(component, getPacket(status, iq)); } catch (ComponentException e) { logger.error(GtmsLog.exceptionToString(e)); } }
/** * Handles requests sent to the packet handler. Reports back with the call * event. * * @param callCollection * the collection of calls to packetize. * @param to * the jid requesting plugin status. */ public void send(GtxCallCollection callCollection, JID to, String systemId, String systemUid, String deviceName) { try { ComponentManagerFactory.getComponentManager().sendPacket(component, getPacket(callCollection, componentJID, to, systemId, systemUid, deviceName)); callCollection.clearNotificationState(); } catch (ComponentException e) { logger.error(GtmsLog.exceptionToString(e)); } }
public Response answerTimeout() { BaseResponse response = new BaseResponse(); IQ reply = IQ.createResultIQ(iq); reply.setType(org.xmpp.packet.IQ.Type.error); PacketError error = new PacketError(org.xmpp.packet.PacketError.Condition.undefined_condition, org.xmpp.packet.PacketError.Type.cancel, "Timeout Error"); reply.setError(error); response.setResponseType(ResponseType.ERROR); try { ComponentManagerFactory.getComponentManager().sendPacket(component, reply); response.setResponseType(ResponseType.OK); setExecuted(true); } catch (ComponentException e) { logger.error(GtmsLog.exceptionToString(e)); } return response; }
@Override public Response execute() throws ActionExecutionException { BaseResponse response = new BaseResponse(); IQ reply = IQ.createResultIQ(iq); if (resultBody != null) { reply.setType(org.xmpp.packet.IQ.Type.result); reply.setChildElement(resultBody); } else { reply.setType(org.xmpp.packet.IQ.Type.error); PacketError error = new PacketError(org.xmpp.packet.PacketError.Condition.undefined_condition, org.xmpp.packet.PacketError.Type.cancel, "Timeout Error"); reply.setError(error); response.setResponseType(ResponseType.ERROR); } try { ComponentManagerFactory.getComponentManager().sendPacket(component, reply); response.setResponseType(ResponseType.OK); setExecuted(true); } catch (ComponentException e) { throw new ActionExecutionException(e); } return response; }
componentManager.sendPacket(this, reply);