Xpack with elasticsearch java rest client

Updating elastic to 5.x from 2.x needs shield security to be replaced with x-pack security and java Transport client with java Rest-High-Level client/Low-Level-Client.
Where can i find the information on how to use xpack with elasticsearch java rest client for version 5.6.2 and If no such information is present then how do i do it?(Because earlier I was providing shield username and password to java Transport client in my code and now with java Rest client coming into picture, i am not able to figure it out ) Plzz help :slight_smile:

This? https://www.elastic.co/guide/en/elasticsearch/client/java-rest/5.6/_basic_authentication.html

Transport client is still supported in 5.x (and 6.x, but deprecated in 7.x) - is there a specific reason why you are switching to the Rest client?
You can do so, but you are not required to.