Class RestCommand


  • public class RestCommand
    extends Object
    Rest command does a rest call to OpenAM
    • Constructor Detail

      • RestCommand

        public RestCommand()
    • Method Detail

      • sendRestCommand

        public String sendRestCommand​(SSOTokenID ssoTokenID,
                                      URL url,
                                      String requestMethod,
                                      Map<String,​String> headers,
                                      String data)
                               throws IOException
        Run a rest command with a SSO Token
        Parameters:
        ssoTokenID - the SSO token ID used to authenticate the request
        url - the URL of the REST endpoint to call
        requestMethod - the HTTP request method (for example GET or POST)
        headers - the HTTP request headers to send
        data - the request body to send, or empty if there is none
        Returns:
        the response body read from the REST endpoint
        Throws:
        IOException - if an I/O error occurs while communicating with the endpoint
      • sendRestCommand

        public String sendRestCommand​(URL url,
                                      String requestMethod,
                                      Map<String,​String> headers,
                                      String data)
                               throws IOException
        Run a rest command
        Parameters:
        url - the URL of the REST endpoint to call
        requestMethod - the HTTP request method (for example GET or POST)
        headers - the HTTP request headers to send
        data - the request body to send, or empty if there is none
        Returns:
        the response body read from the REST endpoint
        Throws:
        IOException - if an I/O error occurs while communicating with the endpoint