Changes for Authentication. 

https://github.com/InMobi/hive/pull/32
I think casting would be required in jdk6