Class HtmlMessenger


  • public class HtmlMessenger
    extends java.lang.Object
    This class allows you to submit a URL and a String hash map of key-value pairs to be posted to the URL in question.
    • Constructor Summary

      Constructors 
      Constructor Description
      HtmlMessenger​(java.lang.String url, java.util.Map<java.lang.String,​java.lang.String> postList)
      Instantiate messenger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String executePost()
      Execute a post action and retrieve server reply This method executes the post created when this class is instantiated
      org.apache.http.impl.client.CloseableHttpClient getCommunicationLink​(java.lang.String url)
      Creates a client to communicate.
      • Methods inherited from class java.lang.Object

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

      • HtmlMessenger

        public HtmlMessenger​(java.lang.String url,
                             java.util.Map<java.lang.String,​java.lang.String> postList)
                      throws HtmlMessengerException
        Instantiate messenger
        Parameters:
        url - the HTTP POST URL
        postList - variables list in post
        Throws:
        HtmlMessengerException - if the POST failed
    • Method Detail

      • getCommunicationLink

        public org.apache.http.impl.client.CloseableHttpClient getCommunicationLink​(java.lang.String url)
                                                                             throws HtmlMessengerException
        Creates a client to communicate.
        Parameters:
        url - get a HTTP client connection
        Returns:
        if the connection is encrypted
        Throws:
        HtmlMessengerException - if connection to the URL failed
      • executePost

        public java.lang.String executePost()
                                     throws HtmlMessengerException
        Execute a post action and retrieve server reply This method executes the post created when this class is instantiated
        Returns:
        server reply
        Throws:
        HtmlMessengerException - if the HTTP POST failed