add API for java call