Feature #2796: Add login method to Java api