Javacode for IAM