Class HttpClient


  • public class HttpClient
    extends Object
    This class is responsible for making the communication between this maven plugin the the RAC services
    Author:
    Diego N. da Silveira
    • Constructor Detail

      • HttpClient

        public HttpClient()
    • Method Detail

      • postFeatureJsonUsingHttpClient

        public void postFeatureJsonUsingHttpClient​(String url,
                                                   String token,
                                                   String hash,
                                                   String jsonContent)
                                            throws org.apache.http.client.ClientProtocolException
        Sends the recovered features to RAC.
        Parameters:
        url - RAC Url.
        token - Authentication token.
        hash - RAC MD5 format hash.
        jsonContent - Data in JSON format.
        Throws:
        org.apache.http.client.ClientProtocolException - ClientProtocolException
      • postRoleJsonUsingHttpClient

        public void postRoleJsonUsingHttpClient​(String url,
                                                String token,
                                                String hash,
                                                String jsonContent)
                                         throws org.apache.http.client.ClientProtocolException
        Sends the recovered roles to RAC.
        Parameters:
        url - RAC Url.
        token - Authentication token.
        hash - RAC MD5 format hash.
        jsonContent - Data in JSON format.
        Throws:
        org.apache.http.client.ClientProtocolException - ClientProtocolException
      • getJsonUsingHttpClient

        public boolean getJsonUsingHttpClient​(String url,
                                              String token,
                                              Boolean isFeature,
                                              String hash)
                                       throws org.apache.http.client.ClientProtocolException
        Gets a features/roles in RAC, to verify if a hash already exists.
        Parameters:
        url - RAC Url.
        token - Authentication token.
        hash - RAC MD5 format hash.
        Returns:
        true if hash already exists on RAC.
        Throws:
        org.apache.http.client.ClientProtocolException - ClientProtocolException
      • getRacVersionUsingHttpClient

        public String getRacVersionUsingHttpClient​(String url)
                                            throws org.apache.http.client.ClientProtocolException
        Get RAC version.
        Parameters:
        url - RAC Url.
        Returns:
        RAC version.
        Throws:
        org.apache.http.client.ClientProtocolException - ClientProtocolException
      • generateToken

        public String generateToken​(String url,
                                    String clientId,
                                    String clientSecret)
                             throws org.apache.http.client.ClientProtocolException
        Generate an authentication token to RAC.
        Parameters:
        url - RAC Url.
        clientId - RAC client id.
        clientSecret - RAC client secret.
        Returns:
        token Authentication token to RAC.
        Throws:
        org.apache.http.client.ClientProtocolException - ClientProtocolException