Class ActionDeserializer

  • All Implemented Interfaces:
    SASConstants

    public class ActionDeserializer
    extends Object
    implements SASConstants
    Convert the request payload into objects

    Created by Jeff Gaynor
    on 8/15/22 at 8:42 AM

    • Constructor Detail

      • ActionDeserializer

        public ActionDeserializer()
    • Method Detail

      • rsaDeserialize

        public List<Action> rsaDeserialize​(SessionRecord sessionRecord,
                                           javax.servlet.http.HttpServletRequest request)
                                    throws IOException
        Given the request, grab the body of the post
        Parameters:
        sessionRecord -
        request -
        Returns:
        Throws:
        IOException
      • toActions

        public List<Action> toActions​(net.sf.json.JSONObject jsonObject)
        Options for format are
             {"sas":{simple action}}
         
        or
             {"sas":[{action0}, {action1},...]}
         
        This method always returns a List.
        Parameters:
        jsonObject -
        Returns:
      • toAction

        public Action toAction​(net.sf.json.JSONObject jsonObject)
        Takes a single known action item and returns the right one
        Parameters:
        jsonObject -
        Returns:
      • getAction

        public String getAction​(net.sf.json.JSONObject json)
        Returns the action to be done.
        Parameters:
        json -
        Returns: