Package com.isode.som

Class SomResponse


  • public class SomResponse
    extends java.lang.Object
    Class which handles a SOM command response. The essential functionality is in parsing the data string into a continuation ("*"), error ("NO") or successful ("OK") response and associated result data or error text.
    Author:
    tc
    • Constructor Summary

      Constructors 
      Constructor Description
      SomResponse()
      Create a new empty response object
      SomResponse​(int s, java.lang.String v)
      Create a SomResponse object with a given status and data
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean expectData()  
      java.lang.String getMessage()  
      int getStatus()  
      void parse()
      Parse response string into status indication and data
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SomResponse

        public SomResponse()
        Create a new empty response object
      • SomResponse

        public SomResponse​(int s,
                           java.lang.String v)
        Create a SomResponse object with a given status and data
        Parameters:
        s - status value
        v - data string
    • Method Detail

      • expectData

        public boolean expectData()
        Returns:
        indication of whether data should be expected for this response
      • parse

        public void parse()
                   throws SomException
        Parse response string into status indication and data
        Throws:
        SomException - indicating problem with data
      • getMessage

        public java.lang.String getMessage()
        Returns:
        message data
      • getStatus

        public int getStatus()
        Returns:
        status value