Class MO

  • All Implemented Interfaces:
    java.io.Serializable

    public class MO
    extends java.lang.Object
    implements java.io.Serializable
    This represents an incoming MO callback request
    See Also:
    Serialized Form
    • Constructor Detail

      • MO

        public MO​(java.lang.String messageId,
                  MO.MESSAGE_TYPE messageType,
                  java.lang.String sender,
                  java.lang.String destination,
                  java.math.BigDecimal price,
                  java.util.Date timeStamp)
    • Method Detail

      • setTextData

        public void setTextData​(java.lang.String text,
                                java.lang.String keyword)
      • setBinaryData

        public void setBinaryData​(byte[] binaryMessageBody,
                                  byte[] userDataHeader)
      • setConcatenationData

        public void setConcatenationData​(java.lang.String concatReferenceNumber,
                                         int concatTotalParts,
                                         int concatPartNumber)
      • setNetworkCode

        public void setNetworkCode​(java.lang.String networkCode)
      • setSessionId

        public void setSessionId​(java.lang.String sessionId)
      • getMessageId

        public java.lang.String getMessageId()
        Returns:
        String the id assigned to this message by Nexmo before delivery
      • getMessageType

        public MO.MESSAGE_TYPE getMessageType()
        Returns:
        MESSAGE_TYPE describes what type of payload this message carries, eg, 8 bit text, unicode text or raw binary
      • getSender

        public java.lang.String getSender()
        Returns:
        String the phone number of the end user that sent this message
      • getDestination

        public java.lang.String getDestination()
        Returns:
        String the short-code/long code number that the end user sent the message to
      • getNetworkCode

        public java.lang.String getNetworkCode()
        Returns:
        String the network code (if available) of the end user
      • getKeyword

        public java.lang.String getKeyword()
        Returns:
        String return the first keyword of the message. If this is a shared short-code then this is what the message will have been routed by.
      • getMessageBody

        public java.lang.String getMessageBody()
        Returns:
        String The message payload if this is a TEXT or UNICODE message
      • getBinaryMessageBody

        public byte[] getBinaryMessageBody()
        Returns:
        byte[] the raw binary payload if this is a BINARY message
      • getUserDataHeader

        public byte[] getUserDataHeader()
        Returns:
        byte[] the raw binary user-data-header if applicable for this message
      • getPrice

        public java.math.BigDecimal getPrice()
        Returns:
        BigDecimal if a price was charged for receiving this message, then that is available here
      • getSessionId

        public java.lang.String getSessionId()
        Returns:
        String if this field is populated, then the value should be returned in any MT response
      • isConcat

        public boolean isConcat()
        Returns:
        boolean is this message part of a concatenated message that needs re-assembly
      • getConcatReferenceNumber

        public java.lang.String getConcatReferenceNumber()
        Returns:
        String if this message is part of a concatenated set, then this is the reference id that groups the parts together
      • getConcatTotalParts

        public int getConcatTotalParts()
        Returns:
        String if this message is part of a concatenated set, then this is the total number of parts in the set
      • getConcatPartNumber

        public int getConcatPartNumber()
        Returns:
        String if this message is part of a concatenated set, then this is the 'part number' within the set that this message carries
      • getTimeStamp

        public java.util.Date getTimeStamp()
        Returns:
        the timestamp this message was originally received by Nexmo