private boolean sendingFailed(OutboundMessage msg) { return msg.getMessageStatus().equals(OutboundMessage.MessageStatuses.FAILED); } }
/** * Converts the state of an SMSLib message to a string that can be mapped to * the motech-mobile MStatus values. * * @param msg * @return */ private String getSMSLibMessageStatus(OutboundMessage msg) { MessageStatuses msgStatus = msg.getMessageStatus(); String responseString = msgStatus.toString(); if (msgStatus == MessageStatuses.FAILED) { responseString = "ERROR_" + msg.getFailureCause().toString(); } return responseString; }
private Service() { initialize(); }
private void registerListeners() { log.info("Register listeners"); smslibService.setOutboundMessageNotification(outboundMessageNotification); smslibService.setInboundMessageNotification(inboundMessageNotification); }
/** * Constructs a new reply with the packet as the contents * of the reply. * * @param pkt * The received packet. * @param receiveTime a long. */ public PingReply(InboundMessage pkt, long receiveTime) { m_packet = pkt; m_requestId = new PingRequestId(pkt.getOriginator()); m_receiveTimestamp = receiveTime; }
private void setStatus(Status status) { Status oldStatus = this.status; this.status = status; Status newStatus = this.status; Service.getInstance().getCallbackManager().registerGatewayStatusEvent(this, oldStatus, newStatus); }
/** * Tears down the gateway. This is called before the application shuts down. * * @throws Exception */ @PreDestroy void shutdown() throws Exception { service.stopService(); }
private void setStatus(Status status) { Status oldStatus = this.status; this.status = status; Status newStatus = this.status; getCallbackManager().registerServiceStatusEvent(oldStatus, newStatus); }
public void setServiceStatusCallback(IServiceStatusCallback serviceStatusCallback) { getCallbackManager().setServiceStatusCallback(serviceStatusCallback); }
public void setGatewayStatusCallback(IGatewayStatusCallback gatewayStatusCallback) { getCallbackManager().setGatewayStatusCallback(gatewayStatusCallback); }
public void setDeliveryReportCallback(IDeliveryReportCallback deliveryStatusCallback) { getCallbackManager().setDeliveryReportCallback(deliveryStatusCallback); }
public void setMessageSentCallback(IMessageSentCallback messageSentCallback) { getCallbackManager().setMessageSentCallback(messageSentCallback); }
public void setQueueThresholdCallback(IQueueThresholdCallback queueThresholdCallback) { getCallbackManager().setQueueThresholdCallback(queueThresholdCallback); }
public void removeGroup(String groupId) { getGroupManager().removeGroup(groupId); }
public DeliveryStatus queryDeliveryStatus(String gatewayId, String operatorMessageId) throws Exception { try { return queryDeliveryStatus(getGatewayById(gatewayId), operatorMessageId); } catch (Exception e) { logger.error("Unhandled Exception!", e); throw e; } }
public void queueMessage(List<String> recipients, final String message) { for (String recipient : recipients) { OutboundMessage outboundMessage = getOutboundMessage(message, recipient); smslibService.queueMessage(outboundMessage); } }
public AbstractGateway getGatewayById(String id) { return getGateways().get(id); }
/** * <p>Constructor for UssdSessionStatusMatcher.</p> * * @param status a {@link org.smslib.USSDSessionStatus} object. */ public UssdSessionStatusMatcher(USSDSessionStatus status) { setText(status.name()); }
private boolean isPingRequest(InboundMessage msg) { return (!(msg instanceof InboundBinaryMessage)) && msg.getText() != null && (isPseudoPingRequest(msg) || isCanonicalPingRequest(msg)); }