Package com.totvs.tjf.rac.maven.plugin
Class HttpClient
- java.lang.Object
-
- com.totvs.tjf.rac.maven.plugin.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 Summary
Constructors Constructor Description HttpClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
generateToken(String url, String clientId, String clientSecret)
Generate an authentication token to RAC.boolean
getJsonUsingHttpClient(String url, String token, Boolean isFeature, String hash)
Gets a features/roles in RAC, to verify if a hash already exists.String
getRacVersionUsingHttpClient(String url)
Get RAC version.void
postFeatureJsonUsingHttpClient(String url, String token, String hash, String jsonContent)
Sends the recovered features to RAC.void
postRoleJsonUsingHttpClient(String url, String token, String hash, String jsonContent)
Sends the recovered roles to RAC.
-
-
-
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
-
-