Package htwb.ai.controller.utils
Class RequestUtils
- java.lang.Object
-
- htwb.ai.controller.utils.RequestUtils
-
@Service public class RequestUtils extends java.lang.Object
- Since:
- : 15.02.21
-
-
Constructor Summary
Constructors Constructor Description RequestUtils()
RequestUtils(org.springframework.web.client.RestTemplate restTemplate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<SongData>
getSongsFromArtist(java.lang.String artist, java.lang.String jwt)
Get all the songs made from the given artist.
-
-
-
Method Detail
-
getSongsFromArtist
public java.util.List<SongData> getSongsFromArtist(java.lang.String artist, java.lang.String jwt) throws java.net.UnknownHostException, org.springframework.web.client.HttpClientErrorException, java.util.NoSuchElementException
Get all the songs made from the given artist. This will make a request to song service.- Parameters:
artist
- Artist to be searchedjwt
- Jwt token to be used in authorization header- Returns:
- Songs made from given artist, will throw exception if none found
- Throws:
java.net.UnknownHostException
- if host not resolvedorg.springframework.web.client.HttpClientErrorException
- if reply has no bodyjava.util.NoSuchElementException
- if no song for artist found
-
-